mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
merge with 1.0
This commit is contained in:
4
CHANGES
4
CHANGES
@@ -2,8 +2,8 @@ Release 1.1 (in development)
|
|||||||
============================
|
============================
|
||||||
|
|
||||||
|
|
||||||
Release 1.0.1 (in development)
|
Release 1.0.1 (Jul 27, 2010)
|
||||||
==============================
|
============================
|
||||||
|
|
||||||
* #470: Fix generated target names for reST domain objects; they
|
* #470: Fix generated target names for reST domain objects; they
|
||||||
are not in the same namespace.
|
are not in the same namespace.
|
||||||
|
|||||||
2
EXAMPLES
2
EXAMPLES
@@ -12,7 +12,7 @@ interesting examples.
|
|||||||
Documentation using the default theme
|
Documentation using the default theme
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
* APSW: http://apsw.googlecode.com/svn/publish/index.html
|
* APSW: http://apidoc.apsw.googlecode.com/hg/index.html
|
||||||
* ASE: https://wiki.fysik.dtu.dk/ase/
|
* ASE: https://wiki.fysik.dtu.dk/ase/
|
||||||
* boostmpi: http://documen.tician.de/boostmpi/
|
* boostmpi: http://documen.tician.de/boostmpi/
|
||||||
* Calibre: http://calibre.kovidgoyal.net/user_manual/
|
* Calibre: http://calibre.kovidgoyal.net/user_manual/
|
||||||
|
|||||||
@@ -141,9 +141,13 @@ class TypedField(GroupedField):
|
|||||||
par = nodes.paragraph()
|
par = nodes.paragraph()
|
||||||
par += self.make_xref(self.rolename, domain, fieldarg, nodes.strong)
|
par += self.make_xref(self.rolename, domain, fieldarg, nodes.strong)
|
||||||
if fieldarg in types:
|
if fieldarg in types:
|
||||||
typename = u''.join(n.astext() for n in types[fieldarg])
|
|
||||||
par += nodes.Text(' (')
|
par += nodes.Text(' (')
|
||||||
par += self.make_xref(self.typerolename, domain, typename)
|
fieldtype = types[fieldarg]
|
||||||
|
if len(fieldtype) == 1 and isinstance(fieldtype[0], nodes.Text):
|
||||||
|
typename = u''.join(n.astext() for n in types[fieldarg])
|
||||||
|
par += self.make_xref(self.typerolename, domain, typename)
|
||||||
|
else:
|
||||||
|
par += fieldtype
|
||||||
par += nodes.Text(')')
|
par += nodes.Text(')')
|
||||||
par += nodes.Text(' -- ')
|
par += nodes.Text(' -- ')
|
||||||
par += content
|
par += content
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ Testing object descriptions
|
|||||||
|
|
||||||
.. class:: TimeInt
|
.. class:: TimeInt
|
||||||
|
|
||||||
|
:param moo: |test|
|
||||||
|
:type moo: |test|
|
||||||
|
|
||||||
|
.. |test| replace:: Moo
|
||||||
|
|
||||||
.. class:: Time(hour, minute, isdst)
|
.. class:: Time(hour, minute, isdst)
|
||||||
|
|
||||||
:param hour: The year.
|
:param hour: The year.
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import difflib
|
|
||||||
import htmlentitydefs
|
import htmlentitydefs
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
|
|
||||||
@@ -37,9 +36,9 @@ ENV_WARNINGS = """\
|
|||||||
http://www.python.org/logo.png
|
http://www.python.org/logo.png
|
||||||
%(root)s/includes.txt:\\d*: \\(WARNING/2\\) Encoding 'utf-8-sig' used for \
|
%(root)s/includes.txt:\\d*: \\(WARNING/2\\) Encoding 'utf-8-sig' used for \
|
||||||
reading included file u'wrongenc.inc' seems to be wrong, try giving an \
|
reading included file u'wrongenc.inc' seems to be wrong, try giving an \
|
||||||
:encoding: option
|
:encoding: option\\n?
|
||||||
%(root)s/includes.txt:4: WARNING: download file not readable: nonexisting.png
|
%(root)s/includes.txt:4: WARNING: download file not readable: nonexisting.png
|
||||||
%(root)s/objects.txt:79: WARNING: using old C markup; please migrate to \
|
%(root)s/objects.txt:84: WARNING: using old C markup; please migrate to \
|
||||||
new-style markup \(e.g. c:function instead of cfunction\), see \
|
new-style markup \(e.g. c:function instead of cfunction\), see \
|
||||||
http://sphinx.pocoo.org/domains.html
|
http://sphinx.pocoo.org/domains.html
|
||||||
"""
|
"""
|
||||||
@@ -51,6 +50,16 @@ HTML_WARNINGS = ENV_WARNINGS + """\
|
|||||||
%(root)s/markup.txt:: WARNING: invalid pair index entry u'keyword; '
|
%(root)s/markup.txt:: WARNING: invalid pair index entry u'keyword; '
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def tail_check(check):
|
||||||
|
rex = re.compile(check)
|
||||||
|
def checker(nodes):
|
||||||
|
for node in nodes:
|
||||||
|
if node.tail and rex.search(node.tail):
|
||||||
|
return True
|
||||||
|
assert False, '%r not found in tail of any nodes %s' % (check, nodes)
|
||||||
|
return checker
|
||||||
|
|
||||||
|
|
||||||
HTML_XPATH = {
|
HTML_XPATH = {
|
||||||
'images.html': [
|
'images.html': [
|
||||||
(".//img[@src='_images/img.png']", ''),
|
(".//img[@src='_images/img.png']", ''),
|
||||||
@@ -172,6 +181,10 @@ HTML_XPATH = {
|
|||||||
'Testing various markup'),
|
'Testing various markup'),
|
||||||
# custom sidebar
|
# custom sidebar
|
||||||
(".//h4", 'Custom sidebar'),
|
(".//h4", 'Custom sidebar'),
|
||||||
|
# docfields
|
||||||
|
(".//td[@class='field-body']/ul/li/strong", '^moo$'),
|
||||||
|
(".//td[@class='field-body']/ul/li/strong",
|
||||||
|
tail_check(r'\(Moo\) .* Moo')),
|
||||||
],
|
],
|
||||||
'contents.html': [
|
'contents.html': [
|
||||||
(".//meta[@name='hc'][@content='hcval']", ''),
|
(".//meta[@name='hc'][@content='hcval']", ''),
|
||||||
@@ -285,8 +298,8 @@ def test_html(app):
|
|||||||
html_warnings_exp = HTML_WARNINGS % {'root': re.escape(app.srcdir)}
|
html_warnings_exp = HTML_WARNINGS % {'root': re.escape(app.srcdir)}
|
||||||
assert re.match(html_warnings_exp + '$', html_warnings), \
|
assert re.match(html_warnings_exp + '$', html_warnings), \
|
||||||
'Warnings don\'t match:\n' + \
|
'Warnings don\'t match:\n' + \
|
||||||
'\n'.join(difflib.ndiff(html_warnings_exp.splitlines(),
|
'--- Expected (regex):\n' + html_warnings_exp + \
|
||||||
html_warnings.splitlines()))
|
'--- Got:\n' + html_warnings
|
||||||
|
|
||||||
for fname, paths in HTML_XPATH.iteritems():
|
for fname, paths in HTML_XPATH.iteritems():
|
||||||
parser = NslessParser()
|
parser = NslessParser()
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import difflib
|
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
|
||||||
@@ -42,8 +41,9 @@ def test_latex(app):
|
|||||||
latex_warnings_exp = LATEX_WARNINGS % {'root': app.srcdir}
|
latex_warnings_exp = LATEX_WARNINGS % {'root': app.srcdir}
|
||||||
assert re.match(latex_warnings_exp + '$', latex_warnings), \
|
assert re.match(latex_warnings_exp + '$', latex_warnings), \
|
||||||
'Warnings don\'t match:\n' + \
|
'Warnings don\'t match:\n' + \
|
||||||
'\n'.join(difflib.ndiff(latex_warnings_exp.splitlines(),
|
'--- Expected (regex):\n' + latex_warnings_exp + \
|
||||||
latex_warnings.splitlines()))
|
'--- Got:\n' + latex_warnings
|
||||||
|
|
||||||
# file from latex_additional_files
|
# file from latex_additional_files
|
||||||
assert (app.outdir / 'svgimg.svg').isfile()
|
assert (app.outdir / 'svgimg.svg').isfile()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user