Commits

Georg Brandl committed 19b3942 Merge

merge with 0.6

  • Participants
  • Parent commits ec90abf, 9d68dd8

Comments (0)

Files changed (9)

 Release 0.6.6 (in development)
 ==============================
 
+* Fix the handling of multiple toctrees when creating the global
+  TOC for the ``toctree()`` template function.
+
+* Fix the handling of hidden toctrees when creating the global TOC
+  for the ``toctree()`` template function.
+
+* Fix the handling of nested lists in the text writer.
+
+* #362: In autodoc, check for the existence of ``__self__`` on
+  function objects before accessing it.
+
+* #353: Strip leading and trailing whitespace when extracting
+  search words in the search function.
+
 
 Release 0.6.5 (Mar 01, 2010)
 ============================
 Note that a direct PDF builder using ReportLab is available in `rst2pdf
 <http://rst2pdf.googlecode.com>`_ version 0.12 or greater.  You need to add
 ``'rst2pdf.pdfbuilder'`` to your :confval:`extensions` to enable it, its name is
-``pdf``.
+``pdf``.  Refer to the `rst2pdf manual
+<http://lateral.netmanagers.com.ar/static/manual.pdf>`_ for details.
 
 .. module:: sphinx.builders.text
 .. class:: TextBuilder

doc/ext/appapi.rst

    * If you provide *parse_node*, it must be a function that takes a string and
      a docutils node, and it must populate the node with children parsed from
      the string.  It must then return the name of the item to be used in
-     cross-referencing and index entries.  See the :file:`ext.py` file in the
+     cross-referencing and index entries.  See the :file:`conf.py` file in the
      source for this documentation for an example.
 
    For example, if you have this call in a custom Sphinx extension::

sphinx/builders/html.py

 
     def render_partial(self, node):
         """Utility: Render a lone doctree node."""
+        if node is None:
+            return {'fragment': ''}
         doc = new_document('<partial node>')
         doc.append(node)
 

sphinx/environment.py

     def get_toctree_for(self, docname, builder, collapse):
         """Return the global TOC nodetree."""
         doctree = self.get_doctree(self.config.master_doc)
+        toctrees = []
         for toctreenode in doctree.traverse(addnodes.toctree):
-            result = self.resolve_toctree(docname, builder, toctreenode,
-                                          prune=True, collapse=collapse)
-            if result is not None:
-                return result
+            toctree = self.resolve_toctree(docname, builder, toctreenode,
+                                           prune=True, collapse=collapse,
+                                           includehidden=True)
+            toctrees.append(toctree)
+        if not toctrees:
+            return None
+        result = toctrees[0]
+        for toctree in toctrees[1:]:
+            result.extend(toctree.children)
+        return result
 
     # -------
     # these are called from docutils directives and therefore use self.docname
         return doctree
 
     def resolve_toctree(self, docname, builder, toctree, prune=True, maxdepth=0,
-                        titles_only=False, collapse=False):
+                        titles_only=False, collapse=False, includehidden=False):
         """
         Resolve a *toctree* node into individual bullet lists with titles
         as items, returning None (if no containing titles are found) or
         If *collapse* is True, all branches not containing docname will
         be collapsed.
         """
-        if toctree.get('hidden', False):
+        if toctree.get('hidden', False) and not includehidden:
             return None
 
         def _walk_depth(node, depth, maxdepth):

sphinx/ext/autodoc.py

             self.member_order = self.member_order - 1
         elif isinstance(self.object, FunctionType) or \
              (isinstance(self.object, BuiltinFunctionType) and
+              hasattr(self.object, '__self__') and
               self.object.__self__ is not None):
             self.directivetype = 'staticmethod'
             # document class and static members before ordinary ones

sphinx/highlighting.py

     from pygments.styles import get_style_by_name
     from pygments.styles.friendly import FriendlyStyle
     from pygments.token import Generic, Comment, Number
+    from pygments.util import ClassNotFound
 except ImportError:
     pygments = None
     lexers = None
         else:
             return True
 
-    def highlight_block(self, source, lang, linenos=False):
+    def highlight_block(self, source, lang, linenos=False, warn=None):
         if isinstance(source, str):
             source = source.decode()
         if not pygments:
             if lang in lexers:
                 lexer = lexers[lang]
             else:
-                lexer = lexers[lang] = get_lexer_by_name(lang)
-                lexer.add_filter('raiseonerror')
+                try:
+                    lexer = lexers[lang] = get_lexer_by_name(lang)
+                except ClassNotFound:
+                    if warn:
+                        warn('Pygments lexer name %s is not known' % lang)
+                        return self.unhighlighted(source)
+                    else:
+                        raise
+                else:
+                    lexer.add_filter('raiseonerror')
 
         # trim doctest options if wanted
         if isinstance(lexer, PythonConsoleLexer) and self.trim_doctest_flags:

sphinx/themes/basic/static/searchtools.js

     var tmp = query.split(/\s+/);
     var object = (tmp.length == 1) ? tmp[0].toLowerCase() : null;
     for (var i = 0; i < tmp.length; i++) {
-      if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/)) {
-        // skip this word
+      if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
+          tmp[i] == "") {
+        // skip this "word"
         continue;
       }
       // stem the word

sphinx/writers/text.py

 
         self.states = [[]]
         self.stateindent = [0]
+        self.list_counter = []
         self.sectionlevel = 0
         self.table = None
 
         raise nodes.SkipNode
 
     def visit_bullet_list(self, node):
-        self._list_counter = -1
+        self.list_counter.append(-1)
     def depart_bullet_list(self, node):
-        pass
+        self.list_counter.pop()
 
     def visit_enumerated_list(self, node):
-        self._list_counter = 0
+        self.list_counter.append(0)
     def depart_enumerated_list(self, node):
-        pass
+        self.list_counter.pop()
 
     def visit_definition_list(self, node):
-        self._list_counter = -2
+        self.list_counter.append(-2)
     def depart_definition_list(self, node):
-        pass
+        self.list_counter.pop()
 
     def visit_list_item(self, node):
-        if self._list_counter == -1:
+        if self.list_counter[-1] == -1:
             # bullet list
             self.new_state(2)
-        elif self._list_counter == -2:
+        elif self.list_counter[-1] == -2:
             # definition list
             pass
         else:
             # enumerated list
-            self._list_counter += 1
-            self.new_state(len(str(self._list_counter)) + 2)
+            self.list_counter[-1] += 1
+            self.new_state(len(str(self.list_counter[-1])) + 2)
     def depart_list_item(self, node):
-        if self._list_counter == -1:
+        if self.list_counter[-1] == -1:
             self.end_state(first='* ', end=None)
-        elif self._list_counter == -2:
+        elif self.list_counter[-1] == -2:
             pass
         else:
-            self.end_state(first='%s. ' % self._list_counter, end=None)
+            self.end_state(first='%s. ' % self.list_counter[-1], end=None)
 
     def visit_definition_list_item(self, node):
         self._li_has_classifier = len(node) >= 2 and \