diff options
| author | Shulhan <ms@kilabit.info> | 2022-10-20 04:48:20 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-10-20 22:09:31 +0700 |
| commit | 26c0d32b05eefb9b7040be69717d58e62bbdac2f (patch) | |
| tree | 86d02f3bd444b5148733cee1dca2756bff1c1f3a /testdata | |
| parent | dc6f1e2a3e720b706dbf945ae6b608199f630fb4 (diff) | |
| download | asciidoctor-go-26c0d32b05eefb9b7040be69717d58e62bbdac2f.tar.xz | |
all: implement macro "footnote:"
Macro footnote grammar,
----
"footnote:" [ REF_ID ] "[" STRING "]"
----
In asciidoctor, footnote can be placed anywhere, even after WORD without
space in between.
The REF_ID, define the unique ID for footnote and can be used to reference
the previous footnote.
The first footnote with REF_ID, should have the STRING defined.
The next footnote with the same REF_ID, should not have the STRING
defined; if its defined, the STRING is ignored.
Diffstat (limited to 'testdata')
| -rw-r--r-- | testdata/inline_parser/macro_footnote_externalized_test.txt | 56 | ||||
| -rw-r--r-- | testdata/inline_parser/macro_footnote_test.txt | 55 | ||||
| -rw-r--r-- | testdata/test.got.html | 4 |
3 files changed, 113 insertions, 2 deletions
diff --git a/testdata/inline_parser/macro_footnote_externalized_test.txt b/testdata/inline_parser/macro_footnote_externalized_test.txt new file mode 100644 index 0000000..bd8736c --- /dev/null +++ b/testdata/inline_parser/macro_footnote_externalized_test.txt @@ -0,0 +1,56 @@ +>>> input.adoc +:fn-hail-and-rainbow: footnote:[The _double_ hail-and-rainbow level makes my toes tingle.] +:fn-disclaimer: footnote:disclaimer[Opinions are my own.] + +The hail-and-rainbow protocol can be initiated at five levels: + +. double{fn-hail-and-rainbow} +. tertiary +. supernumerary +. supermassive +. apocalyptic + +A bold statement!{fn-disclaimer} + +Another outrageous statement.{fn-disclaimer} + +<<< output.html + +<div class="paragraph"> +<p>The hail-and-rainbow protocol can be initiated at five levels:</p> +</div> +<div class="olist arabic"> +<ol class="arabic"> +<li> +<p>double<sup class="footnote">[<a id="_footnoteref_1" class="footnote" href="#_footnotedef_1" title="View footnote.">1</a>]</sup> +</p> +</li> +<li> +<p>tertiary</p> +</li> +<li> +<p>supernumerary</p> +</li> +<li> +<p>supermassive</p> +</li> +<li> +<p>apocalyptic</p> +</li> +</ol> +</div> +<div class="paragraph"> +<p>A bold statement!<sup class="footnote" id="_footnote_disclaimer">[<a id="_footnoteref_2" class="footnote" href="#_footnotedef_2" title="View footnote.">2</a>]</sup></p> +</div> +<div class="paragraph"> +<p>Another outrageous statement.<sup class="footnoteref">[<a class="footnote" href="#_footnotedef_2" title="View footnote.">2</a>]</sup></p> +</div> +<div id="footnotes"> +<hr> +<div class="footnote" id="_footnotedef_1"> +<a href="#_footnoteref_1">1</a>. The <em>double</em> hail-and-rainbow level makes my toes tingle. +</div> +<div class="footnote" id="_footnotedef_2"> +<a href="#_footnoteref_2">2</a>. Opinions are my own. +</div> +</div> diff --git a/testdata/inline_parser/macro_footnote_test.txt b/testdata/inline_parser/macro_footnote_test.txt new file mode 100644 index 0000000..f89c0c1 --- /dev/null +++ b/testdata/inline_parser/macro_footnote_test.txt @@ -0,0 +1,55 @@ + +>>> input.adoc + +The hail-and-rainbow protocol can be initiated at five levels: + +. doublefootnote:[The _double_ hail-and-rainbow level makes my toes tingle.] +. tertiary +. supernumerary +. supermassive +. apocalyptic + +A bold statement!footnote:disclaimer[Opinions are my own.] + +Another outrageous statement.footnote:disclaimer[] + +<<< output.html + +<div class="paragraph"> +<p>The hail-and-rainbow protocol can be initiated at five levels:</p> +</div> +<div class="olist arabic"> +<ol class="arabic"> +<li> +<p>double<sup class="footnote">[<a id="_footnoteref_1" class="footnote" href="#_footnotedef_1" title="View footnote.">1</a>]</sup> +</p> +</li> +<li> +<p>tertiary</p> +</li> +<li> +<p>supernumerary</p> +</li> +<li> +<p>supermassive</p> +</li> +<li> +<p>apocalyptic</p> +</li> +</ol> +</div> +<div class="paragraph"> +<p>A bold statement!<sup class="footnote" id="_footnote_disclaimer">[<a id="_footnoteref_2" class="footnote" href="#_footnotedef_2" title="View footnote.">2</a>]</sup></p> +</div> +<div class="paragraph"> +<p>Another outrageous statement.<sup class="footnoteref">[<a class="footnote" href="#_footnotedef_2" title="View footnote.">2</a>]</sup></p> +</div> +<div id="footnotes"> +<hr> +<div class="footnote" id="_footnotedef_1"> +<a href="#_footnoteref_1">1</a>. The <em>double</em> hail-and-rainbow level makes my toes tingle. +</div> +<div class="footnote" id="_footnotedef_2"> +<a href="#_footnoteref_2">2</a>. Opinions are my own. +</div> +</div> diff --git a/testdata/test.got.html b/testdata/test.got.html index 33b917d..d21e7a4 100644 --- a/testdata/test.got.html +++ b/testdata/test.got.html @@ -6,7 +6,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="Author A, Author mid dle B"> <meta name="description" content="meta description"> -<meta name="generator" content="asciidoctor-go 0.3.1"> +<meta name="generator" content="asciidoctor-go 0.3.2"> <meta name="keywords" content="key, words"> <title>Example Document title</title> <style> @@ -3000,7 +3000,7 @@ this sidebar.</p> <div id="footer"> <div id="footer-text"> 1.1.1<br> -Last updated 2022-09-04 23:41:43 +0700 +Last updated 2022-10-18 00:21:58 +0700 </div> </div> </body> |
