mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
merge with stable
This commit is contained in:
@@ -218,7 +218,7 @@ package.
|
|||||||
use ``docutils.nodes.generated`` if you want no further text decoration. If
|
use ``docutils.nodes.generated`` if you want no further text decoration. If
|
||||||
the text should be treated as literal (e.g. no smart quote replacement), but
|
the text should be treated as literal (e.g. no smart quote replacement), but
|
||||||
not have typewriter styling, use ``sphinx.addnodes.literal_emphasis`` or
|
not have typewriter styling, use ``sphinx.addnodes.literal_emphasis`` or
|
||||||
``sphinx.addnodes.literal_strong``.
|
``sphinx.addnodes.literal_strong``.
|
||||||
|
|
||||||
For the role content, you have the same syntactical possibilities as for
|
For the role content, you have the same syntactical possibilities as for
|
||||||
standard Sphinx roles (see :ref:`xref-syntax`).
|
standard Sphinx roles (see :ref:`xref-syntax`).
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ using :meth:`.Sphinx.add_directive` or :meth:`.Sphinx.add_directive_to_domain`.
|
|||||||
.. attribute:: arguments
|
.. attribute:: arguments
|
||||||
|
|
||||||
The arguments given to the directive, as a list.
|
The arguments given to the directive, as a list.
|
||||||
|
|
||||||
.. attribute:: options
|
.. attribute:: options
|
||||||
|
|
||||||
The options given to the directive, as a dictionary mapping option names
|
The options given to the directive, as a dictionary mapping option names
|
||||||
@@ -82,7 +82,7 @@ using :meth:`.Sphinx.add_directive` or :meth:`.Sphinx.add_directive_to_domain`.
|
|||||||
|
|
||||||
Internal offset of the directive content. Used when calling
|
Internal offset of the directive content. Used when calling
|
||||||
``nested_parse`` (see below).
|
``nested_parse`` (see below).
|
||||||
|
|
||||||
.. attribute:: block_text
|
.. attribute:: block_text
|
||||||
|
|
||||||
The string containing the entire directive.
|
The string containing the entire directive.
|
||||||
|
|||||||
+1
-1
@@ -294,5 +294,5 @@ There is `sphinx translation page`_ for Sphinx-1.2 documentation.
|
|||||||
.. _`transifex-client`: https://pypi.python.org/pypi/transifex-client
|
.. _`transifex-client`: https://pypi.python.org/pypi/transifex-client
|
||||||
.. _`sphinx-intl`: https://pypi.python.org/pypi/sphinx-intl
|
.. _`sphinx-intl`: https://pypi.python.org/pypi/sphinx-intl
|
||||||
.. _Transifex: https://www.transifex.com/
|
.. _Transifex: https://www.transifex.com/
|
||||||
.. _`sphinx translation page`: https://www.transifex.com/projects/p/sphinx-doc-1_2_0/
|
.. _`sphinx translation page`: https://www.transifex.com/projects/p/sphinx-doc-1_2_0/
|
||||||
.. _`Transifex Client v0.8 — Transifex documentation`: http://help.transifex.com/features/client/index.html
|
.. _`Transifex Client v0.8 — Transifex documentation`: http://help.transifex.com/features/client/index.html
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""
|
"""
|
||||||
Sphinx
|
sphinx.__main__
|
||||||
~~~~~~
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The Sphinx documentation toolchain.
|
The Sphinx documentation toolchain.
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ class Catalog(object):
|
|||||||
|
|
||||||
def add(self, msg, origin):
|
def add(self, msg, origin):
|
||||||
if not hasattr(origin, 'uid'):
|
if not hasattr(origin, 'uid'):
|
||||||
# Nodes that are replicated like todo don't have a uid, however i18n is also unnecessary.
|
# Nodes that are replicated like todo don't have a uid,
|
||||||
|
# however i18n is also unnecessary.
|
||||||
return
|
return
|
||||||
if msg not in self.metadata: # faster lookup in hash
|
if msg not in self.metadata: # faster lookup in hash
|
||||||
self.messages.append(msg)
|
self.messages.append(msg)
|
||||||
|
|||||||
+16
-8
@@ -50,7 +50,8 @@ BUILDERS = [
|
|||||||
("", "xml", "to make Docutils-native XML files"),
|
("", "xml", "to make Docutils-native XML files"),
|
||||||
("", "pseudoxml", "to make pseudoxml-XML files for display purposes"),
|
("", "pseudoxml", "to make pseudoxml-XML files for display purposes"),
|
||||||
("", "linkcheck", "to check all external links for integrity"),
|
("", "linkcheck", "to check all external links for integrity"),
|
||||||
("", "doctest", "to run all doctests embedded in the documentation (if enabled)"),
|
("", "doctest", "to run all doctests embedded in the documentation "
|
||||||
|
"(if enabled)"),
|
||||||
("", "coverage", "to run coverage check of the documentation (if enabled)"),
|
("", "coverage", "to run coverage check of the documentation (if enabled)"),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -92,13 +93,15 @@ class Make(object):
|
|||||||
if self.run_generic_build('dirhtml') > 0:
|
if self.run_generic_build('dirhtml') > 0:
|
||||||
return 1
|
return 1
|
||||||
print()
|
print()
|
||||||
print('Build finished. The HTML pages are in %s.' % self.builddir_join('dirhtml'))
|
print('Build finished. The HTML pages are in %s.' %
|
||||||
|
self.builddir_join('dirhtml'))
|
||||||
|
|
||||||
def build_singlehtml(self):
|
def build_singlehtml(self):
|
||||||
if self.run_generic_build('singlehtml') > 0:
|
if self.run_generic_build('singlehtml') > 0:
|
||||||
return 1
|
return 1
|
||||||
print()
|
print()
|
||||||
print('Build finished. The HTML page is in %s.' % self.builddir_join('singlehtml'))
|
print('Build finished. The HTML page is in %s.' %
|
||||||
|
self.builddir_join('singlehtml'))
|
||||||
|
|
||||||
def build_pickle(self):
|
def build_pickle(self):
|
||||||
if self.run_generic_build('pickle') > 0:
|
if self.run_generic_build('pickle') > 0:
|
||||||
@@ -127,7 +130,8 @@ class Make(object):
|
|||||||
'.qhcp project file in %s, like this:' % self.builddir_join('qthelp'))
|
'.qhcp project file in %s, like this:' % self.builddir_join('qthelp'))
|
||||||
print('$ qcollectiongenerator %s.qhcp' % self.builddir_join('qthelp', proj_name))
|
print('$ qcollectiongenerator %s.qhcp' % self.builddir_join('qthelp', proj_name))
|
||||||
print('To view the help file:')
|
print('To view the help file:')
|
||||||
print('$ assistant -collectionFile %s.qhc' % self.builddir_join('qthelp', proj_name))
|
print('$ assistant -collectionFile %s.qhc' %
|
||||||
|
self.builddir_join('qthelp', proj_name))
|
||||||
|
|
||||||
def build_devhelp(self):
|
def build_devhelp(self):
|
||||||
if self.run_generic_build('devhelp') > 0:
|
if self.run_generic_build('devhelp') > 0:
|
||||||
@@ -173,7 +177,8 @@ class Make(object):
|
|||||||
def build_texinfo(self):
|
def build_texinfo(self):
|
||||||
if self.run_generic_build('texinfo') > 0:
|
if self.run_generic_build('texinfo') > 0:
|
||||||
return 1
|
return 1
|
||||||
print("Build finished; the Texinfo files are in %s." % self.builddir_join('texinfo'))
|
print("Build finished; the Texinfo files are in %s." %
|
||||||
|
self.builddir_join('texinfo'))
|
||||||
if os.name == 'posix':
|
if os.name == 'posix':
|
||||||
print("Run `make' in that directory to run these through makeinfo")
|
print("Run `make' in that directory to run these through makeinfo")
|
||||||
print("(use `make info' here to do that automatically).")
|
print("(use `make info' here to do that automatically).")
|
||||||
@@ -188,13 +193,15 @@ class Make(object):
|
|||||||
if self.run_generic_build('gettext', doctreedir=dtdir) > 0:
|
if self.run_generic_build('gettext', doctreedir=dtdir) > 0:
|
||||||
return 1
|
return 1
|
||||||
print()
|
print()
|
||||||
print('Build finished. The message catalogs are in %s.' % self.builddir_join('gettext'))
|
print('Build finished. The message catalogs are in %s.' %
|
||||||
|
self.builddir_join('gettext'))
|
||||||
|
|
||||||
def build_changes(self):
|
def build_changes(self):
|
||||||
if self.run_generic_build('changes') > 0:
|
if self.run_generic_build('changes') > 0:
|
||||||
return 1
|
return 1
|
||||||
print()
|
print()
|
||||||
print('Build finished. The overview file is in %s.' % self.builddir_join('changes'))
|
print('Build finished. The overview file is in %s.' %
|
||||||
|
self.builddir_join('changes'))
|
||||||
|
|
||||||
def build_linkcheck(self):
|
def build_linkcheck(self):
|
||||||
res = self.run_generic_build('linkcheck')
|
res = self.run_generic_build('linkcheck')
|
||||||
@@ -227,7 +234,8 @@ class Make(object):
|
|||||||
if self.run_generic_build('pseudoxml') > 0:
|
if self.run_generic_build('pseudoxml') > 0:
|
||||||
return 1
|
return 1
|
||||||
print()
|
print()
|
||||||
print('Build finished. The pseudo-XML files are in %s.' % self.builddir_join('pseudoxml'))
|
print('Build finished. The pseudo-XML files are in %s.' %
|
||||||
|
self.builddir_join('pseudoxml'))
|
||||||
|
|
||||||
def run_generic_build(self, builder, doctreedir=None):
|
def run_generic_build(self, builder, doctreedir=None):
|
||||||
# compatibility with old Makefile
|
# compatibility with old Makefile
|
||||||
|
|||||||
@@ -58,7 +58,8 @@ def extract_messages(doctree):
|
|||||||
# this issue was filed to Docutils tracker:
|
# this issue was filed to Docutils tracker:
|
||||||
# sf.net/tracker/?func=detail&aid=3599485&group_id=38414&atid=422032
|
# sf.net/tracker/?func=detail&aid=3599485&group_id=38414&atid=422032
|
||||||
# sourceforge.net/p/docutils/patches/108/
|
# sourceforge.net/p/docutils/patches/108/
|
||||||
if isinstance(node, (nodes.caption, nodes.title, nodes.rubric)) and not node.source:
|
if isinstance(node, (nodes.caption, nodes.title, nodes.rubric)) \
|
||||||
|
and not node.source:
|
||||||
node.source = find_source_node(node)
|
node.source = find_source_node(node)
|
||||||
node.line = 0 #need fix docutils to get `node.line`
|
node.line = 0 #need fix docutils to get `node.line`
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ if sys.version_info < (3, 0):
|
|||||||
def check_style_and_encoding(fn, lines):
|
def check_style_and_encoding(fn, lines):
|
||||||
encoding = 'ascii'
|
encoding = 'ascii'
|
||||||
for lno, line in enumerate(lines):
|
for lno, line in enumerate(lines):
|
||||||
if len(line) > 81:
|
if len(line) > 90:
|
||||||
yield lno+1, "line too long"
|
yield lno+1, "line too long"
|
||||||
if lno < 2:
|
if lno < 2:
|
||||||
co = coding_re.search(line)
|
co = coding_re.search(line)
|
||||||
|
|||||||
Reference in New Issue
Block a user