mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '1.7'
This commit is contained in:
commit
93837bb01e
11
CHANGES
11
CHANGES
@ -88,7 +88,7 @@ Features removed
|
|||||||
|
|
||||||
* ``sphinx.ext.pngmath`` extension
|
* ``sphinx.ext.pngmath`` extension
|
||||||
|
|
||||||
Release 1.7.4 (in development)
|
Release 1.7.5 (in development)
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
Dependencies
|
Dependencies
|
||||||
@ -109,6 +109,15 @@ Bugs fixed
|
|||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
Release 1.7.4 (released Apr 25, 2018)
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
Bugs fixed
|
||||||
|
----------
|
||||||
|
|
||||||
|
* #4885, #4887: domains: Crashed with duplicated objects
|
||||||
|
* #4889: latex: sphinx.writers.latex causes recusrive import
|
||||||
|
|
||||||
Release 1.7.3 (released Apr 23, 2018)
|
Release 1.7.3 (released Apr 23, 2018)
|
||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ from sphinx.directives import ObjectDescription
|
|||||||
from sphinx.domains import Domain, ObjType
|
from sphinx.domains import Domain, ObjType
|
||||||
from sphinx.locale import _
|
from sphinx.locale import _
|
||||||
from sphinx.roles import XRefRole
|
from sphinx.roles import XRefRole
|
||||||
from sphinx.util import logging
|
|
||||||
from sphinx.util.docfields import Field, TypedField
|
from sphinx.util.docfields import Field, TypedField
|
||||||
from sphinx.util.nodes import make_refnode
|
from sphinx.util.nodes import make_refnode
|
||||||
|
|
||||||
@ -30,8 +29,6 @@ if False:
|
|||||||
from sphinx.builders import Builder # NOQA
|
from sphinx.builders import Builder # NOQA
|
||||||
from sphinx.environment import BuildEnvironment # NOQA
|
from sphinx.environment import BuildEnvironment # NOQA
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
# RE to split at word boundaries
|
# RE to split at word boundaries
|
||||||
wsplit_re = re.compile(r'(\W+)')
|
wsplit_re = re.compile(r'(\W+)')
|
||||||
@ -290,13 +287,9 @@ class CDomain(Domain):
|
|||||||
|
|
||||||
def merge_domaindata(self, docnames, otherdata):
|
def merge_domaindata(self, docnames, otherdata):
|
||||||
# type: (List[unicode], Dict) -> None
|
# type: (List[unicode], Dict) -> None
|
||||||
|
# XXX check duplicates
|
||||||
for fullname, (fn, objtype) in otherdata['objects'].items():
|
for fullname, (fn, objtype) in otherdata['objects'].items():
|
||||||
if fn in docnames:
|
if fn in docnames:
|
||||||
if fullname in self.data['objects']:
|
|
||||||
other, _ = self.data['objects'][fullname]
|
|
||||||
logger.warning('duplicate C object description of %s, '
|
|
||||||
'other instance in %s' %
|
|
||||||
(fullname, self.env.doc2path(other)))
|
|
||||||
self.data['objects'][fullname] = (fn, objtype)
|
self.data['objects'][fullname] = (fn, objtype)
|
||||||
|
|
||||||
def resolve_xref(self, env, fromdocname, builder,
|
def resolve_xref(self, env, fromdocname, builder,
|
||||||
|
@ -18,7 +18,6 @@ from sphinx.domains import Domain, ObjType
|
|||||||
from sphinx.domains.python import _pseudo_parse_arglist
|
from sphinx.domains.python import _pseudo_parse_arglist
|
||||||
from sphinx.locale import _
|
from sphinx.locale import _
|
||||||
from sphinx.roles import XRefRole
|
from sphinx.roles import XRefRole
|
||||||
from sphinx.util import logging
|
|
||||||
from sphinx.util.docfields import Field, GroupedField, TypedField
|
from sphinx.util.docfields import Field, GroupedField, TypedField
|
||||||
from sphinx.util.nodes import make_refnode
|
from sphinx.util.nodes import make_refnode
|
||||||
|
|
||||||
@ -30,8 +29,6 @@ if False:
|
|||||||
from sphinx.builders import Builder # NOQA
|
from sphinx.builders import Builder # NOQA
|
||||||
from sphinx.environment import BuildEnvironment # NOQA
|
from sphinx.environment import BuildEnvironment # NOQA
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class JSObject(ObjectDescription):
|
class JSObject(ObjectDescription):
|
||||||
"""
|
"""
|
||||||
@ -258,12 +255,6 @@ class JSModule(Directive):
|
|||||||
noindex = 'noindex' in self.options
|
noindex = 'noindex' in self.options
|
||||||
ret = []
|
ret = []
|
||||||
if not noindex:
|
if not noindex:
|
||||||
modules = env.domaindata['js']['modules']
|
|
||||||
if mod_name in modules:
|
|
||||||
self.state_machine.reporter.warning(
|
|
||||||
'duplicate module description of %s, ' % mod_name +
|
|
||||||
'other instance in ' + self.env.doc2path(modules[mod_name]),
|
|
||||||
line=self.lineno)
|
|
||||||
env.domaindata['js']['modules'][mod_name] = env.docname
|
env.domaindata['js']['modules'][mod_name] = env.docname
|
||||||
# Make a duplicate entry in 'objects' to facilitate searching for
|
# Make a duplicate entry in 'objects' to facilitate searching for
|
||||||
# the module in JavaScriptDomain.find_obj()
|
# the module in JavaScriptDomain.find_obj()
|
||||||
@ -344,21 +335,12 @@ class JavaScriptDomain(Domain):
|
|||||||
|
|
||||||
def merge_domaindata(self, docnames, otherdata):
|
def merge_domaindata(self, docnames, otherdata):
|
||||||
# type: (List[unicode], Dict) -> None
|
# type: (List[unicode], Dict) -> None
|
||||||
|
# XXX check duplicates
|
||||||
for fullname, (fn, objtype) in otherdata['objects'].items():
|
for fullname, (fn, objtype) in otherdata['objects'].items():
|
||||||
if fn in docnames:
|
if fn in docnames:
|
||||||
if fullname in self.data['objects']:
|
|
||||||
otherdoc, _ = self.data['objects'][fullname]
|
|
||||||
logger.warning('duplicate object description of %s, '
|
|
||||||
'other instance in %s' %
|
|
||||||
(fullname, self.env.doc2path(otherdoc)))
|
|
||||||
self.data['objects'][fullname] = (fn, objtype)
|
self.data['objects'][fullname] = (fn, objtype)
|
||||||
for mod_name, pkg_docname in otherdata['modules'].items():
|
for mod_name, pkg_docname in otherdata['modules'].items():
|
||||||
if pkg_docname in docnames:
|
if pkg_docname in docnames:
|
||||||
if mod_name in self.data['modules']:
|
|
||||||
otherdoc = self.data['modules'][mod_name]
|
|
||||||
logger.warning('duplicate module description of %s, '
|
|
||||||
'other instance in %s' %
|
|
||||||
(mod_name, self.env.doc2path(otherdoc)))
|
|
||||||
self.data['modules'][mod_name] = pkg_docname
|
self.data['modules'][mod_name] = pkg_docname
|
||||||
|
|
||||||
def find_obj(self, env, mod_name, prefix, name, typ, searchorder=0):
|
def find_obj(self, env, mod_name, prefix, name, typ, searchorder=0):
|
||||||
|
@ -579,17 +579,10 @@ class PyModule(Directive):
|
|||||||
env.ref_context['py:module'] = modname
|
env.ref_context['py:module'] = modname
|
||||||
ret = []
|
ret = []
|
||||||
if not noindex:
|
if not noindex:
|
||||||
modules = env.domaindata['py']['modules']
|
env.domaindata['py']['modules'][modname] = (env.docname,
|
||||||
if modname in modules:
|
self.options.get('synopsis', ''),
|
||||||
self.state_machine.reporter.warning(
|
self.options.get('platform', ''),
|
||||||
'duplicate module description of %s, '
|
'deprecated' in self.options)
|
||||||
'other instance in %s, use :noindex: for one of them' %
|
|
||||||
(modname, env.doc2path(modules[modname][0])),
|
|
||||||
line=self.lineno)
|
|
||||||
modules[modname] = (env.docname,
|
|
||||||
self.options.get('synopsis', ''),
|
|
||||||
self.options.get('platform', ''),
|
|
||||||
'deprecated' in self.options)
|
|
||||||
# make a duplicate entry in 'objects' to facilitate searching for
|
# make a duplicate entry in 'objects' to facilitate searching for
|
||||||
# the module in PythonDomain.find_obj()
|
# the module in PythonDomain.find_obj()
|
||||||
env.domaindata['py']['objects'][modname] = (env.docname, 'module')
|
env.domaindata['py']['objects'][modname] = (env.docname, 'module')
|
||||||
@ -784,21 +777,12 @@ class PythonDomain(Domain):
|
|||||||
|
|
||||||
def merge_domaindata(self, docnames, otherdata):
|
def merge_domaindata(self, docnames, otherdata):
|
||||||
# type: (List[unicode], Dict) -> None
|
# type: (List[unicode], Dict) -> None
|
||||||
|
# XXX check duplicates?
|
||||||
for fullname, (fn, objtype) in otherdata['objects'].items():
|
for fullname, (fn, objtype) in otherdata['objects'].items():
|
||||||
if fn in docnames:
|
if fn in docnames:
|
||||||
if fullname in self.data['objects']:
|
|
||||||
otherdoc, _ = self.data['objects'][fullname]
|
|
||||||
logger.warning('duplicate object description of %s, '
|
|
||||||
'other instance in %s, use :noindex: for one of them' %
|
|
||||||
(fullname, self.env.doc2path(otherdoc)))
|
|
||||||
self.data['objects'][fullname] = (fn, objtype)
|
self.data['objects'][fullname] = (fn, objtype)
|
||||||
for modname, data in otherdata['modules'].items():
|
for modname, data in otherdata['modules'].items():
|
||||||
if data[0] in docnames:
|
if data[0] in docnames:
|
||||||
if modname in self.data['modules']:
|
|
||||||
otherdoc, _, _, _ = self.data['modules'][modname]
|
|
||||||
logger.warning('duplicate module description of %s, '
|
|
||||||
'other instance in %s, use :noindex: for one of them' %
|
|
||||||
(modname, self.env.doc2path(otherdoc)))
|
|
||||||
self.data['modules'][modname] = data
|
self.data['modules'][modname] = data
|
||||||
|
|
||||||
def find_obj(self, env, modname, classname, name, type, searchmode=0):
|
def find_obj(self, env, modname, classname, name, type, searchmode=0):
|
||||||
|
@ -18,7 +18,6 @@ from sphinx.directives import ObjectDescription
|
|||||||
from sphinx.domains import Domain, ObjType
|
from sphinx.domains import Domain, ObjType
|
||||||
from sphinx.locale import _
|
from sphinx.locale import _
|
||||||
from sphinx.roles import XRefRole
|
from sphinx.roles import XRefRole
|
||||||
from sphinx.util import logging
|
|
||||||
from sphinx.util.nodes import make_refnode
|
from sphinx.util.nodes import make_refnode
|
||||||
|
|
||||||
if False:
|
if False:
|
||||||
@ -30,7 +29,6 @@ if False:
|
|||||||
from sphinx.environment import BuildEnvironment # NOQA
|
from sphinx.environment import BuildEnvironment # NOQA
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
dir_sig_re = re.compile(r'\.\. (.+?)::(.*)$')
|
dir_sig_re = re.compile(r'\.\. (.+?)::(.*)$')
|
||||||
|
|
||||||
|
|
||||||
@ -141,13 +139,9 @@ class ReSTDomain(Domain):
|
|||||||
|
|
||||||
def merge_domaindata(self, docnames, otherdata):
|
def merge_domaindata(self, docnames, otherdata):
|
||||||
# type: (List[unicode], Dict) -> None
|
# type: (List[unicode], Dict) -> None
|
||||||
|
# XXX check duplicates
|
||||||
for (typ, name), doc in otherdata['objects'].items():
|
for (typ, name), doc in otherdata['objects'].items():
|
||||||
if doc in docnames:
|
if doc in docnames:
|
||||||
if (typ, name) in self.data['objects']:
|
|
||||||
otherdoc = self.data['objects'][typ, name]
|
|
||||||
logger.warning('duplicate description of %s %s, '
|
|
||||||
'other instance in %s' %
|
|
||||||
(typ, name, self.env.doc2path(otherdoc)))
|
|
||||||
self.data['objects'][typ, name] = doc
|
self.data['objects'][typ, name] = doc
|
||||||
|
|
||||||
def resolve_xref(self, env, fromdocname, builder, typ, target, node,
|
def resolve_xref(self, env, fromdocname, builder, typ, target, node,
|
||||||
|
@ -559,6 +559,7 @@ class StandardDomain(Domain):
|
|||||||
|
|
||||||
def merge_domaindata(self, docnames, otherdata):
|
def merge_domaindata(self, docnames, otherdata):
|
||||||
# type: (List[unicode], Dict) -> None
|
# type: (List[unicode], Dict) -> None
|
||||||
|
# XXX duplicates?
|
||||||
for key, data in otherdata['progoptions'].items():
|
for key, data in otherdata['progoptions'].items():
|
||||||
if data[0] in docnames:
|
if data[0] in docnames:
|
||||||
self.data['progoptions'][key] = data
|
self.data['progoptions'][key] = data
|
||||||
@ -567,11 +568,6 @@ class StandardDomain(Domain):
|
|||||||
self.data['objects'][key] = data
|
self.data['objects'][key] = data
|
||||||
for key, data in otherdata['citations'].items():
|
for key, data in otherdata['citations'].items():
|
||||||
if data[0] in docnames:
|
if data[0] in docnames:
|
||||||
if key in self.data['citations']:
|
|
||||||
otherdoc, _, _ = self.data['catations']
|
|
||||||
logger.warning('duplicate citation %s, other instance in %s' %
|
|
||||||
(key, self.env.doc2path(otherdoc)),
|
|
||||||
type='ref', subtype='citation')
|
|
||||||
self.data['citations'][key] = data
|
self.data['citations'][key] = data
|
||||||
for key, data in otherdata['citation_refs'].items():
|
for key, data in otherdata['citation_refs'].items():
|
||||||
citation_refs = self.data['citation_refs'].setdefault(key, [])
|
citation_refs = self.data['citation_refs'].setdefault(key, [])
|
||||||
@ -580,10 +576,6 @@ class StandardDomain(Domain):
|
|||||||
citation_refs.append(docname)
|
citation_refs.append(docname)
|
||||||
for key, data in otherdata['labels'].items():
|
for key, data in otherdata['labels'].items():
|
||||||
if data[0] in docnames:
|
if data[0] in docnames:
|
||||||
if key in self.data['labels']:
|
|
||||||
otherdoc, _, _ = self.data['labels']
|
|
||||||
logger.warning('duplicate label %s, other instance in %s' %
|
|
||||||
(key, self.env.doc2path(otherdoc)))
|
|
||||||
self.data['labels'][key] = data
|
self.data['labels'][key] = data
|
||||||
for key, data in otherdata['anonlabels'].items():
|
for key, data in otherdata['anonlabels'].items():
|
||||||
if data[0] in docnames:
|
if data[0] in docnames:
|
||||||
|
@ -76,10 +76,6 @@ class MathDomain(Domain):
|
|||||||
# type: (Iterable[unicode], Dict) -> None
|
# type: (Iterable[unicode], Dict) -> None
|
||||||
for labelid, (doc, eqno) in otherdata['objects'].items():
|
for labelid, (doc, eqno) in otherdata['objects'].items():
|
||||||
if doc in docnames:
|
if doc in docnames:
|
||||||
if labelid in self.data['objects']:
|
|
||||||
otherdoc, _ = self.data['objects']
|
|
||||||
logger.warning('duplicate label of equation %s, other instance in %s' %
|
|
||||||
(labelid, self.env.doc2path(otherdoc)))
|
|
||||||
self.data['objects'][labelid] = (doc, eqno)
|
self.data['objects'][labelid] = (doc, eqno)
|
||||||
|
|
||||||
def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
|
def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
|
||||||
|
@ -23,7 +23,6 @@ from six import itervalues, text_type
|
|||||||
|
|
||||||
from sphinx import addnodes
|
from sphinx import addnodes
|
||||||
from sphinx import highlighting
|
from sphinx import highlighting
|
||||||
from sphinx.builders.latex.transforms import URI_SCHEMES, ShowUrlsTransform # NOQA # for compatibility
|
|
||||||
from sphinx.errors import SphinxError
|
from sphinx.errors import SphinxError
|
||||||
from sphinx.locale import admonitionlabels, _, __
|
from sphinx.locale import admonitionlabels, _, __
|
||||||
from sphinx.util import split_into, logging
|
from sphinx.util import split_into, logging
|
||||||
@ -2561,3 +2560,10 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
def unknown_visit(self, node):
|
def unknown_visit(self, node):
|
||||||
# type: (nodes.Node) -> None
|
# type: (nodes.Node) -> None
|
||||||
raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
|
raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
|
||||||
|
|
||||||
|
|
||||||
|
# Import old modules here for compatibility
|
||||||
|
# They should be imported after `LaTeXTranslator` to avoid recursive import.
|
||||||
|
#
|
||||||
|
# refs: https://github.com/sphinx-doc/sphinx/issues/4889
|
||||||
|
from sphinx.builders.latex.transforms import URI_SCHEMES, ShowUrlsTransform # NOQA
|
||||||
|
Loading…
Reference in New Issue
Block a user