mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
Merge branch 'stable'
This commit is contained in:
@@ -146,6 +146,9 @@ Bugs fixed
|
||||
* #2900: Fix epub content.opf: add auto generated orphan files to spine.
|
||||
* #2899: Fix ``hasdoc()`` function in Jinja2 template. It can detect ``genindex``, ``search`` collectly.
|
||||
* #2901: Fix epub result: skip creating links from image tags to original image files.
|
||||
* #2917: inline code is hyphenated on HTML
|
||||
* #1462: autosummary warns for namedtuple with attribute with trailing underscore
|
||||
* Could not reference equations if ``:nowrap:`` option specified
|
||||
|
||||
Release 1.4.6 (released Aug 20, 2016)
|
||||
=====================================
|
||||
|
||||
@@ -68,7 +68,7 @@ from docutils import nodes
|
||||
|
||||
import sphinx
|
||||
from sphinx import addnodes
|
||||
from sphinx.util import import_object
|
||||
from sphinx.util import import_object, rst
|
||||
from sphinx.util.compat import Directive
|
||||
from sphinx.pycode import ModuleAnalyzer, PycodeError
|
||||
from sphinx.ext.autodoc import Options
|
||||
@@ -369,7 +369,7 @@ class Autosummary(Directive):
|
||||
for name, sig, summary, real_name in items:
|
||||
qualifier = 'obj'
|
||||
if 'nosignatures' not in self.options:
|
||||
col1 = ':%s:`%s <%s>`\ %s' % (qualifier, name, real_name, sig)
|
||||
col1 = ':%s:`%s <%s>`\ %s' % (qualifier, name, real_name, rst.escape(sig))
|
||||
else:
|
||||
col1 = ':%s:`%s <%s>`' % (qualifier, name, real_name)
|
||||
col2 = summary
|
||||
|
||||
@@ -223,13 +223,16 @@ def latex_visit_math(self, node):
|
||||
|
||||
|
||||
def latex_visit_displaymath(self, node):
|
||||
if not node['label']:
|
||||
label = None
|
||||
else:
|
||||
label = "equation:%s:%s" % (node['docname'], node['label'])
|
||||
|
||||
if node['nowrap']:
|
||||
if label:
|
||||
self.body.append(r'\label{%s}' % label)
|
||||
self.body.append(node['latex'])
|
||||
else:
|
||||
if not node['label']:
|
||||
label = None
|
||||
else:
|
||||
label = "equation:%s:%s" % (node['docname'], node['label'])
|
||||
self.body.append(wrap_displaymath(node['latex'], label,
|
||||
self.builder.config.math_number_all))
|
||||
raise nodes.SkipNode
|
||||
|
||||
@@ -496,6 +496,13 @@ pre {
|
||||
overflow-y: hidden; /* fixes display issues on Chrome browsers */
|
||||
}
|
||||
|
||||
span.pre {
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
-webkit-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
td.linenos pre {
|
||||
padding: 5px 0px;
|
||||
border: 0;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
sphinx.util.rst
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
reST helper functions.
|
||||
|
||||
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
symbols_re = re.compile('([!-/:-@\[-`{-~])')
|
||||
|
||||
|
||||
def escape(text):
|
||||
return symbols_re.sub(r'\\\1', text)
|
||||
@@ -69,3 +69,7 @@ class C:
|
||||
'''
|
||||
This is a nested inner class docstring
|
||||
'''
|
||||
|
||||
|
||||
def func(arg_):
|
||||
"""Test function take an argument ended with underscore."""
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
test_util_rst
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Tests sphinx.util.rst functions.
|
||||
|
||||
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from sphinx.util.rst import escape
|
||||
|
||||
|
||||
def test_escape():
|
||||
assert escape(':ref:`id`') == '\:ref\:\`id\`'
|
||||
assert escape('footnote [#]_') == 'footnote \[\#\]\_'
|
||||
Reference in New Issue
Block a user