mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch 'stable'
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -126,7 +126,7 @@ Bugs fixed
|
|||||||
* Fix duplicated toc in epub3 output.
|
* Fix duplicated toc in epub3 output.
|
||||||
* #2775: Fix failing linkcheck with servers not supporting identidy encoding
|
* #2775: Fix failing linkcheck with servers not supporting identidy encoding
|
||||||
* #2833: Fix formatting instance annotations in ext.autodoc.
|
* #2833: Fix formatting instance annotations in ext.autodoc.
|
||||||
* #1911: ``-D`` option of `sphinx-build` does not override the ``extensions`` variable
|
* #1911: ``-D`` option of ``sphinx-build`` does not override the ``extensions`` variable
|
||||||
|
|
||||||
Release 1.4.5 (released Jul 13, 2016)
|
Release 1.4.5 (released Jul 13, 2016)
|
||||||
=====================================
|
=====================================
|
||||||
|
|||||||
4
doc/_templates/index.html
vendored
4
doc/_templates/index.html
vendored
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
<div class="quotebar">
|
<div class="quotebar">
|
||||||
<p><em>{%trans%}What users say:{%endtrans%}</em></p>
|
<p><em>{%trans%}What users say:{%endtrans%}</em></p>
|
||||||
<p>{%trans%}“Cheers for a great tool that actually makes programmers <b>want</b>
|
<p>{%trans%}“Cheers for a great tool that actually makes programmers <b>want</b>
|
||||||
to write documentation!”{%endtrans%}</p>
|
to write documentation!“{%endtrans%}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>{%trans%}
|
<p>{%trans%}
|
||||||
|
|||||||
4
doc/_themes/sphinx13/layout.html
vendored
4
doc/_themes/sphinx13/layout.html
vendored
@@ -57,8 +57,8 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block rootrellink %}
|
{% block rootrellink %}
|
||||||
<li><a href="{{ pathto('index') }}">Sphinx home</a> |</li>
|
<li><a href="{{ pathto('index') }}">Sphinx home</a> |</li>
|
||||||
<li><a href="{{ pathto('contents') }}">Documentation</a> »</li>
|
<li><a href="{{ pathto('contents') }}">Documentation</a> »</li>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block header %}
|
{% block header %}
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ epub_author = 'Georg Brandl'
|
|||||||
epub_publisher = 'http://sphinx-doc.org/'
|
epub_publisher = 'http://sphinx-doc.org/'
|
||||||
epub_scheme = 'url'
|
epub_scheme = 'url'
|
||||||
epub_identifier = epub_publisher
|
epub_identifier = epub_publisher
|
||||||
epub_pre_files = [('index.html', 'Welcome')]
|
epub_pre_files = [('index.xhtml', 'Welcome')]
|
||||||
epub_post_files = [('install.html', 'Installing Sphinx'),
|
epub_post_files = [('install.xhtml', 'Installing Sphinx'),
|
||||||
('develop.html', 'Sphinx development')]
|
('develop.xhtml', 'Sphinx development')]
|
||||||
epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js',
|
epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js',
|
||||||
'_static/jquery.js', '_static/searchtools.js',
|
'_static/jquery.js', '_static/searchtools.js',
|
||||||
'_static/underscore.js', '_static/basic.css',
|
'_static/underscore.js', '_static/basic.css',
|
||||||
@@ -48,6 +48,7 @@ epub_max_image_width = 0
|
|||||||
epub_show_urls = 'inline'
|
epub_show_urls = 'inline'
|
||||||
epub_use_index = False
|
epub_use_index = False
|
||||||
epub_guide = (('toc', 'contents.xhtml', u'Table of Contents'),)
|
epub_guide = (('toc', 'contents.xhtml', u'Table of Contents'),)
|
||||||
|
epub3_description = 'Sphinx documentation generator system manual'
|
||||||
|
|
||||||
latex_documents = [('contents', 'sphinx.tex', 'Sphinx Documentation',
|
latex_documents = [('contents', 'sphinx.tex', 'Sphinx Documentation',
|
||||||
'Georg Brandl', 'manual', 1)]
|
'Georg Brandl', 'manual', 1)]
|
||||||
|
|||||||
@@ -1398,6 +1398,10 @@ the `Dublin Core metadata <http://dublincore.org/>`_.
|
|||||||
a chapter, but can be confusing because it mixes entries of different
|
a chapter, but can be confusing because it mixes entries of different
|
||||||
depth in one list. The default value is ``True``.
|
depth in one list. The default value is ``True``.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
``epub3`` builder ignores ``epub_tocdup`` option(always ``False``)
|
||||||
|
|
||||||
.. confval:: epub_tocscope
|
.. confval:: epub_tocscope
|
||||||
|
|
||||||
This setting control the scope of the epub table of contents. The setting
|
This setting control the scope of the epub table of contents. The setting
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import re
|
|||||||
import codecs
|
import codecs
|
||||||
import zipfile
|
import zipfile
|
||||||
from os import path
|
from os import path
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
@@ -28,7 +29,6 @@ from docutils import nodes
|
|||||||
|
|
||||||
from sphinx import addnodes
|
from sphinx import addnodes
|
||||||
from sphinx.builders.html import StandaloneHTMLBuilder
|
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||||
from sphinx.util.i18n import format_date
|
|
||||||
from sphinx.util.osutil import ensuredir, copyfile, make_filename, EEXIST
|
from sphinx.util.osutil import ensuredir, copyfile, make_filename, EEXIST
|
||||||
from sphinx.util.smartypants import sphinx_smarty_pants as ssp
|
from sphinx.util.smartypants import sphinx_smarty_pants as ssp
|
||||||
from sphinx.util.console import brown
|
from sphinx.util.console import brown
|
||||||
@@ -129,8 +129,7 @@ GUIDE_TEMPLATE = u'''\
|
|||||||
TOCTREE_TEMPLATE = u'toctree-l%d'
|
TOCTREE_TEMPLATE = u'toctree-l%d'
|
||||||
|
|
||||||
DOCTYPE = u'''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
DOCTYPE = u'''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'''
|
||||||
'''
|
|
||||||
|
|
||||||
LINK_TARGET_TEMPLATE = u' [%(uri)s]'
|
LINK_TARGET_TEMPLATE = u' [%(uri)s]'
|
||||||
|
|
||||||
@@ -540,8 +539,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
|||||||
metadata['copyright'] = self.esc(self.config.epub_copyright)
|
metadata['copyright'] = self.esc(self.config.epub_copyright)
|
||||||
metadata['scheme'] = self.esc(self.config.epub_scheme)
|
metadata['scheme'] = self.esc(self.config.epub_scheme)
|
||||||
metadata['id'] = self.esc(self.config.epub_identifier)
|
metadata['id'] = self.esc(self.config.epub_identifier)
|
||||||
metadata['date'] = self.esc(format_date('%Y-%m-%d', language=self.config.language,
|
metadata['date'] = self.esc(datetime.utcnow().strftime("%Y-%m-%d"))
|
||||||
warn=self.warn))
|
|
||||||
metadata['files'] = files
|
metadata['files'] = files
|
||||||
metadata['spine'] = spine
|
metadata['spine'] = spine
|
||||||
metadata['guide'] = guide
|
metadata['guide'] = guide
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
from os import path
|
from os import path
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
from sphinx.config import string_classes
|
from sphinx.config import string_classes
|
||||||
from sphinx.builders.epub import EpubBuilder
|
from sphinx.builders.epub import EpubBuilder
|
||||||
@@ -42,13 +43,12 @@ NAVIGATION_DOC_TEMPLATE = u'''\
|
|||||||
</html>
|
</html>
|
||||||
'''
|
'''
|
||||||
|
|
||||||
NAVLIST_TEMPLATE = u'''\
|
NAVLIST_TEMPLATE = u'''%(indent)s <li><a href="%(refuri)s">%(text)s</a></li>'''
|
||||||
%(indent)s <li>
|
NAVLIST_TEMPLATE_HAS_CHILD = u'''%(indent)s <li><a href="%(refuri)s">%(text)s</a>'''
|
||||||
%(indent)s <a href="%(refuri)s">%(text)s</a>
|
NAVLIST_TEMPLATE_BEGIN_BLOCK = u'''%(indent)s <ol>'''
|
||||||
%(indent)s </li>
|
NAVLIST_TEMPLATE_END_BLOCK = u'''%(indent)s </ol>
|
||||||
'''
|
%(indent)s </li>'''
|
||||||
NAVLIST_INDENT = ' '
|
NAVLIST_INDENT = ' '
|
||||||
|
|
||||||
|
|
||||||
PACKAGE_DOC_TEMPLATE = u'''\
|
PACKAGE_DOC_TEMPLATE = u'''\
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
@@ -82,8 +82,7 @@ PACKAGE_DOC_TEMPLATE = u'''\
|
|||||||
</package>
|
</package>
|
||||||
'''
|
'''
|
||||||
|
|
||||||
DOCTYPE = u'''<!DOCTYPE html>
|
DOCTYPE = u'''<!DOCTYPE html>'''
|
||||||
'''
|
|
||||||
|
|
||||||
# The epub3 publisher
|
# The epub3 publisher
|
||||||
|
|
||||||
@@ -100,6 +99,9 @@ class Epub3Builder(EpubBuilder):
|
|||||||
|
|
||||||
navigation_doc_template = NAVIGATION_DOC_TEMPLATE
|
navigation_doc_template = NAVIGATION_DOC_TEMPLATE
|
||||||
navlist_template = NAVLIST_TEMPLATE
|
navlist_template = NAVLIST_TEMPLATE
|
||||||
|
navlist_template_has_child = NAVLIST_TEMPLATE_HAS_CHILD
|
||||||
|
navlist_template_begin_block = NAVLIST_TEMPLATE_BEGIN_BLOCK
|
||||||
|
navlist_template_end_block = NAVLIST_TEMPLATE_END_BLOCK
|
||||||
navlist_indent = NAVLIST_INDENT
|
navlist_indent = NAVLIST_INDENT
|
||||||
content_template = PACKAGE_DOC_TEMPLATE
|
content_template = PACKAGE_DOC_TEMPLATE
|
||||||
doctype = DOCTYPE
|
doctype = DOCTYPE
|
||||||
@@ -125,15 +127,26 @@ class Epub3Builder(EpubBuilder):
|
|||||||
metadata['contributor'] = self.esc(self.config.epub3_contributor)
|
metadata['contributor'] = self.esc(self.config.epub3_contributor)
|
||||||
metadata['page_progression_direction'] = self.esc(
|
metadata['page_progression_direction'] = self.esc(
|
||||||
self.config.epub3_page_progression_direction) or 'default'
|
self.config.epub3_page_progression_direction) or 'default'
|
||||||
|
metadata['date'] = self.esc(datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"))
|
||||||
return metadata
|
return metadata
|
||||||
|
|
||||||
def new_navlist(self, node, level):
|
def new_navlist(self, node, level, has_child):
|
||||||
"""Create a new entry in the toc from the node at given level."""
|
"""Create a new entry in the toc from the node at given level."""
|
||||||
# XXX Modifies the node
|
# XXX Modifies the node
|
||||||
self.tocid += 1
|
self.tocid += 1
|
||||||
node['indent'] = self.navlist_indent * level
|
node['indent'] = self.navlist_indent * level
|
||||||
navpoint = self.navlist_template % node
|
if has_child:
|
||||||
return navpoint
|
return self.navlist_template_has_child % node
|
||||||
|
else:
|
||||||
|
return self.navlist_template % node
|
||||||
|
|
||||||
|
def begin_navlist_block(self, level):
|
||||||
|
return self.navlist_template_begin_block % {
|
||||||
|
"indent": self.navlist_indent * level
|
||||||
|
}
|
||||||
|
|
||||||
|
def end_navlist_block(self, level):
|
||||||
|
return self.navlist_template_end_block % {"indent": self.navlist_indent * level}
|
||||||
|
|
||||||
def build_navlist(self, nodes):
|
def build_navlist(self, nodes):
|
||||||
"""Create the toc navigation structure.
|
"""Create the toc navigation structure.
|
||||||
@@ -145,10 +158,9 @@ class Epub3Builder(EpubBuilder):
|
|||||||
The difference from build_navpoints method is templates which are used
|
The difference from build_navpoints method is templates which are used
|
||||||
when generating navigation documents.
|
when generating navigation documents.
|
||||||
"""
|
"""
|
||||||
navstack = []
|
|
||||||
navlist = []
|
navlist = []
|
||||||
level = 1
|
level = 1
|
||||||
lastnode = None
|
usenodes = []
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
if not node['text']:
|
if not node['text']:
|
||||||
continue
|
continue
|
||||||
@@ -157,30 +169,23 @@ class Epub3Builder(EpubBuilder):
|
|||||||
continue
|
continue
|
||||||
if node['level'] > self.config.epub_tocdepth:
|
if node['level'] > self.config.epub_tocdepth:
|
||||||
continue
|
continue
|
||||||
if node['level'] == level:
|
usenodes.append(node)
|
||||||
navlist.append(self.new_navlist(node, level))
|
for i, node in enumerate(usenodes):
|
||||||
elif node['level'] == level + 1:
|
curlevel = node['level']
|
||||||
navstack.append(navlist)
|
if curlevel == level + 1:
|
||||||
navlist = []
|
navlist.append(self.begin_navlist_block(level))
|
||||||
level += 1
|
while curlevel < level:
|
||||||
if lastnode and self.config.epub_tocdup:
|
level -= 1
|
||||||
navlist.append(self.new_navlist(node, level))
|
navlist.append(self.end_navlist_block(level))
|
||||||
navlist[-1] = '<ol>\n' + navlist[-1]
|
level = curlevel
|
||||||
|
if i != len(usenodes) - 1 and usenodes[i + 1]['level'] > level:
|
||||||
|
has_child = True
|
||||||
else:
|
else:
|
||||||
while node['level'] < level:
|
has_child = False
|
||||||
subnav = '\n'.join(navlist)
|
navlist.append(self.new_navlist(node, level, has_child))
|
||||||
navlist = navstack.pop()
|
|
||||||
navlist[-1] = self.insert_subnav(navlist[-1], subnav)
|
|
||||||
level -= 1
|
|
||||||
navlist[-1] = navlist[-1] + '</ol>'
|
|
||||||
navlist.append(self.new_navlist(node, level))
|
|
||||||
lastnode = node
|
|
||||||
while level != 1:
|
while level != 1:
|
||||||
subnav = '\n'.join(navlist)
|
|
||||||
navlist = navstack.pop()
|
|
||||||
navlist[-1] = self.insert_subnav(navlist[-1], subnav)
|
|
||||||
level -= 1
|
level -= 1
|
||||||
navlist[-1] = navlist[-1] + '</ol>'
|
navlist.append(self.end_navlist_block(level))
|
||||||
return '\n'.join(navlist)
|
return '\n'.join(navlist)
|
||||||
|
|
||||||
def navigation_doc_metadata(self, navlist):
|
def navigation_doc_metadata(self, navlist):
|
||||||
@@ -212,7 +217,8 @@ class Epub3Builder(EpubBuilder):
|
|||||||
self.navigation_doc_metadata(navlist))
|
self.navigation_doc_metadata(navlist))
|
||||||
|
|
||||||
# Add nav.xhtml to epub file
|
# Add nav.xhtml to epub file
|
||||||
self.files.append(outname)
|
if outname not in self.files:
|
||||||
|
self.files.append(outname)
|
||||||
|
|
||||||
|
|
||||||
def setup(app):
|
def setup(app):
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"http://www.w3.org/TR/html4/frameset.dtd">
|
"http://www.w3.org/TR/html4/frameset.dtd">
|
||||||
<html{% if language is not none %} lang="{{ language }}"{% endif %}>
|
<html{% if language is not none %} lang="{{ language }}"{% endif %}>
|
||||||
<head>
|
<head>
|
||||||
<title>{% trans version=version|e, docstitle=docstitle|e %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %}</title>
|
<title>{% trans version=version|e, docstitle=docstitle|e %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %}</title>
|
||||||
</head>
|
</head>
|
||||||
<frameset cols="45%,*">
|
<frameset cols="45%,*">
|
||||||
<frame name="main" src="changes.html">
|
<frame name="main" src="changes.html">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"http://www.w3.org/TR/html4/loose.dtd">
|
"http://www.w3.org/TR/html4/loose.dtd">
|
||||||
<html{% if language is not none %} lang="{{ language }}"{% endif %}>
|
<html{% if language is not none %} lang="{{ language }}"{% endif %}>
|
||||||
<head>
|
<head>
|
||||||
<title>{% trans filename=filename, docstitle=docstitle|e %}{{ filename }} — {{ docstitle }}{% endtrans %}</title>
|
<title>{% trans filename=filename, docstitle=docstitle|e %}{{ filename }} — {{ docstitle }}{% endtrans %}</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.hl { background-color: yellow }
|
.hl { background-color: yellow }
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="default.css">
|
<link rel="stylesheet" href="default.css">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>{% trans version=version|e, docstitle=docstitle|e %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %}</title>
|
<title>{% trans version=version|e, docstitle=docstitle|e %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="document">
|
<div class="document">
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<table class="indextable modindextable" cellspacing="0" cellpadding="2">
|
<table class="indextable modindextable" cellspacing="0" cellpadding="2">
|
||||||
{%- for letter, entries in content %}
|
{%- for letter, entries in content %}
|
||||||
<tr class="pcap"><td></td><td> </td><td></td></tr>
|
<tr class="pcap"><td></td><td> </td><td></td></tr>
|
||||||
<tr class="cap" id="cap-{{ letter }}"><td></td><td>
|
<tr class="cap" id="cap-{{ letter }}"><td></td><td>
|
||||||
<strong>{{ letter }}</strong></td><td></td></tr>
|
<strong>{{ letter }}</strong></td><td></td></tr>
|
||||||
{%- for (name, grouptype, page, anchor, extra, qualifier, description)
|
{%- for (name, grouptype, page, anchor, extra, qualifier, description)
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<img src="{{ pathto('_static/minus.png', 1) }}" class="toggler"
|
<img src="{{ pathto('_static/minus.png', 1) }}" class="toggler"
|
||||||
id="toggle-{{ groupid.next() }}" style="display: none" alt="-" />
|
id="toggle-{{ groupid.next() }}" style="display: none" alt="-" />
|
||||||
{%- endif %}</td>
|
{%- endif %}</td>
|
||||||
<td>{% if grouptype == 2 %} {% endif %}
|
<td>{% if grouptype == 2 %}   {% endif %}
|
||||||
{% if page %}<a href="{{ pathto(page) }}#{{ anchor }}">{% endif -%}
|
{% if page %}<a href="{{ pathto(page) }}#{{ anchor }}">{% endif -%}
|
||||||
<code class="xref">{{ name|e }}</code>
|
<code class="xref">{{ name|e }}</code>
|
||||||
{%- if page %}</a>{% endif %}
|
{%- if page %}</a>{% endif %}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
{%- endblock %}
|
{%- endblock %}
|
||||||
{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %}
|
{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %}
|
||||||
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
|
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
|
||||||
{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
|
{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
|
||||||
(sidebars != []) %}
|
(sidebars != []) %}
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
{# XXX necessary? #}
|
{# XXX necessary? #}
|
||||||
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
|
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
|
||||||
{%- if not embedded and docstitle %}
|
{%- if not embedded and docstitle %}
|
||||||
{%- set titlesuffix = " — "|safe + docstitle|e %}
|
{%- set titlesuffix = " — "|safe + docstitle|e %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set titlesuffix = "" %}
|
{%- set titlesuffix = "" %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
@@ -187,9 +187,9 @@
|
|||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
{%- if show_copyright %}
|
{%- if show_copyright %}
|
||||||
{%- if hasdoc('copyright') %}
|
{%- if hasdoc('copyright') %}
|
||||||
{% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
|
{% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}
|
{% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if last_updated %}
|
{%- if last_updated %}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ decade_abbr_re = re.compile(r"""\b'(?=\d{2}s)""")
|
|||||||
opening_double_quotes_regex = re.compile(r"""
|
opening_double_quotes_regex = re.compile(r"""
|
||||||
(
|
(
|
||||||
\s | # a whitespace char, or
|
\s | # a whitespace char, or
|
||||||
| # a non-breaking space entity, or
|
  | # a non-breaking space entity, or
|
||||||
-- | # dashes, or
|
-- | # dashes, or
|
||||||
&[mn]dash; | # named dash entities
|
&[mn]dash; | # named dash entities
|
||||||
%s | # or decimal entities
|
%s | # or decimal entities
|
||||||
@@ -131,7 +131,7 @@ closing_double_quotes_regex_2 = re.compile(r"""
|
|||||||
opening_single_quotes_regex = re.compile(r"""
|
opening_single_quotes_regex = re.compile(r"""
|
||||||
(
|
(
|
||||||
\s | # a whitespace char, or
|
\s | # a whitespace char, or
|
||||||
| # a non-breaking space entity, or
|
  | # a non-breaking space entity, or
|
||||||
-- | # dashes, or
|
-- | # dashes, or
|
||||||
&[mn]dash; | # named dash entities
|
&[mn]dash; | # named dash entities
|
||||||
%s | # or decimal entities
|
%s | # or decimal entities
|
||||||
|
|||||||
@@ -545,7 +545,7 @@ class HTMLTranslator(BaseTranslator):
|
|||||||
self.body.append(token)
|
self.body.append(token)
|
||||||
else:
|
else:
|
||||||
# protect runs of multiple spaces; the last one can wrap
|
# protect runs of multiple spaces; the last one can wrap
|
||||||
self.body.append(' ' * (len(token)-1) + ' ')
|
self.body.append(' ' * (len(token)-1) + ' ')
|
||||||
else:
|
else:
|
||||||
if self.in_mailto and self.settings.cloak_email_addresses:
|
if self.in_mailto and self.settings.cloak_email_addresses:
|
||||||
encoded = self.cloak_email(encoded)
|
encoded = self.cloak_email(encoded)
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ def verify(rst, html_expected, latex_expected):
|
|||||||
def test_inline():
|
def test_inline():
|
||||||
# correct interpretation of code with whitespace
|
# correct interpretation of code with whitespace
|
||||||
_html = ('<p><code class="(samp )?docutils literal"><span class="pre">'
|
_html = ('<p><code class="(samp )?docutils literal"><span class="pre">'
|
||||||
'code</span> <span class="pre">sample</span></code></p>')
|
'code</span>   <span class="pre">sample</span></code></p>')
|
||||||
yield verify_re, '``code sample``', _html, r'\\sphinxcode{code sample}'
|
yield verify_re, '``code sample``', _html, r'\\sphinxcode{code sample}'
|
||||||
yield verify_re, ':samp:`code sample`', _html, r'\\sphinxcode{code sample}'
|
yield verify_re, ':samp:`code sample`', _html, r'\\sphinxcode{code sample}'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user