Commits

Armin Ronacher committed 1762b4f Merge

merged

Comments (0)

Files changed (10)

     multiple terms per definition.
   - #478: Added :rst:dir:`py:decorator` directive to describe decorators.
   - C++ domain now supports array definitions.
+  - C++ domain now supports doc fields (``:param x:`` inside directives).
   - Section headings in :rst:dir:`only` directives are now correctly
     handled.
   - Added ``emphasize-lines`` option to source code directives.
 Release 1.0.8 (in development)
 ==============================
 
+* #720: Add dummy visitors for graphviz nodes for text and man.
+
+* #704: Fix image file duplication bug.
+
+* #677: Fix parsing of multiple signatures in C++ domain.
+
+* #637: Ignore Emacs lock files when looking for source files.
+
+* #544: Allow .pyw extension for importable modules in autodoc.
+
+* #700: Use ``$(MAKE)`` in quickstart-generated Makefiles.
+
+* #734: Make sidebar search box width consistent in browsers.
+
+* #644: Fix spacing of centered figures in HTML output.
+
+* #767: Safely encode SphinxError messages when printing them to
+  sys.stderr.
+
+* #611: Fix LaTeX output error with a document with no sections but
+  a link target.
+
+* Correctly treat built-in method descriptors as methods in autodoc.
+
+* #706: Stop monkeypatching the Python textwrap module.
+
 * #657: viewcode now works correctly with source files that have
   non-ASCII encoding.
 
 * Marcin Wojdyr has written a script to convert Docbook to reST with Sphinx
   markup; it is at `Google Code <http://code.google.com/p/db2rst/>`_.
 
+* To convert different markups, `Pandoc <http://johnmacfarlane.net/pandoc/>`_ is
+  a very helpful tool.
+
 
 Use with other systems
 ----------------------

sphinx/builders/html.py

         old_config_hash = old_tags_hash = ''
         try:
             fp = open(path.join(self.outdir, '.buildinfo'))
-            version = fp.readline()
-            if version.rstrip() != '# Sphinx build info version 1':
-                raise ValueError
-            fp.readline()  # skip commentary
-            cfg, old_config_hash = fp.readline().strip().split(': ')
-            if cfg != 'config':
-                raise ValueError
-            tag, old_tags_hash = fp.readline().strip().split(': ')
-            if tag != 'tags':
-                raise ValueError
-            fp.close()
+            try:
+                version = fp.readline()
+                if version.rstrip() != '# Sphinx build info version 1':
+                    raise ValueError
+                fp.readline()  # skip commentary
+                cfg, old_config_hash = fp.readline().strip().split(': ')
+                if cfg != 'config':
+                    raise ValueError
+                tag, old_tags_hash = fp.readline().strip().split(': ')
+                if tag != 'tags':
+                    raise ValueError
+            finally:
+                fp.close()
         except ValueError:
             self.warn('unsupported build info format in %r, building all' %
                       path.join(self.outdir, '.buildinfo'))

sphinx/domains/cpp.py

 from sphinx.directives import ObjectDescription
 from sphinx.util.nodes import make_refnode
 from sphinx.util.compat import Directive
+from sphinx.util.docfields import Field, GroupedField
 
 
 _identifier_re = re.compile(r'(~?\b[a-zA-Z_][a-zA-Z0-9_]*)\b')
             return False
         try:
             for key, value in self.__dict__.iteritems():
-                if value != getattr(other, value):
+                if value != getattr(other, key):
                     return False
         except AttributeError:
             return False
 class CPPObject(ObjectDescription):
     """Description of a C++ language object."""
 
+    doc_field_types = [
+        GroupedField('parameter', label=l_('Parameters'),
+                     names=('param', 'parameter', 'arg', 'argument'),
+                     can_collapse=True),
+        GroupedField('exceptions', label=l_('Throws'), rolename='cpp:class',
+                     names=('throws', 'throw', 'exception'),
+                     can_collapse=True),
+        Field('returnvalue', label=l_('Returns'), has_arg=False,
+              names=('returns', 'return')),
+    ]
+
     def attach_name(self, node, name):
         owner, name = name.split_owner()
         varname = unicode(name)
                      node.line)
             return None
 
-        parent = node['cpp:parent']
+        parent = node.get('cpp:parent', None)
 
         rv = _create_refnode(expr)
         if rv is not None or parent is None:

sphinx/ext/graphviz.py

 from docutils.parsers.rst import directives
 
 from sphinx.errors import SphinxError
+from sphinx.locale import _
 from sphinx.util.osutil import ensuredir, ENOENT, EPIPE, EINVAL
 from sphinx.util.compat import Directive
 
     render_dot_texinfo(self, node, node['code'], node['options'])
 
 
+def text_visit_graphviz(self, node):
+    if 'alt' in node.attributes:
+        self.add_text(_('[graph: %s]') % node['alt'])
+    self.add_text(_('[graph]'))
+
+
+def man_visit_graphviz(self, node):
+    if 'alt' in node.attributes:
+        self.body.append(_('[graph: %s]') % node['alt'] + '\n')
+    self.body.append(_('[graph]'))
+    raise nodes.SkipNode
+
+
 def setup(app):
     app.add_node(graphviz,
                  html=(html_visit_graphviz, None),
                  latex=(latex_visit_graphviz, None),
-                 texinfo=(texinfo_visit_graphviz, None))
+                 texinfo=(texinfo_visit_graphviz, None),
+                 text=(text_visit_graphviz, None),
+                 man=(man_visit_graphviz, None))
     app.add_directive('graphviz', Graphviz)
     app.add_directive('graph', GraphvizSimple)
     app.add_directive('digraph', GraphvizSimple)

sphinx/util/__init__.py

         return uniquename
 
     def purge_doc(self, docname):
-        for filename, (docs, _) in self.items():
+        for filename, (docs, unique) in self.items():
             docs.discard(docname)
             if not docs:
                 del self[filename]
-                self._existing.discard(filename)
+                self._existing.discard(unique)
 
     def __getstate__(self):
         return self._existing

sphinx/writers/latex.py

             lang = babel.get_language()
             if lang:
                 self.elements['classoptions'] += ',' + babel.get_language()
-            elif builder.config.language == 'ja':
-                self.elements['classoptions'] += ',dvipdfm'
-                # not elements of babel, but this should be above sphinx.sty.
+            else:
+                self.builder.warn('no Babel option known for language %r' %
+                                  builder.config.language)
+            self.elements['shorthandoff'] = babel.get_shorthandoff()
+            self.elements['fncychap'] = '\\usepackage[Sonny]{fncychap}'
+
+            # pTeX (Japanese TeX) for support
+            if builder.config.language == 'ja':
+                self.elements['classoptions'] = ',dvipdfm'
+                # found elements of babel, but this should be above sphinx.sty.
                 # because pTeX (Japanese TeX) cannot handle this count.
                 self.elements['babel'] = r'\newcount\pdfoutput\pdfoutput=0'
                 # to make the pdf with correct encoded hyperref bookmarks
                 self.elements['preamble'] += \
                     r'\AtBeginDvi{\special{pdf:tounicode EUC-UCS2}}'
-            else:
-                self.builder.warn('no Babel option known for language %r' %
-                                  builder.config.language)
-            self.elements['shorthandoff'] = babel.get_shorthandoff()
-            self.elements['fncychap'] = '\\usepackage[Sonny]{fncychap}'
         else:
             self.elements['classoptions'] += ',english'
         # allow the user to override them all

sphinx/writers/manpage.py

     # overwritten -- don't emit a warning for images
     def visit_image(self, node):
         if 'alt' in node.attributes:
-            self.body.append('[image: %s]\n' % node['alt'])
-        self.body.append('[image]\n')
+            self.body.append(_('[image: %s]') % node['alt'] + '\n')
+        self.body.append(_('[image]') + '\n')
         raise nodes.SkipNode
 
     # overwritten -- don't visit inner marked up nodes

sphinx/writers/text.py

         raise nodes.SkipNode
 
     def visit_image(self, node):
+        if 'alt' in node.attributes:
+            self.add_text(_('[image: %s]') % node['alt'])
         self.add_text(_('[image]'))
         raise nodes.SkipNode
 

tests/root/objects.txt

 .. cpp:class:: n::Array<T,d>
 
    .. cpp:function:: T& operator[]( unsigned j )
-
-   .. cpp:function:: const T& operator[]( unsigned j ) const
-
+                     const T& operator[]( unsigned j ) const