mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add more visitors for manpage writer.
This commit is contained in:
parent
28851d7ea4
commit
9ebf346c18
@ -361,7 +361,8 @@ def setup(app):
|
||||
inheritance_diagram,
|
||||
latex=(latex_visit_inheritance_diagram, None),
|
||||
html=(html_visit_inheritance_diagram, None),
|
||||
text=(skip, None))
|
||||
text=(skip, None),
|
||||
man=(skip, None))
|
||||
app.add_directive('inheritance-diagram', InheritanceDiagram)
|
||||
app.add_config_value('inheritance_graph_attrs', {}, False),
|
||||
app.add_config_value('inheritance_node_attrs', {}, False),
|
||||
|
@ -108,6 +108,20 @@ def text_visit_eqref(self, node):
|
||||
raise nodes.SkipNode
|
||||
|
||||
|
||||
def man_visit_math(self, node):
|
||||
self.body.append(node['latex'])
|
||||
raise nodes.SkipNode
|
||||
|
||||
def man_visit_displaymath(self, node):
|
||||
self.visit_centered(node)
|
||||
def man_depart_displaymath(self, node):
|
||||
self.depart_centered(node)
|
||||
|
||||
def man_visit_eqref(self, node):
|
||||
self.body.append(node['target'])
|
||||
raise nodes.SkipNode
|
||||
|
||||
|
||||
def html_visit_eqref(self, node):
|
||||
self.body.append('<a href="#equation-%s">' % node['target'])
|
||||
|
||||
@ -136,14 +150,17 @@ def setup_math(app, htmlinlinevisitors, htmldisplayvisitors):
|
||||
app.add_node(math,
|
||||
latex=(latex_visit_math, None),
|
||||
text=(text_visit_math, None),
|
||||
man=(man_visit_math, None),
|
||||
html=htmlinlinevisitors)
|
||||
app.add_node(displaymath,
|
||||
latex=(latex_visit_displaymath, None),
|
||||
text=(text_visit_displaymath, None),
|
||||
man=(man_visit_displaymath, man_depart_displaymath),
|
||||
html=htmldisplayvisitors)
|
||||
app.add_node(eqref,
|
||||
latex=(latex_visit_eqref, None),
|
||||
text=(text_visit_eqref, None),
|
||||
man=(man_visit_eqref, None),
|
||||
html=(html_visit_eqref, html_depart_eqref))
|
||||
app.add_role('math', math_role)
|
||||
app.add_role('eq', eq_role)
|
||||
|
Loading…
Reference in New Issue
Block a user