mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
merge heads
This commit is contained in:
commit
b0fa05fecd
@ -40,7 +40,7 @@ function that returns an URL based on the object.
|
||||
def linkcode_resolve(domain, info):
|
||||
if domain != 'py':
|
||||
return None
|
||||
if not info['module']:
|
||||
return None
|
||||
filename = info['module'].replace('.', '/')
|
||||
if not info['module']:
|
||||
return None
|
||||
filename = info['module'].replace('.', '/')
|
||||
return "http://somesite/sourcerepo/%s.py" % filename
|
||||
|
10
setup.py
10
setup.py
@ -50,6 +50,16 @@ if sys.version_info < (2, 5):
|
||||
print('ERROR: Sphinx requires at least Python 2.5 to run.')
|
||||
sys.exit(1)
|
||||
|
||||
if sys.version_info[:3] >= (3, 3, 0):
|
||||
try:
|
||||
import docutils
|
||||
x, y = docutils.__version__.split('.')[:2]
|
||||
if (int(x), int(y)) < (0, 10):
|
||||
sys.stderr.write('ERROR: Sphinx requires at least '
|
||||
'Docutils 0.10 for Python 3.3 and above.\n')
|
||||
sys.exit(1)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Provide a "compile_catalog" command that also creates the translated
|
||||
# JavaScript files if Babel is available.
|
||||
|
@ -102,7 +102,8 @@ class CheckExternalLinksBuilder(Builder):
|
||||
|
||||
def check():
|
||||
# check for various conditions without bothering the network
|
||||
if len(uri) == 0 or uri[0] == '#' or uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:':
|
||||
if len(uri) == 0 or uri[0] == '#' or \
|
||||
uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:':
|
||||
return 'unchecked', ''
|
||||
elif not (uri[0:5] == 'http:' or uri[0:6] == 'https:'):
|
||||
return 'local', ''
|
||||
|
@ -401,7 +401,7 @@ help:
|
||||
\t@echo " epub to make an epub"
|
||||
\t@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
\t@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
\t@echo " latexpdfja to make LaTeX files and run them through platex and dvipdfmx"
|
||||
\t@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
||||
\t@echo " text to make text files"
|
||||
\t@echo " man to make manual pages"
|
||||
\t@echo " texinfo to make Texinfo files"
|
||||
|
@ -44,14 +44,14 @@ def extract_messages(doctree):
|
||||
"""Extract translatable messages from a document tree."""
|
||||
for node in doctree.traverse(nodes.TextElement):
|
||||
# workaround: nodes.term doesn't have source, line and rawsource
|
||||
# It should be fixed in Docutils. There is a patch for it in Docutils
|
||||
# tracker: https://sourceforge.net/tracker/?func=detail&aid=3548418&group_id=38414&atid=422032
|
||||
# (fixed in Docutils r7495)
|
||||
if isinstance(node, nodes.term) and not node.source:
|
||||
definition_list_item = node.parent
|
||||
if definition_list_item.line is not None:
|
||||
node.source = definition_list_item.source
|
||||
node.line = definition_list_item.line - 1
|
||||
node.rawsource = definition_list_item.rawsource.split("\n", 2)[0]
|
||||
node.rawsource = definition_list_item.\
|
||||
rawsource.split("\n", 2)[0]
|
||||
if not node.source:
|
||||
continue # built-in message
|
||||
if isinstance(node, IGNORED_NODES):
|
||||
|
@ -100,8 +100,9 @@ class LaTeXWriter(writers.Writer):
|
||||
class ExtBabel(Babel):
|
||||
def get_shorthandoff(self):
|
||||
shortlang = self.language.split('_')[0]
|
||||
if shortlang in ('de', 'ngerman', 'sl', 'slovene', 'pt', 'portuges', 'es', 'spanish',
|
||||
'nl', 'dutch', 'pl', 'polish', 'it', 'italian'):
|
||||
if shortlang in ('de', 'ngerman', 'sl', 'slovene', 'pt', 'portuges',
|
||||
'es', 'spanish', 'nl', 'dutch', 'pl', 'polish', 'it',
|
||||
'italian'):
|
||||
return '\\shorthandoff{"}'
|
||||
return ''
|
||||
|
||||
@ -217,7 +218,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
# allow the user to override them all
|
||||
self.elements.update(builder.config.latex_elements)
|
||||
if self.elements['extraclassoptions']:
|
||||
self.elements['classoptions'] += ',' + self.elements['extraclassoptions']
|
||||
self.elements['classoptions'] += ',' + \
|
||||
self.elements['extraclassoptions']
|
||||
|
||||
self.highlighter = highlighting.PygmentsBridge('latex',
|
||||
builder.config.pygments_style, builder.config.trim_doctest_flags)
|
||||
|
Loading…
Reference in New Issue
Block a user