diff options
author | 2015-08-18 08:39:51 +0000 | |
---|---|---|
committer | 2015-08-18 10:40:32 +0000 | |
commit | 31fce1489daf5a31461b0d41e3d4e200bb22f2d3 (patch) | |
tree | 333c79a396c4ce5248210fe8516dec2044d73636 /src/main/java/com/google/devtools/build/docgen/templates/build-encyclopedia.vm | |
parent | 8fdb5d0db4170bd41ef2a91c9eed4801dca84de1 (diff) |
Move presentation-specific logic from BE docgen into Velocity templates. Make
documentation of predefined attributes consistent with new look and feel.
--
MOS_MIGRATED_REVID=100905320
Diffstat (limited to 'src/main/java/com/google/devtools/build/docgen/templates/build-encyclopedia.vm')
-rw-r--r-- | src/main/java/com/google/devtools/build/docgen/templates/build-encyclopedia.vm | 63 |
1 files changed, 58 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/docgen/templates/build-encyclopedia.vm b/src/main/java/com/google/devtools/build/docgen/templates/build-encyclopedia.vm index aa7f4fa82f..2fbc20db66 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/build-encyclopedia.vm +++ b/src/main/java/com/google/devtools/build/docgen/templates/build-encyclopedia.vm @@ -2,6 +2,60 @@ #parse("com/google/devtools/build/docgen/templates/be-header.vm") +#macro(ruledoc $ruleDocs) + #foreach ($rule in $ruleDocs) + <h3 id="${rule.ruleName}"#if($rule.isDeprecated()) class="deprecated"#end> + ${rule.ruleName} + </h3> + + <pre class="rule-signature">${rule.attributeSignature}</pre> + + $rule.htmlDocumentation + + <h4 id="${rule.ruleName}_args">Arguments</h4> + <table class="table table-condensed table-bordered table-params"> + <colgroup> + <col class="col-param" /> + <col class="param-description" /> + </colgroup> + <thead> + <tr> + <th>Attribute</th> + <th>Description</th> + </tr> + </thead> + <tbody> + <tr> + <td id="${rule.ruleName}.name"><code>name</code></td> + <td> + <p><code><a href="build-ref.html#name">Name</a>; required</code></p> + <p>A unique name for this rule.</p> + ${rule.nameExtraHtmlDoc} + </td> + </tr> + #foreach ($attribute in $rule.attributes) + #if (!$attribute.isCommonType()) + <tr> + <td id="${rule.ruleName.toLowerCase()}.${attribute.attributeName}"#if($attribute.isDeprecated()) class="deprecated"#end> + <code>${attribute.attributeName}</code> + </td> + <td> + #if (!$attribute.synopsis.isEmpty()) + <p><code>${attribute.synopsis}</code></p> + #end + $attribute.htmlDocumentation + </td> + </tr> + #end + #end + </tbody> + </table> + #if ($rule.isPublicByDefault()) + The default visibility is public: <code>visibility = ["//visibility:public"]</code>. + #end + #end +#end + <!-- ============================================ binary ============================================ @@ -11,7 +65,7 @@ <p>A <code>*_binary</code> rule compiles an application. This might be an executable, a <code>.jar</code> file, and/or a collection of scripts.</p> -${SECTION_BINARY} +#ruledoc($binaryDocs) <!-- ============================================ library @@ -24,7 +78,7 @@ ${SECTION_BINARY} the corresponding <code><var>language</var>_binary</code> rule, but doesn't generate an executable.</p> -${SECTION_LIBRARY} +#ruledoc($libraryDocs) <!-- ============================================ test @@ -34,8 +88,7 @@ ${SECTION_LIBRARY} <p>A <code>*_test</code> rule compiles a test. - -${SECTION_TEST} +#ruledoc($testDocs) <!-- ============================================ variables @@ -240,7 +293,7 @@ in your genrule's cmd attribute. --> <h2 id="misc">Other Stuff</h2> -${SECTION_OTHER} +#ruledoc($otherDocs) #parse("com/google/devtools/build/docgen/templates/be-footer.vm") |