Split Skylark Library into multiple pages, one per module. Add collapsible
submenus to sidebar, and expand and highlight the link for the current page.
Collapse sidebar on mobile and expose button for toggling sidebar.

--
MOS_MIGRATED_REVID=100836792
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java
index fc85bb1..9c3fedf 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java
@@ -44,10 +44,9 @@
 /**
  * A helper class to provide Attr module in Skylark.
  *
- * It exposes functions (e.g. 'attr.string', 'attr.label_list', etc.) to Skylark
+ * <p>It exposes functions (e.g. 'attr.string', 'attr.label_list', etc.) to Skylark
  * users. The functions are executed through reflection. As everywhere in Skylark,
  * arguments are type-checked with the signature and cannot be null.
- *
  */
 @SkylarkModule(
   name = "attr",
@@ -55,7 +54,7 @@
   onlyLoadingPhase = true,
   doc =
       "Module for creating new attributes. "
-          + "They are only for use with the <a href=\"#modules._top_level.rule\">rule</a> function."
+          + "They are only for use with the <a href=\"globals.html#rule\">rule</a> function."
 )
 public final class SkylarkAttr {
 
@@ -463,7 +462,7 @@
     name = "label_list",
     doc =
         "Creates an attribute of type list of labels. "
-            + "See <a href=\"#modules.attr.label\">label</a> for more information.",
+            + "See <a href=\"attr.html#label\">label</a> for more information.",
     objectType = SkylarkAttr.class,
     returnType = Attribute.Builder.class,
     optionalNamedOnly = {
@@ -623,7 +622,7 @@
     name = "output_list",
     doc =
         "Creates an attribute of type list of outputs. Its default value is <code>[]</code>. "
-            + "See <a href=\"#modules.attr.output\">output</a> above for more information.",
+            + "See <a href=\"attr.html#output\">output</a> above for more information.",
     objectType = SkylarkAttr.class,
     returnType = Attribute.Builder.class,
     optionalNamedOnly = {
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkFileType.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkFileType.java
index 0571cb4..e47b47e 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkFileType.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkFileType.java
@@ -47,9 +47,9 @@
 
   @SkylarkCallable(doc =
       "Returns a list created from the elements of the parameter containing all the "
-    + "<a href=\"#modules.File\"><code>File</code></a>s that match the FileType. The parameter "
-    + "must be a <a href=\"#modules.set\"><code>set</code></a> or a "
-    + "<a href=\"#modules.list\"><code>list</code></a>.")
+    + "<a href=\"File.html\"><code>File</code></a>s that match the FileType. The parameter "
+    + "must be a <a href=\"set.html\"><code>set</code></a> or a "
+    + "<a href=\"list.html\"><code>list</code></a>.")
   public List<Artifact> filter(Iterable<Artifact> files) {
     return ImmutableList.copyOf(FileType.filter(files, fileType));
   }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java
index e128d7e..2f12950 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java
@@ -191,7 +191,7 @@
       mandatoryPositionals = {
         @Param(name = "implementation", type = BaseFunction.class,
             doc = "the function implementing this rule, must have exactly one parameter: "
-            + "<a href=\"#modules.ctx\">ctx</a>. The function is called during the analysis phase "
+            + "<a href=\"ctx.html\">ctx</a>. The function is called during the analysis phase "
             + "for each instance of the rule. It can access the attributes provided by the user. "
             + "It must create actions to generate all the declared outputs.")
       },
@@ -202,7 +202,7 @@
             + "and there must be an action that generates <code>ctx.outputs.executable</code>."),
         @Param(name = "attrs", type = Map.class, noneable = true, defaultValue = "None", doc =
             "dictionary to declare all the attributes of the rule. It maps from an attribute name "
-            + "to an attribute object (see <a href=\"#modules.attr\">attr</a> module). "
+            + "to an attribute object (see <a href=\"attr.html\">attr</a> module). "
             + "Attributes starting with <code>_</code> are private, and can be used to add "
             + "an implicit dependency on a label. The attribute <code>name</code> is implicitly "
             + "added and must not be specified. Attributes <code>visibility</code>, "
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java
index 385b04d..8221066 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java
@@ -329,14 +329,14 @@
   }
 
   @SkylarkCallable(name = "configuration", structField = true,
-      doc = "Returns the default configuration. See the <a href=\"#modules.configuration\">"
+      doc = "Returns the default configuration. See the <a href=\"configuration.html\">"
           + "configuration</a> type for more details.")
   public BuildConfiguration getConfiguration() {
     return ruleContext.getConfiguration();
   }
 
   @SkylarkCallable(name = "host_configuration", structField = true,
-      doc = "Returns the host configuration. See the <a href=\"#modules.configuration\">"
+      doc = "Returns the host configuration. See the <a href=\"configuration.html\">"
           + "configuration</a> type for more details.")
   public BuildConfiguration getHostConfiguration() {
     return ruleContext.getHostConfiguration();