2007-07-23 04:02:25 -05:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
sphinx.addnodes
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
2008-01-16 14:27:25 -06:00
|
|
|
Additional docutils nodes.
|
|
|
|
|
2008-01-11 08:18:19 -06:00
|
|
|
:copyright: 2007-2008 by Georg Brandl.
|
|
|
|
:license: BSD.
|
2007-07-23 04:02:25 -05:00
|
|
|
"""
|
|
|
|
|
|
|
|
from docutils import nodes
|
|
|
|
|
|
|
|
# index markup
|
|
|
|
class index(nodes.Invisible, nodes.Inline, nodes.TextElement): pass
|
|
|
|
|
|
|
|
# description units (classdesc, funcdesc etc.)
|
2008-06-18 13:16:25 -05:00
|
|
|
|
|
|
|
# parent node for signature and content
|
2007-07-23 04:02:25 -05:00
|
|
|
class desc(nodes.Admonition, nodes.Element): pass
|
2008-06-18 13:16:25 -05:00
|
|
|
|
|
|
|
# additional name parts (module name, class name)
|
|
|
|
class desc_addname(nodes.Part, nodes.Inline, nodes.TextElement): pass
|
|
|
|
# compatibility alias
|
|
|
|
desc_classname = desc_addname
|
2008-12-25 15:06:10 -06:00
|
|
|
# return type (C); object type
|
2007-12-05 20:00:01 -06:00
|
|
|
class desc_type(nodes.Part, nodes.Inline, nodes.TextElement): pass
|
2008-12-25 15:06:10 -06:00
|
|
|
# -> annotation (Python)
|
|
|
|
class desc_returns(desc_type):
|
|
|
|
def astext(self):
|
|
|
|
return ' -> ' + nodes.TextElement.astext(self)
|
2008-06-18 13:16:25 -05:00
|
|
|
# main name of object
|
2007-07-23 04:02:25 -05:00
|
|
|
class desc_name(nodes.Part, nodes.Inline, nodes.TextElement): pass
|
2008-06-18 13:16:25 -05:00
|
|
|
# argument list
|
|
|
|
class desc_signature(nodes.Part, nodes.Inline, nodes.TextElement): pass
|
2007-12-05 20:00:01 -06:00
|
|
|
class desc_parameterlist(nodes.Part, nodes.Inline, nodes.TextElement):
|
|
|
|
child_text_separator = ', '
|
2007-07-23 04:02:25 -05:00
|
|
|
class desc_parameter(nodes.Part, nodes.Inline, nodes.TextElement): pass
|
2007-12-05 20:00:01 -06:00
|
|
|
class desc_optional(nodes.Part, nodes.Inline, nodes.TextElement):
|
|
|
|
child_text_separator = ', '
|
|
|
|
def astext(self):
|
|
|
|
return '[' + nodes.TextElement.astext(self) + ']'
|
2008-06-23 07:04:56 -05:00
|
|
|
# annotation (not Python 3-style annotations)
|
|
|
|
class desc_annotation(nodes.Part, nodes.Inline, nodes.TextElement): pass
|
2007-07-23 04:02:25 -05:00
|
|
|
|
2008-06-18 13:16:25 -05:00
|
|
|
# node for content
|
|
|
|
class desc_content(nodes.General, nodes.Element): pass
|
|
|
|
|
2007-07-23 04:02:25 -05:00
|
|
|
# \versionadded, \versionchanged, \deprecated
|
|
|
|
class versionmodified(nodes.Admonition, nodes.TextElement): pass
|
|
|
|
|
|
|
|
# seealso
|
|
|
|
class seealso(nodes.Admonition, nodes.Element): pass
|
|
|
|
|
|
|
|
# productionlist
|
|
|
|
class productionlist(nodes.Admonition, nodes.Element): pass
|
|
|
|
class production(nodes.Part, nodes.Inline, nodes.TextElement): pass
|
|
|
|
|
|
|
|
# toc tree
|
|
|
|
class toctree(nodes.General, nodes.Element): pass
|
|
|
|
|
|
|
|
# centered
|
|
|
|
class centered(nodes.Part, nodes.Element): pass
|
|
|
|
|
|
|
|
# pending xref
|
|
|
|
class pending_xref(nodes.Element): pass
|
|
|
|
|
|
|
|
# compact paragraph -- never makes a <p>
|
|
|
|
class compact_paragraph(nodes.paragraph): pass
|
|
|
|
|
2007-12-07 14:27:52 -06:00
|
|
|
# for the ACKS list
|
|
|
|
class acks(nodes.Element): pass
|
|
|
|
|
2007-07-23 04:02:25 -05:00
|
|
|
# sets the highlighting language for literal blocks
|
|
|
|
class highlightlang(nodes.Element): pass
|
|
|
|
|
2007-08-04 18:33:10 -05:00
|
|
|
# like emphasis, but doesn't apply further text processors, e.g. smartypants
|
2007-08-04 18:07:57 -05:00
|
|
|
class literal_emphasis(nodes.emphasis): pass
|
|
|
|
|
2007-08-17 01:27:35 -05:00
|
|
|
# glossary
|
|
|
|
class glossary(nodes.Element): pass
|
|
|
|
|
2007-12-16 13:36:23 -06:00
|
|
|
# module declaration
|
|
|
|
class module(nodes.Element): pass
|
|
|
|
|
2008-05-03 13:14:13 -05:00
|
|
|
# start of a file, used in the LaTeX builder only
|
|
|
|
class start_of_file(nodes.Element): pass
|
|
|
|
|
|
|
|
# tabular column specification, used for the LaTeX writer
|
|
|
|
class tabular_col_spec(nodes.Element): pass
|
|
|
|
|
2008-10-18 04:29:49 -05:00
|
|
|
# meta directive -- same as docutils' standard meta node, but pickleable
|
|
|
|
class meta(nodes.Special, nodes.PreBibliographic, nodes.Element): pass
|
|
|
|
|
2008-05-03 13:14:13 -05:00
|
|
|
# make them known to docutils. this is needed, because the HTML writer
|
2007-07-23 04:02:25 -05:00
|
|
|
# will choke at some point if these are not added
|
2008-12-25 15:06:10 -06:00
|
|
|
nodes._add_node_class_names("""index desc desc_content desc_signature
|
|
|
|
desc_type desc_returns
|
2008-06-18 13:16:25 -05:00
|
|
|
desc_addname desc_name desc_parameterlist desc_parameter desc_optional
|
2007-07-23 04:02:25 -05:00
|
|
|
centered versionmodified seealso productionlist production toctree
|
2007-08-17 01:27:35 -05:00
|
|
|
pending_xref compact_paragraph highlightlang literal_emphasis
|
2008-10-18 04:29:49 -05:00
|
|
|
glossary acks module start_of_file tabular_col_spec meta""".split())
|