1 # -*- coding: utf-8 -*- |
|
2 """ |
|
3 sphinx.addnodes |
|
4 ~~~~~~~~~~~~~~~ |
|
5 |
|
6 Additional docutils nodes. |
|
7 |
|
8 :copyright: 2007-2008 by Georg Brandl. |
|
9 :license: BSD. |
|
10 """ |
|
11 |
|
12 from docutils import nodes |
|
13 |
|
14 # index markup |
|
15 class index(nodes.Invisible, nodes.Inline, nodes.TextElement): pass |
|
16 |
|
17 # description units (classdesc, funcdesc etc.) |
|
18 |
|
19 # parent node for signature and content |
|
20 class desc(nodes.Admonition, nodes.Element): pass |
|
21 |
|
22 # additional name parts (module name, class name) |
|
23 class desc_addname(nodes.Part, nodes.Inline, nodes.TextElement): pass |
|
24 # compatibility alias |
|
25 desc_classname = desc_addname |
|
26 # return type (C); object type, e.g. -> annotation (Python) |
|
27 class desc_type(nodes.Part, nodes.Inline, nodes.TextElement): pass |
|
28 # main name of object |
|
29 class desc_name(nodes.Part, nodes.Inline, nodes.TextElement): pass |
|
30 # argument list |
|
31 class desc_signature(nodes.Part, nodes.Inline, nodes.TextElement): pass |
|
32 class desc_parameterlist(nodes.Part, nodes.Inline, nodes.TextElement): |
|
33 child_text_separator = ', ' |
|
34 class desc_parameter(nodes.Part, nodes.Inline, nodes.TextElement): pass |
|
35 class desc_optional(nodes.Part, nodes.Inline, nodes.TextElement): |
|
36 child_text_separator = ', ' |
|
37 def astext(self): |
|
38 return '[' + nodes.TextElement.astext(self) + ']' |
|
39 # annotation (not Python 3-style annotations) |
|
40 class desc_annotation(nodes.Part, nodes.Inline, nodes.TextElement): pass |
|
41 |
|
42 # node for content |
|
43 class desc_content(nodes.General, nodes.Element): pass |
|
44 |
|
45 # \versionadded, \versionchanged, \deprecated |
|
46 class versionmodified(nodes.Admonition, nodes.TextElement): pass |
|
47 |
|
48 # seealso |
|
49 class seealso(nodes.Admonition, nodes.Element): pass |
|
50 |
|
51 # productionlist |
|
52 class productionlist(nodes.Admonition, nodes.Element): pass |
|
53 class production(nodes.Part, nodes.Inline, nodes.TextElement): pass |
|
54 |
|
55 # toc tree |
|
56 class toctree(nodes.General, nodes.Element): pass |
|
57 |
|
58 # centered |
|
59 class centered(nodes.Part, nodes.Element): pass |
|
60 |
|
61 # pending xref |
|
62 class pending_xref(nodes.Element): pass |
|
63 |
|
64 # compact paragraph -- never makes a <p> |
|
65 class compact_paragraph(nodes.paragraph): pass |
|
66 |
|
67 # for the ACKS list |
|
68 class acks(nodes.Element): pass |
|
69 |
|
70 # sets the highlighting language for literal blocks |
|
71 class highlightlang(nodes.Element): pass |
|
72 |
|
73 # like emphasis, but doesn't apply further text processors, e.g. smartypants |
|
74 class literal_emphasis(nodes.emphasis): pass |
|
75 |
|
76 # glossary |
|
77 class glossary(nodes.Element): pass |
|
78 |
|
79 # module declaration |
|
80 class module(nodes.Element): pass |
|
81 |
|
82 # start of a file, used in the LaTeX builder only |
|
83 class start_of_file(nodes.Element): pass |
|
84 |
|
85 # tabular column specification, used for the LaTeX writer |
|
86 class tabular_col_spec(nodes.Element): pass |
|
87 |
|
88 # meta directive -- same as docutils' standard meta node, but pickleable |
|
89 class meta(nodes.Special, nodes.PreBibliographic, nodes.Element): pass |
|
90 |
|
91 # make them known to docutils. this is needed, because the HTML writer |
|
92 # will choke at some point if these are not added |
|
93 nodes._add_node_class_names("""index desc desc_content desc_signature desc_type |
|
94 desc_addname desc_name desc_parameterlist desc_parameter desc_optional |
|
95 centered versionmodified seealso productionlist production toctree |
|
96 pending_xref compact_paragraph highlightlang literal_emphasis |
|
97 glossary acks module start_of_file tabular_col_spec meta""".split()) |
|