Skip to content

Commit

Permalink
test: add rst citations and footnote (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
miketheman authored Nov 1, 2022
1 parent 99930f7 commit da1a5a4
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/fixtures/test_rst_citations.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<p>Citation references, like <a href="#cit2002" id="citation-reference-1" rel="nofollow">[CIT2002]</a>.
Note that citations may get
rearranged, e.g., to the bottom of
the “page”.</p>
<div class="citation-list">
<div class="citation" id="cit2002">
<span class="label"><span class="fn-bracket">[</span><a href="#citation-reference-1" rel="nofollow">CIT2002</a><span class="fn-bracket">]</span></span>
<p>A citation
(as often used in journals).</p>
</div>
</div>
<p>Citation labels contain alphanumerics,
underlines, hyphens and fullstops.
Case is not significant.</p>
<p>Given a citation like <a href="#this" id="citation-reference-2" rel="nofollow">[this]</a>, one
can also refer to it like <a href="#this" rel="nofollow">this</a>.</p>
<div class="citation-list">
<div class="citation" id="this">
<span class="label"><span class="fn-bracket">[</span><a href="#citation-reference-2" rel="nofollow">this</a><span class="fn-bracket">]</span></span>
<p>here.</p>
</div>
</div>
18 changes: 18 additions & 0 deletions tests/fixtures/test_rst_citations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. Citations https://docutils.sourceforge.io/docs/user/rst/quickref.html#citations
Citation references, like [CIT2002]_.
Note that citations may get
rearranged, e.g., to the bottom of
the "page".

.. [CIT2002] A citation
(as often used in journals).
Citation labels contain alphanumerics,
underlines, hyphens and fullstops.
Case is not significant.

Given a citation like [this]_, one
can also refer to it like this_.

.. [this] here.
48 changes: 48 additions & 0 deletions tests/fixtures/test_rst_footnotes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<p>Footnote references, like <a href="#footnote-1" id="footnote-reference-1" rel="nofollow"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></a>.
Note that footnotes may get
rearranged, e.g., to the bottom of
the “page”.</p>
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="footnote-1">
<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-1" rel="nofollow">5</a><span class="fn-bracket">]</span></span>
<p>A numerical footnote. Note
there’s no colon after the <span class="docutils literal">]</span>.</p>
</aside>
</aside>
<p>Autonumbered footnotes are
possible, like using <a href="#footnote-2" id="footnote-reference-2" rel="nofollow"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a> and <a href="#footnote-3" id="footnote-reference-3" rel="nofollow"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>.</p>
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="footnote-2">
<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-2" rel="nofollow">1</a><span class="fn-bracket">]</span></span>
<p>This is the first one.</p>
</aside>
<aside class="footnote brackets" id="footnote-3">
<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-3" rel="nofollow">2</a><span class="fn-bracket">]</span></span>
<p>This is the second one.</p>
</aside>
</aside>
<p>They may be assigned ‘autonumber
labels’ - for instance,
<a href="#fourth" id="footnote-reference-4" rel="nofollow"><span class="fn-bracket">[</span>4<span class="fn-bracket">]</span></a> and <a href="#third" id="footnote-reference-5" rel="nofollow"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a>.</p>
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="third">
<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-5" rel="nofollow">3</a><span class="fn-bracket">]</span></span>
<p>a.k.a. <a href="#third" rel="nofollow">third</a></p>
</aside>
<aside class="footnote brackets" id="fourth">
<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-4" rel="nofollow">4</a><span class="fn-bracket">]</span></span>
<p>a.k.a. <a href="#fourth" rel="nofollow">fourth</a></p>
</aside>
</aside>
<p>Auto-symbol footnotes are also
possible, like this: <a href="#footnote-4" id="footnote-reference-6" rel="nofollow"><span class="fn-bracket">[</span>*<span class="fn-bracket">]</span></a> and <a href="#footnote-5" id="footnote-reference-7" rel="nofollow"><span class="fn-bracket">[</span><span class="fn-bracket">]</span></a>.</p>
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="footnote-4">
<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-6" rel="nofollow">*</a><span class="fn-bracket">]</span></span>
<p>This is the first one.</p>
</aside>
<aside class="footnote brackets" id="footnote-5">
<span class="label"><span class="fn-bracket">[</span><a href="#footnote-reference-7" rel="nofollow"></a><span class="fn-bracket">]</span></span>
<p>This is the second one.</p>
</aside>
</aside>
29 changes: 29 additions & 0 deletions tests/fixtures/test_rst_footnotes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. Footnotes https://docutils.sourceforge.io/docs/user/rst/quickref.html#footnotes
Footnote references, like [5]_.
Note that footnotes may get
rearranged, e.g., to the bottom of
the "page".

.. [5] A numerical footnote. Note
there's no colon after the ``]``.
Autonumbered footnotes are
possible, like using [#]_ and [#]_.

.. [#] This is the first one.
.. [#] This is the second one.
They may be assigned 'autonumber
labels' - for instance,
[#fourth]_ and [#third]_.

.. [#third] a.k.a. third_
.. [#fourth] a.k.a. fourth_
Auto-symbol footnotes are also
possible, like this: [*]_ and [*]_.

.. [*] This is the first one.
.. [*] This is the second one.

0 comments on commit da1a5a4

Please sign in to comment.