mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix long lines.
This commit is contained in:
parent
c02b7149aa
commit
43f475b74e
@ -150,7 +150,8 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
|
|||||||
staticdir = path.join(outdir, '_static')
|
staticdir = path.join(outdir, '_static')
|
||||||
imagesdir = path.join(outdir, '_images')
|
imagesdir = path.join(outdir, '_images')
|
||||||
for root, dirs, files in os.walk(outdir):
|
for root, dirs, files in os.walk(outdir):
|
||||||
resourcedir = root.startswith(staticdir) or root.startswith(imagesdir)
|
resourcedir = root.startswith(staticdir) or \
|
||||||
|
root.startswith(imagesdir)
|
||||||
for fn in files:
|
for fn in files:
|
||||||
if (resourcedir and not fn.endswith('.js')) or \
|
if (resourcedir and not fn.endswith('.js')) or \
|
||||||
fn.endswith('.html'):
|
fn.endswith('.html'):
|
||||||
|
@ -233,9 +233,12 @@ def find_autosummary_in_lines(lines, module=None, filename=None):
|
|||||||
corresponding options set.
|
corresponding options set.
|
||||||
"""
|
"""
|
||||||
autosummary_re = re.compile(r'^\s*\.\.\s+autosummary::\s*')
|
autosummary_re = re.compile(r'^\s*\.\.\s+autosummary::\s*')
|
||||||
automodule_re = re.compile(r'^\s*\.\.\s+automodule::\s*([A-Za-z0-9_.]+)\s*$')
|
automodule_re = re.compile(
|
||||||
module_re = re.compile(r'^\s*\.\.\s+(current)?module::\s*([a-zA-Z0-9_.]+)\s*$')
|
r'^\s*\.\.\s+automodule::\s*([A-Za-z0-9_.]+)\s*$')
|
||||||
autosummary_item_re = re.compile(r'^\s+(~?[_a-zA-Z][a-zA-Z0-9_.]*)\s*.*?')
|
module_re = re.compile(
|
||||||
|
r'^\s*\.\.\s+(current)?module::\s*([a-zA-Z0-9_.]+)\s*$')
|
||||||
|
autosummary_item_re = re.compile(
|
||||||
|
r'^\s+(~?[_a-zA-Z][a-zA-Z0-9_.]*)\s*.*?')
|
||||||
toctree_arg_re = re.compile(r'^\s+:toctree:\s*(.*?)\s*$')
|
toctree_arg_re = re.compile(r'^\s+:toctree:\s*(.*?)\s*$')
|
||||||
template_arg_re = re.compile(r'^\s+:template:\s*(.*?)\s*$')
|
template_arg_re = re.compile(r'^\s+:template:\s*(.*?)\s*$')
|
||||||
|
|
||||||
|
@ -237,7 +237,8 @@ def setup(app):
|
|||||||
app.add_config_value('pngmath_dvipng', 'dvipng', 'html')
|
app.add_config_value('pngmath_dvipng', 'dvipng', 'html')
|
||||||
app.add_config_value('pngmath_latex', 'latex', 'html')
|
app.add_config_value('pngmath_latex', 'latex', 'html')
|
||||||
app.add_config_value('pngmath_use_preview', False, 'html')
|
app.add_config_value('pngmath_use_preview', False, 'html')
|
||||||
app.add_config_value('pngmath_dvipng_args', ['-gamma 1.5', '-D 110'], 'html')
|
app.add_config_value('pngmath_dvipng_args',
|
||||||
|
['-gamma 1.5', '-D 110'], 'html')
|
||||||
app.add_config_value('pngmath_latex_args', [], 'html')
|
app.add_config_value('pngmath_latex_args', [], 'html')
|
||||||
app.add_config_value('pngmath_latex_preamble', '', 'html')
|
app.add_config_value('pngmath_latex_preamble', '', 'html')
|
||||||
app.connect('build-finished', cleanup_tempdir)
|
app.connect('build-finished', cleanup_tempdir)
|
||||||
|
@ -121,8 +121,8 @@ class _TranslationProxy(UserString.UserString, object):
|
|||||||
return '<%s broken>' % self.__class__.__name__
|
return '<%s broken>' % self.__class__.__name__
|
||||||
|
|
||||||
def mygettext(string):
|
def mygettext(string):
|
||||||
"""Used instead of _ when creating TranslationProxies, because _ is not bound
|
"""Used instead of _ when creating TranslationProxies, because _ is
|
||||||
yet at that time."""
|
not bound yet at that time."""
|
||||||
return _(string)
|
return _(string)
|
||||||
|
|
||||||
def lazy_gettext(string):
|
def lazy_gettext(string):
|
||||||
|
@ -332,7 +332,8 @@ devhelp:
|
|||||||
\t@echo "Build finished."
|
\t@echo "Build finished."
|
||||||
\t@echo "To view the help file:"
|
\t@echo "To view the help file:"
|
||||||
\t@echo "# mkdir -p $$HOME/.local/share/devhelp/%(project_fn)s"
|
\t@echo "# mkdir -p $$HOME/.local/share/devhelp/%(project_fn)s"
|
||||||
\t@echo "# ln -s %(rbuilddir)s/devhelp $$HOME/.local/share/devhelp/%(project_fn)s"
|
\t@echo "# ln -s %(rbuilddir)s/devhelp \
|
||||||
|
$$HOME/.local/share/devhelp/%(project_fn)s"
|
||||||
\t@echo "# devhelp"
|
\t@echo "# devhelp"
|
||||||
|
|
||||||
latex:
|
latex:
|
||||||
|
@ -162,7 +162,8 @@ class XRefRole(object):
|
|||||||
target = target[:-2]
|
target = target[:-2]
|
||||||
return title, target
|
return title, target
|
||||||
|
|
||||||
def __call__(self, typ, rawtext, text, lineno, inliner, options={}, content=[]):
|
def __call__(self, typ, rawtext, text, lineno, inliner,
|
||||||
|
options={}, content=[]):
|
||||||
env = inliner.document.settings.env
|
env = inliner.document.settings.env
|
||||||
if not typ:
|
if not typ:
|
||||||
typ = env.config.default_role
|
typ = env.config.default_role
|
||||||
@ -185,7 +186,8 @@ class XRefRole(object):
|
|||||||
refcaption=has_explicit_title)
|
refcaption=has_explicit_title)
|
||||||
# we may need the line number for warnings
|
# we may need the line number for warnings
|
||||||
pnode.line = lineno
|
pnode.line = lineno
|
||||||
title, target = self.process_link(env, pnode, has_explicit_title, title, target)
|
title, target = self.process_link(env, pnode,
|
||||||
|
has_explicit_title, title, target)
|
||||||
pnode['reftarget'] = target
|
pnode['reftarget'] = target
|
||||||
pnode += self.innernodeclass(rawtext, title, classes=['xref'])
|
pnode += self.innernodeclass(rawtext, title, classes=['xref'])
|
||||||
return [pnode], []
|
return [pnode], []
|
||||||
|
@ -27,7 +27,8 @@ if sys.version_info < (2, 5):
|
|||||||
# begin code copied from utf_8_sig.py in Python 2.6
|
# begin code copied from utf_8_sig.py in Python 2.6
|
||||||
|
|
||||||
def encode(input, errors='strict'):
|
def encode(input, errors='strict'):
|
||||||
return (codecs.BOM_UTF8 + codecs.utf_8_encode(input, errors)[0], len(input))
|
return (codecs.BOM_UTF8 + codecs.utf_8_encode(input, errors)[0],
|
||||||
|
len(input))
|
||||||
|
|
||||||
def decode(input, errors='strict'):
|
def decode(input, errors='strict'):
|
||||||
prefix = 0
|
prefix = 0
|
||||||
|
@ -641,11 +641,13 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
self.body.append('\\hline\n')
|
self.body.append('\\hline\n')
|
||||||
self.body.append('\\endfirsthead\n\n')
|
self.body.append('\\endfirsthead\n\n')
|
||||||
self.body.append('\multicolumn{%s}{c}%%\n' % self.table.colcount)
|
self.body.append('\multicolumn{%s}{c}%%\n' % self.table.colcount)
|
||||||
self.body.append('{{\\bfseries \\tablename\\ \\thetable{} -- %s}} \\\\\n' % _('continued from previous page'))
|
self.body.append('{{\\bfseries \\tablename\\ \\thetable{} -- %s}} '
|
||||||
|
'\\\\\n' % _('continued from previous page'))
|
||||||
self.body.append('\\hline\n')
|
self.body.append('\\hline\n')
|
||||||
self.body.append('\\endhead\n\n')
|
self.body.append('\\endhead\n\n')
|
||||||
self.body.append('\\hline \multicolumn{%s}{|r|}{{%s}} \\\\ \\hline\n' % (
|
self.body.append('\\hline \multicolumn{%s}{|r|}{{%s}} \\\\ '
|
||||||
self.table.colcount, _('Continued on next page')))
|
'\\hline\n' % (self.table.colcount,
|
||||||
|
_('Continued on next page')))
|
||||||
self.body.append('\\endfoot\n\n')
|
self.body.append('\\endfoot\n\n')
|
||||||
self.body.append('\\hline\n')
|
self.body.append('\\hline\n')
|
||||||
self.body.append('\\endlastfoot\n\n')
|
self.body.append('\\endlastfoot\n\n')
|
||||||
|
Loading…
Reference in New Issue
Block a user