aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test
diff options
context:
space:
mode:
authorGravatar cparsons <cparsons@google.com>2018-07-09 11:06:57 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-09 11:10:53 -0700
commitfc0e52f975c846f3582cd960bb6562aba2da2cbe (patch)
tree06a94cebf89b6f862f02132ed1af7b081649af50 /src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test
parentd039f62a1c551d84f82b5253e75604ac15d89cb0 (diff)
Simple Markdown rendering for skydoc
This uses apache velocity engine templates to create markdown-HTML. There are other alternatives, but there is already precedent for depending on this library from docgen. RELNOTES: None. PiperOrigin-RevId: 203795431
Diffstat (limited to 'src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test')
-rw-r--r--src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test/golden.txt83
-rw-r--r--src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test/input.bzl6
2 files changed, 81 insertions, 8 deletions
diff --git a/src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test/golden.txt b/src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test/golden.txt
index b1a4a66325..1b2d0a0b52 100644
--- a/src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test/golden.txt
+++ b/src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test/golden.txt
@@ -1,12 +1,83 @@
-my_rule
+<a name="#my_rule"></a>
+## my_rule
+
+<pre>
+my_rule(first, second)
+</pre>
+
This is my rule. It does stuff.
-first,second
-other_rule
+### Attributes
+
+<table class="params-table">
+ <colgroup>
+ <col class="col-param" />
+ <col class="col-description" />
+ </colgroup>
+ <tbody>
+ <tr id="#my_rule_first">
+ <td><code>first</code></td>
+ <td>first my_rule doc string</td>
+ </tr>
+ <tr id="#my_rule_second">
+ <td><code>second</code></td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+
+<a name="#other_rule"></a>
+## other_rule
+
+<pre>
+other_rule(fourth, third)
+</pre>
+
This is another rule.
-third,fourth
-yet_another_rule
+### Attributes
+
+<table class="params-table">
+ <colgroup>
+ <col class="col-param" />
+ <col class="col-description" />
+ </colgroup>
+ <tbody>
+ <tr id="#other_rule_fourth">
+ <td><code>fourth</code></td>
+ <td></td>
+ </tr>
+ <tr id="#other_rule_third">
+ <td><code>third</code></td>
+ <td>third other_rule doc string</td>
+ </tr>
+ </tbody>
+</table>
+
+
+<a name="#yet_another_rule"></a>
+## yet_another_rule
+
+<pre>
+yet_another_rule(fifth)
+</pre>
+
This is yet another rule
-fifth
+
+### Attributes
+
+<table class="params-table">
+ <colgroup>
+ <col class="col-param" />
+ <col class="col-description" />
+ </colgroup>
+ <tbody>
+ <tr id="#yet_another_rule_fifth">
+ <td><code>fifth</code></td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
diff --git a/src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test/input.bzl b/src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test/input.bzl
index b331e602c2..efd5ed460c 100644
--- a/src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test/input.bzl
+++ b/src/test/java/com/google/devtools/build/skydoc/testdata/multiple_files_test/input.bzl
@@ -4,7 +4,8 @@ my_rule = rule(
implementation = my_rule_impl,
doc = "This is my rule. It does stuff.",
attrs = {
- "first": attr.label(mandatory = True, allow_files = True, single_file = True),
+ "first": attr.label(mandatory = True, doc = "first my_rule doc string",
+ allow_files = True, single_file = True),
"second": attr.string_dict(mandatory = True),
},
)
@@ -13,7 +14,8 @@ other_rule = rule(
implementation = my_rule_impl,
doc = "This is another rule.",
attrs = {
- "third": attr.label(mandatory = True, allow_files = True, single_file = True),
+ "third": attr.label(mandatory = True, doc = "third other_rule doc string",
+ allow_files = True, single_file = True),
"fourth": attr.string_dict(mandatory = True),
},
)