mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Improve node coverage for latex/text writers.
This commit is contained in:
parent
2ebb04f10f
commit
1ed2d916cd
@ -358,6 +358,15 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
self.in_title = 0
|
self.in_title = 0
|
||||||
self.body.append(self.context.pop())
|
self.body.append(self.context.pop())
|
||||||
|
|
||||||
|
def visit_subtitle(self, node):
|
||||||
|
if isinstance(node.parent, nodes.sidebar):
|
||||||
|
self.body.append('~\\\\\n\\textbf{')
|
||||||
|
self.context.append('}\n\\smallskip\n')
|
||||||
|
else:
|
||||||
|
self.context.append('')
|
||||||
|
def depart_subtitle(self, node):
|
||||||
|
self.body.append(self.context.pop())
|
||||||
|
|
||||||
desc_map = {
|
desc_map = {
|
||||||
'function' : 'funcdesc',
|
'function' : 'funcdesc',
|
||||||
'class': 'classdesc',
|
'class': 'classdesc',
|
||||||
|
@ -126,6 +126,16 @@ class TextTranslator(nodes.NodeVisitor):
|
|||||||
self.add_text(' ]-')
|
self.add_text(' ]-')
|
||||||
self.end_state()
|
self.end_state()
|
||||||
|
|
||||||
|
def visit_sidebar(self, node):
|
||||||
|
pass
|
||||||
|
def depart_sidebar(self, node):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def visit_compound(self, node):
|
||||||
|
pass
|
||||||
|
def depart_compound(self, node):
|
||||||
|
pass
|
||||||
|
|
||||||
def visit_glossary(self, node):
|
def visit_glossary(self, node):
|
||||||
pass
|
pass
|
||||||
def depart_glossary(self, node):
|
def depart_glossary(self, node):
|
||||||
@ -145,6 +155,16 @@ class TextTranslator(nodes.NodeVisitor):
|
|||||||
self.stateindent.pop()
|
self.stateindent.pop()
|
||||||
self.states[-1].append((0, ['', text, '%s' % (char * len(text)), '']))
|
self.states[-1].append((0, ['', text, '%s' % (char * len(text)), '']))
|
||||||
|
|
||||||
|
def visit_subtitle(self, node):
|
||||||
|
pass
|
||||||
|
def depart_subtitle(self, node):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def visit_attribution(self, node):
|
||||||
|
self.add_text('-- ')
|
||||||
|
def depart_attribution(self, node):
|
||||||
|
pass
|
||||||
|
|
||||||
def visit_module(self, node):
|
def visit_module(self, node):
|
||||||
if node.has_key('platform'):
|
if node.has_key('platform'):
|
||||||
self.new_state(0)
|
self.new_state(0)
|
||||||
|
@ -31,6 +31,41 @@ Admonitions
|
|||||||
Tip text.
|
Tip text.
|
||||||
|
|
||||||
|
|
||||||
|
Body directives
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. topic:: Title
|
||||||
|
|
||||||
|
Topic body.
|
||||||
|
|
||||||
|
.. sidebar:: Sidebar
|
||||||
|
:subtitle: Sidebar subtitle
|
||||||
|
|
||||||
|
Sidebar body.
|
||||||
|
|
||||||
|
.. rubric:: Test rubric
|
||||||
|
|
||||||
|
.. epigraph:: Epigraph title
|
||||||
|
|
||||||
|
Epigraph body.
|
||||||
|
|
||||||
|
-- Author
|
||||||
|
|
||||||
|
.. highlights:: Highlights
|
||||||
|
|
||||||
|
Highlights body.
|
||||||
|
|
||||||
|
.. pull-quote:: Pull-quote
|
||||||
|
|
||||||
|
Pull quote body.
|
||||||
|
|
||||||
|
.. compound::
|
||||||
|
|
||||||
|
a
|
||||||
|
|
||||||
|
b
|
||||||
|
|
||||||
|
|
||||||
Tables
|
Tables
|
||||||
------
|
------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user