Website: add template and basic stylesheet with menu. Update buildhtml.py (and theref...
[docutils.git] / sandbox / gitpull / web_stylesheet_and_menu / test / test_transforms / test_target_notes.py
blob674f517049c5b381e2bc7571c7f67a7bc7acb6a3
1 #! /usr/bin/env python
3 # $Id$
4 # Author: David Goodger <goodger@python.org>
5 # Copyright: This module has been placed in the public domain.
7 """
8 Tests for `docutils.transforms.references.TargetNotes` (via
9 `docutils.transforms.universal.LastReaderPending`).
10 """
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
19 def suite():
20 parser = Parser()
21 s = DocutilsTestSupport.TransformTestSuite(parser)
22 s.generateTests(totest)
23 return s
25 totest = {}
27 totest['tables_of_contents'] = ((PropagateTargets, AnonymousHyperlinks,
28 IndirectHyperlinks,
29 ExternalTargets, InternalTargets,
30 DanglingReferences,
31 ), [
32 ["""\
33 .. _target: http://exammple.org
35 A reference to a target_.
37 .. target-notes::
38 """,
39 """\
40 <document source="test data">
41 <target ids="target" names="target" refuri="http://exammple.org">
42 <paragraph>
43 A reference to a \n\
44 <reference name="target" refuri="http://exammple.org">
45 target
46 \n\
47 <footnote_reference auto="1" ids="id2" refid="id1">
49 <footnote auto="1" ids="id1" names="TARGET_NOTE:\\ id1">
50 <paragraph>
51 <reference refuri="http://exammple.org">
52 http://exammple.org
53 """],
54 ["""\
55 .. _target: http://exammple.org
57 A reference to a target_.
59 .. target-notes:: :class: custom
60 """,
61 """\
62 <document source="test data">
63 <target ids="target" names="target" refuri="http://exammple.org">
64 <paragraph>
65 A reference to a \n\
66 <reference name="target" refuri="http://exammple.org">
67 target
68 <inline classes="custom">
69 \n\
70 <footnote_reference auto="1" classes="custom" ids="id2" refid="id1">
72 <footnote auto="1" ids="id1" names="TARGET_NOTE:\\ id1">
73 <paragraph>
74 <reference refuri="http://exammple.org">
75 http://exammple.org
76 """],
80 if __name__ == '__main__':
81 import unittest
82 unittest.main(defaultTest='suite')