aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/google/devtools/build/docgen/RuleDocumentation.java8
-rw-r--r--src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java5
2 files changed, 11 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/docgen/RuleDocumentation.java b/src/main/java/com/google/devtools/build/docgen/RuleDocumentation.java
index f173bdfaa1..6b9d5ae4a6 100644
--- a/src/main/java/com/google/devtools/build/docgen/RuleDocumentation.java
+++ b/src/main/java/com/google/devtools/build/docgen/RuleDocumentation.java
@@ -60,6 +60,11 @@ public class RuleDocumentation implements Comparable<RuleDocumentation> {
private RuleLinkExpander linkExpander;
/**
+ * Name of the page documenting common build rule terms and concepts.
+ */
+ static final String COMMON_DEFINITIONS_PAGE = "common-definitions.html";
+
+ /**
* Creates a RuleDocumentation from the rule's name, type, family and raw html documentation
* (meaning without expanding the variables in the doc).
*/
@@ -250,7 +255,8 @@ public class RuleDocumentation implements Comparable<RuleDocumentation> {
String attrName = attributeDoc.getAttributeName();
// Generate the link for the attribute documentation
if (attributeDoc.isCommonType()) {
- sb.append(String.format("<a href=\"common-definitions.html#%s.%s\">%s</a>",
+ sb.append(String.format("<a href=\"%s#%s.%s\">%s</a>",
+ COMMON_DEFINITIONS_PAGE,
attributeDoc.getGeneratedInRule(ruleName).toLowerCase(),
attrName,
attrName));
diff --git a/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java b/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java
index b655284465..aec9eb1d91 100644
--- a/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java
+++ b/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java
@@ -182,7 +182,10 @@ public class RuleDocumentationAttribute implements Comparable<RuleDocumentationA
StringBuilder sb = new StringBuilder()
.append(TYPE_DESC.get(attribute.getType()))
.append("; " + (attribute.isMandatory() ? "required" : "optional"))
- .append(!attribute.isConfigurable() ? "; nonconfigurable" : "")
+ .append(!attribute.isConfigurable()
+ ? String.format("; <a href=\"%s#configurable-attributes\">nonconfigurable</a>",
+ RuleDocumentation.COMMON_DEFINITIONS_PAGE)
+ : "")
.append(getDefaultValue());
return sb.toString();
}