1. Tibor Tóth
  2. sphinx


georg.brandl  committed c7d4b94

Get rid of the remaining warnings in the conversion.

  • Participants
  • Parent commits 4c8fccf
  • Branches default

Comments (0)

Files changed (4)

File converter/filenamemap.py

View file
  • Ignore whitespace
 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',
     '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]

File converter/newfiles/TODO

View file
  • Ignore whitespace
 * 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

File converter/newfiles/doc_markup.rst

View file
  • Ignore whitespace
    The name of a file or directory.
-.. XXX: filenq, filevar
 .. describe:: guilabel
    Labels presented as part of an interactive user interface should be marked

File converter/restwriter.py

View file
  • Ignore whitespace
                 # 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
             self.write_directive('deprecated', text(node.args[0]), node.args[1],
         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:
     # maps argumentless commands to text
     simplecmd_mapping = {
-        'NULL': '`NULL`',
+        'NULL': '*NULL*',
         'shortversion': '|version|',
         'version': '|release|',
         'today': '|today|',
         'method': 'meth',
         'module': 'mod',
         'programopt': 'option',
+        'filenq': 'file',
         # these mean: no change
         'cdata': '',
         'class': '',
         'dfn': '',
         'envvar': '',
         'file': '',
-        'filenq': '',
-        'filevar': '',
         'guilabel': '',
         'kbd': '',
         'keyword': '',
         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'):
                                                             warn=1), '**')
         elif cmdname in ('b', 'textrm', 'email'):
-        elif cmdname in ('var', 'token'):
+        elif cmdname == 'token':
             # \token appears in productionlists only
             self.visit_wrapped('`', self.get_textonly_node(content, 'var',
                                                            warn=1), '`')
             self.visit_wrapped('(', node.args[1], ')')
         elif cmdname == 'longprogramopt':
             self.visit_wrapped(':option:`--', content, '`')
+        elif cmdname == 'filevar':
+            self.visit_wrapped(':file:`{', content, '}`')
         elif cmdname == '':
         # stray commands from distutils
         elif cmdname in ('argument name', 'value', 'attribute', 'option name'):
-            self.visit_wrapped('`', content, '`')
+            self.visit_wrapped('*', content, '*')
             self.visit_wrapped(':%s:`' % (self.role_mapping[cmdname] or cmdname),