aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build
diff options
context:
space:
mode:
authorGravatar David Chen <dzc@google.com>2016-08-16 08:43:43 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-08-16 15:21:34 +0000
commit60af9dba69da660407489f30a842b32b56266a28 (patch)
treef5d4166a9d1c0171e29df1fe3131bcf1af1e0ead /src/main/java/com/google/devtools/build
parent753bcacfb7da3b04c68a30f11b9162653163ef3b (diff)
Deprecate the ${link page.heading} syntax for referencing BE static pages.
-- MOS_MIGRATED_REVID=130374987
Diffstat (limited to 'src/main/java/com/google/devtools/build')
-rw-r--r--src/main/java/com/google/devtools/build/docgen/RuleLinkExpander.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/java/com/google/devtools/build/docgen/RuleLinkExpander.java b/src/main/java/com/google/devtools/build/docgen/RuleLinkExpander.java
index e7d8b38251..d73bf5305e 100644
--- a/src/main/java/com/google/devtools/build/docgen/RuleLinkExpander.java
+++ b/src/main/java/com/google/devtools/build/docgen/RuleLinkExpander.java
@@ -107,17 +107,16 @@ class RuleLinkExpander {
}
// The name is not the name of a rule but is the name of a static page, such as
- // common-definitions. Generate a link to that page, and append the page heading if
- // specified. For example, ${link common-definitions.label-expansion} expands to
- // common-definitions.html#label-expansion.
- // TODO(dzc): Deprecate this in favor of the ${link static-page#heading} syntax below.
+ // common-definitions. Generate a link to that page.
if (STATIC_PAGES.contains(name)) {
String link = name + ".html";
- // The fourth capture group matches the attribute name, or page heading, e.g.
- // "label-expansion" in "common-definitions.label-expansion".
+ // For referencing headings on a static page, use the following syntax:
+ // ${link static_page_name#heading_name}, example: ${link make-variables#gendir}
String pageHeading = matcher.group(4);
if (pageHeading != null) {
- link = link + "#" + pageHeading;
+ throw new IllegalArgumentException(
+ "Invalid link syntax for BE page: " + matcher.group()
+ + "\nUse ${link static-page#heading} syntax instead.");
}
matcher.appendReplacement(sb, Matcher.quoteReplacement(link));
continue;