mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
merge with stable
This commit is contained in:
commit
0c01c6e9a7
6
CHANGES
6
CHANGES
@ -10,9 +10,13 @@ Release 1.2 (in development)
|
||||
* Update to jQuery 1.7.1 and Underscore.js 1.3.1.
|
||||
|
||||
|
||||
Release 1.1.3 (in development)
|
||||
Release 1.1.4 (in development)
|
||||
==============================
|
||||
|
||||
|
||||
Release 1.1.3 (Mar 10, 2012)
|
||||
============================
|
||||
|
||||
* PR#40: Fix ``safe_repr`` function to decode bytestrings with non-ASCII
|
||||
characters correctly.
|
||||
|
||||
|
@ -137,7 +137,6 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
|
||||
new_sections = []
|
||||
for section in sections:
|
||||
if not isinstance(section, unicode):
|
||||
# XXX is this really necessary?
|
||||
new_sections.append(force_decode(section, None))
|
||||
else:
|
||||
new_sections.append(section)
|
||||
@ -222,14 +221,14 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
|
||||
return True
|
||||
|
||||
def write_toc(self, node, indentlevel=4):
|
||||
# XXX this should return a Unicode string, not a bytestring
|
||||
parts = []
|
||||
if self.isdocnode(node):
|
||||
refnode = node.children[0][0]
|
||||
link = refnode['refuri']
|
||||
title = htmlescape(refnode.astext()).replace('"','"')
|
||||
item = '<section title="%(title)s" ref="%(ref)s">' % {
|
||||
'title': title,
|
||||
'ref': link}
|
||||
title = htmlescape(refnode.astext()).replace('"', '"')
|
||||
item = '<section title="%(title)s" ref="%(ref)s">' % \
|
||||
{'title': title, 'ref': link}
|
||||
parts.append(' '*4*indentlevel + item)
|
||||
for subnode in node.children[1]:
|
||||
parts.extend(self.write_toc(subnode, indentlevel+1))
|
||||
|
@ -319,7 +319,8 @@ class Glossary(Directive):
|
||||
|
||||
defnode = nodes.definition()
|
||||
if definition:
|
||||
self.state.nested_parse(definition, definition.items[0][1], defnode)
|
||||
self.state.nested_parse(definition, definition.items[0][1],
|
||||
defnode)
|
||||
|
||||
items.append((termtexts,
|
||||
nodes.definition_list_item('', term, defnode)))
|
||||
|
@ -383,7 +383,8 @@ Doctest summary
|
||||
test = parser.get_doctest(code[0].code, {}, group.name,
|
||||
filename, code[0].lineno)
|
||||
except Exception:
|
||||
self.warn('ignoring invalid doctest code: %r' % code[0].code,
|
||||
self.warn('ignoring invalid doctest code: %r' %
|
||||
code[0].code,
|
||||
'%s:%s' % (filename, code[0].lineno))
|
||||
continue
|
||||
if not test.examples:
|
||||
|
@ -127,7 +127,7 @@ class BuildDoc(Command):
|
||||
status_stream = sys.stdout
|
||||
confoverrides = {}
|
||||
if self.project:
|
||||
confoverrides['project'] = self.project
|
||||
confoverrides['project'] = self.project
|
||||
if self.version:
|
||||
confoverrides['version'] = self.version
|
||||
if self.release:
|
||||
|
@ -28,6 +28,7 @@ import jinja2
|
||||
|
||||
import sphinx
|
||||
from sphinx.errors import PycodeError
|
||||
from sphinx.util.pycompat import bytes
|
||||
|
||||
# import other utilities; partly for backwards compatibility, so don't
|
||||
# prune unused ones indiscriminately
|
||||
@ -310,7 +311,7 @@ def parselinenos(spec, total):
|
||||
|
||||
def force_decode(string, encoding):
|
||||
"""Forcibly get a unicode string out of a bytestring."""
|
||||
if isinstance(string, str):
|
||||
if isinstance(string, bytes):
|
||||
if encoding:
|
||||
string = string.decode(encoding)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user