4 # Author: David Goodger <goodger@python.org>
5 # Copyright: This module has been placed in the public domain.
8 Tests for `docutils.transforms.references.TargetNotes` (via
9 `docutils.transforms.universal.LastReaderPending`).
12 from __init__
import DocutilsTestSupport
13 from docutils
.transforms
.references
import PropagateTargets
, \
14 AnonymousHyperlinks
, IndirectHyperlinks
, ExternalTargets
, \
15 InternalTargets
, DanglingReferences
, Footnotes
16 from docutils
.parsers
.rst
import Parser
21 s
= DocutilsTestSupport
.TransformTestSuite(parser
)
22 s
.generateTests(totest
)
27 totest
['tables_of_contents'] = ((PropagateTargets
, AnonymousHyperlinks
,
29 ExternalTargets
, InternalTargets
,
33 .. _target: http://exammple.org
35 A reference to a target_.
40 <document source="test data">
41 <target ids="target" names="target" refuri="http://exammple.org">
44 <reference name="target" refuri="http://exammple.org">
47 <footnote_reference auto="1" ids="id2" refid="id1">
49 <footnote auto="1" ids="id1" names="TARGET_NOTE:\\ id1">
51 <reference refuri="http://exammple.org">
55 .. _target: http://exammple.org
57 A reference to a target_.
59 .. target-notes:: :class: custom
62 <document source="test data">
63 <target ids="target" names="target" refuri="http://exammple.org">
66 <reference name="target" refuri="http://exammple.org">
68 <inline classes="custom">
70 <footnote_reference auto="1" classes="custom" ids="id2" refid="id1">
72 <footnote auto="1" ids="id1" names="TARGET_NOTE:\\ id1">
74 <reference refuri="http://exammple.org">
80 if __name__
== '__main__':
82 unittest
.main(defaultTest
='suite')