mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Get rid of the remaining warnings in the conversion.
This commit is contained in:
parent
6d0ffd066d
commit
c435007906
@ -546,6 +546,7 @@ rename_mapping = {
|
||||
toctree_mapping = {
|
||||
'mac/scripting': ['gensuitemodule', 'aetools', 'aepack', 'aetypes', 'miniae'],
|
||||
'mac/toolbox': ['colorpicker'],
|
||||
'mac/undoc': [],
|
||||
'lib/libstrings': ['string', 're', 'struct', 'difflib', 'stringio', 'textwrap',
|
||||
'codecs', 'unicodedata', 'stringprep', 'fpformat'],
|
||||
'lib/datatypes': ['datetime', 'calendar', 'collections', 'heapq', 'bisect',
|
||||
@ -601,6 +602,7 @@ toctree_mapping = {
|
||||
'lib/libsgi': ['al', 'cd', 'fl', 'fm', 'gl', 'imgfile', 'jpeg'],
|
||||
'lib/libsun': ['sunaudio'],
|
||||
'lib/windows': ['msilib', 'msvcrt', '_winreg', 'winsound'],
|
||||
'lib/tkinter': [],
|
||||
}
|
||||
|
||||
# map sourcefilename to [pre, post]
|
||||
|
@ -14,5 +14,5 @@ To do after conversion
|
||||
* write "About these documents"
|
||||
* finish "Documenting Python"
|
||||
* extend copyright.rst
|
||||
* merge ACKS into about.rst
|
||||
* fix the "quadruple" index term
|
||||
* fix :file: and |version| in install
|
@ -368,8 +368,6 @@ in a different style:
|
||||
|
||||
The name of a file or directory.
|
||||
|
||||
.. XXX: filenq, filevar
|
||||
|
||||
.. describe:: guilabel
|
||||
|
||||
Labels presented as part of an interactive user interface should be marked
|
||||
|
@ -332,6 +332,8 @@ class RestWriter(object):
|
||||
# loses comments, but huh
|
||||
return EmptyNode()
|
||||
if isinstance(subnode, InlineNode):
|
||||
if subnode.cmdname in ('filevar', 'envvar'):
|
||||
return NodeList([TextNode('{'), do(subnode.args[0]), TextNode('}')])
|
||||
if subnode.cmdname == 'optional':
|
||||
# this is not mapped to ReST markup
|
||||
return subnode
|
||||
@ -639,7 +641,7 @@ class RestWriter(object):
|
||||
self.write_directive('deprecated', text(node.args[0]), node.args[1],
|
||||
spbelow=False)
|
||||
elif cmdname == 'localmoduletable':
|
||||
if self.toctree:
|
||||
if self.toctree is not None:
|
||||
self.write_directive('toctree', '', spbelow=True, spabove=True)
|
||||
with self.indented():
|
||||
for entry in self.toctree:
|
||||
@ -830,7 +832,7 @@ class RestWriter(object):
|
||||
|
||||
# maps argumentless commands to text
|
||||
simplecmd_mapping = {
|
||||
'NULL': '`NULL`',
|
||||
'NULL': '*NULL*',
|
||||
'shortversion': '|version|',
|
||||
'version': '|release|',
|
||||
'today': '|today|',
|
||||
@ -848,6 +850,7 @@ class RestWriter(object):
|
||||
'method': 'meth',
|
||||
'module': 'mod',
|
||||
'programopt': 'option',
|
||||
'filenq': 'file',
|
||||
# these mean: no change
|
||||
'cdata': '',
|
||||
'class': '',
|
||||
@ -857,8 +860,6 @@ class RestWriter(object):
|
||||
'dfn': '',
|
||||
'envvar': '',
|
||||
'file': '',
|
||||
'filenq': '',
|
||||
'filevar': '',
|
||||
'guilabel': '',
|
||||
'kbd': '',
|
||||
'keyword': '',
|
||||
@ -890,7 +891,7 @@ class RestWriter(object):
|
||||
if cmdname in ('code', 'bfcode', 'samp', 'texttt', 'regexp'):
|
||||
self.visit_wrapped('``', self.get_textonly_node(content, 'code',
|
||||
warn=1), '``', noescape=True)
|
||||
elif cmdname in ('emph', 'textit'):
|
||||
elif cmdname in ('emph', 'textit', 'var'):
|
||||
self.visit_wrapped('*', self.get_textonly_node(content, 'emph',
|
||||
warn=1), '*')
|
||||
elif cmdname in ('strong', 'textbf'):
|
||||
@ -898,7 +899,7 @@ class RestWriter(object):
|
||||
warn=1), '**')
|
||||
elif cmdname in ('b', 'textrm', 'email'):
|
||||
self.visit_node(content)
|
||||
elif cmdname in ('var', 'token'):
|
||||
elif cmdname == 'token':
|
||||
# \token appears in productionlists only
|
||||
self.visit_wrapped('`', self.get_textonly_node(content, 'var',
|
||||
warn=1), '`')
|
||||
@ -948,11 +949,13 @@ class RestWriter(object):
|
||||
self.visit_wrapped('(', node.args[1], ')')
|
||||
elif cmdname == 'longprogramopt':
|
||||
self.visit_wrapped(':option:`--', content, '`')
|
||||
elif cmdname == 'filevar':
|
||||
self.visit_wrapped(':file:`{', content, '}`')
|
||||
elif cmdname == '':
|
||||
self.visit_node(content)
|
||||
# stray commands from distutils
|
||||
elif cmdname in ('argument name', 'value', 'attribute', 'option name'):
|
||||
self.visit_wrapped('`', content, '`')
|
||||
self.visit_wrapped('*', content, '*')
|
||||
else:
|
||||
self.visit_wrapped(':%s:`' % (self.role_mapping[cmdname] or cmdname),
|
||||
self.get_textonly_node(
|
||||
|
Loading…
Reference in New Issue
Block a user