Docs: ctx: Add more cross-reference links
So readers don't have to manually find the referent when they want to learn more.
Assuming readers already have context isn't warranted, given Starlark isn't anyone's primary programming language.
RELNOTES: None.
PiperOrigin-RevId: 271007361
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkRuleContextApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkRuleContextApi.java
index 70b5203..8b2ee22 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkRuleContextApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/SkylarkRuleContextApi.java
@@ -63,45 +63,49 @@
       + "rules can refer to (allowing finer dependency control) instead of referencing the whole "
       + "rule.";
   public static final String EXECUTABLE_DOC =
-      "A <code>struct</code> containing executable files defined in label type "
-          + "attributes marked as <code>executable=True</code>. The struct fields correspond "
-          + "to the attribute names. Each value in the struct is either a <code>file</code> or "
-          + "<code>None</code>. If an optional attribute is not specified in the rule "
-          + "then the corresponding struct value is <code>None</code>. If a label type is not "
-          + "marked as <code>executable=True</code>, no corresponding struct field is generated. "
-          + "<a href=\"https://github.com/bazelbuild/examples/blob/master/rules/actions_run/"
+      "A <code>struct</code> containing executable files defined in <a "
+          + "href='attr.$DOC_EXT#label'>label type attributes</a> marked as <a "
+          + "href='attr.$DOC_EXT#label.executable'><code>executable=True</code><a>. The struct "
+          + "fields correspond to the attribute names. Each value in the struct is either a <a "
+          + "href='File.$DOC_EXT'><code>File</code></a> or <code>None</code>. If an optional "
+          + "attribute is not specified in the rule then the corresponding struct value is "
+          + "<code>None</code>. If a label type is not marked as <code>executable=True</code>, no "
+          + "corresponding struct field is generated. <a "
+          + "href=\"https://github.com/bazelbuild/examples/blob/master/rules/actions_run/"
           + "execute.bzl\">See example of use</a>.";
   public static final String FILES_DOC =
-      "A <code>struct</code> containing files defined in label or label list "
-          + "type attributes. The struct fields correspond to the attribute names. The struct "
-          + "values are <code>list</code> of <code>file</code>s.  "
-          + "It is a shortcut for:"
-          + "<pre class=language-python>[f for t in ctx.attr.<ATTR> for f in t.files]</pre> "
-          + "In other words, use <code>files</code> to access the "
-          + "<a href=\"../rules.$DOC_EXT#requesting-output-files\">default outputs</a> of a "
-          + "dependency. "
-          + "<a href=\"https://github.com/bazelbuild/examples/blob/master/rules/depsets/foo.bzl\">"
-          + "See example of use</a>.";
+      "A <code>struct</code> containing files defined in <a href='attr.$DOC_EXT#label'>label</a>"
+          + " or <a href='attr.$DOC_EXT#label_list'>label list</a> type attributes. The struct"
+          + " fields correspond to the attribute names. The struct values are <code>list</code> of"
+          + " <a href='File.$DOC_EXT'><code>File</code></a>s.  It is a shortcut for:<pre"
+          + " class=language-python>[f for t in ctx.attr.<ATTR> for f in t.files]</pre> In"
+          + " other words, use <code>files</code> to access the <a"
+          + " href=\"../rules.$DOC_EXT#requesting-output-files\">default outputs</a> of a"
+          + " dependency. <a"
+          + " href=\"https://github.com/bazelbuild/examples/blob/master/rules/depsets/foo.bzl\">See"
+          + " example of use</a>.";
   public static final String FILE_DOC =
-      "A <code>struct</code> containing files defined in label type "
-          + "attributes marked as <code>allow_single_file</code>. The struct fields correspond "
-          + "to the attribute names. The struct value is always a <code>file</code> or "
-          + "<code>None</code>. If an optional attribute is not specified in the rule "
-          + "then the corresponding struct value is <code>None</code>. If a label type is not "
-          + "marked as <code>allow_single_file</code>, no corresponding struct field is generated. "
-          + "It is a shortcut for:"
-          + "<pre class=language-python>list(ctx.attr.<ATTR>.files)[0]</pre>"
-          + "In other words, use <code>file</code> to access the (singular) "
-          + "<a href=\"../rules.$DOC_EXT#requesting-output-files\">default output</a> of a "
-          + "dependency. "
-          + "<a href=\"https://github.com/bazelbuild/examples/blob/master/rules/expand_template/"
-          + "hello.bzl\">See example of use</a>.";
+      "A <code>struct</code> containing files defined in <a href='attr.$DOC_EXT#label'>label type"
+          + " attributes</a> marked as <a"
+          + " href='attr.$DOC_EXT#label.allow_single_file'><code>allow_single_file</code></a>. The"
+          + " struct fields correspond to the attribute names. The struct value is always a <a"
+          + " href='File.$DOC_EXT'><code>File</code></a> or <code>None</code>. If an optional"
+          + " attribute is not specified in the rule then the corresponding struct value is"
+          + " <code>None</code>. If a label type is not marked as <code>allow_single_file</code>,"
+          + " no corresponding struct field is generated. It is a shortcut for:<pre"
+          + " class=language-python>list(ctx.attr.<ATTR>.files)[0]</pre>In other words, use"
+          + " <code>file</code> to access the (singular) <a"
+          + " href=\"../rules.$DOC_EXT#requesting-output-files\">default output</a> of a"
+          + " dependency. <a"
+          + " href=\"https://github.com/bazelbuild/examples/blob/master/rules/expand_template/hello.bzl\">See"
+          + " example of use</a>.";
   public static final String ATTR_DOC =
-      "A struct to access the values of the attributes. The values are provided by "
-          + "the user (if not, a default value is used). The attributes of the struct and the "
-          + "types of their values correspond to the keys and values of the <code>attrs</code> "
-          + "dict provided to the <code>rule</code> function. "
-          + "<a href=\"https://github.com/bazelbuild/examples/blob/master/rules/attributes/"
+      "A struct to access the values of the <a href='../rules.$DOC_EXT#attributes'>attributes</a>. "
+          + "The values are provided by the user (if not, a default value is used). The attributes "
+          + "of the struct and the types of their values correspond to the keys and values of the "
+          + "<a href='globals.$DOC_EXT#rule.attrs'><code>attrs</code> dict</a> provided to the <a "
+          + "href='globals.$DOC_EXT#rule'><code>rule</code> function</a>. <a "
+          + "href=\"https://github.com/bazelbuild/examples/blob/master/rules/attributes/"
           + "printer.bzl\">See example of use</a>.";
   public static final String SPLIT_ATTR_DOC =
       "A struct to access the values of attributes with split configurations. If the attribute is "