1. Robert Lehmann
  2. sphinx-i18n

Commits

Georg Brandl  committed 8d05364 Merge

merge with 1.0

  • Participants
  • Parent commits 2dcb17d, f1c19a3
  • Branches default

Comments (0)

Files changed (8)

File CHANGES

View file
 Release 1.0.2 (in development)
 ==============================
 
+* #490: Fix cross-references to objects of types added by the
+  :func:`~.Sphinx.add_object_type` API function.
+
+* Fix handling of doc field types for different directive types.
+
 * Allow breaking long signatures, continuing with backlash-escaped
   newlines.
 

File doc/ext/autodoc.rst

View file
      will document all non-private member functions and properties (that is,
      those whose name doesn't start with ``_``).
 
+     For modules, ``__all__`` will be respected when looking for members; the
+     order of the members will also be the order in ``__all__``.
+
      You can also give an explicit list of members; only these will then be
      documented::
 

File sphinx/__init__.py

File contents unchanged.

File sphinx/directives/__init__.py

View file
             self.env.temp_data['object'] = self.names[0]
         self.before_content()
         self.state.nested_parse(self.content, self.content_offset, contentnode)
-        #self.handle_doc_fields(contentnode)
         DocFieldTransformer(self).transform_all(contentnode)
         self.env.temp_data['object'] = None
         self.after_content()

File sphinx/domains/std.py

View file
                 return make_refnode(builder, fromdocname, docname,
                                     labelid, contnode)
         else:
-            docname, labelid = self.data['objects'].get((typ, target), ('', ''))
+            objtypes = self.objtypes_for_role(typ) or []
+            for objtype in objtypes:
+                if (objtype, target) in self.data['objects']:
+                    docname, labelid = self.data['objects'][objtype, target]
+                    break
+            else:
+                docname, labelid = '', ''
             if not docname:
                 if typ == 'term':
                     env.warn(node.get('refdoc', fromdocname),

File sphinx/util/docfields.py

View file
 
     def __init__(self, directive):
         self.domain = directive.domain
-        if not hasattr(directive, '_doc_field_type_map'):
+        if '_doc_field_type_map' not in directive.__class__.__dict__:
             directive.__class__._doc_field_type_map = \
                 self.preprocess_fieldtypes(directive.__class__.doc_field_types)
         self.typemap = directive._doc_field_type_map

File sphinx/util/smartypants.py

View file
 # Constants for quote education.
 
 punct_class = r"""[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]"""
+end_of_word_class = r"""[\s.,;:!?)]"""
 close_class = r"""[^\ \t\r\n\[\{\(\-]"""
 dec_dashes = r"""&#8211;|&#8212;"""
 
 closing_double_quotes_regex = re.compile(r"""
                 #(%s)?   # character that indicates the quote should be closing
                 "
-                (?=\s)
-                """ % (close_class,), re.VERBOSE)
+                (?=%s)
+                """ % (close_class, end_of_word_class), re.VERBOSE)
 
 closing_double_quotes_regex_2 = re.compile(r"""
                 (%s)   # character that indicates the quote should be closing

File tests/test_build_html.py

View file
         (".//a[@href='#mod.Cls'][@class='reference internal']", ''),
         (".//dl[@class='userdesc']", ''),
         (".//dt[@id='userdesc-myobj']", ''),
-        (".//a[@href='#userdesc-myobj']", ''),
+        (".//a[@href='#userdesc-myobj'][@class='reference internal']", ''),
         # C references
         (".//span[@class='pre']", 'CFunction()'),
         (".//a[@href='#Sphinx_DoSomething']", ''),