mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
merge with trunk
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
.*\.egg
|
.*\.egg
|
||||||
.*\.so
|
.*\.so
|
||||||
.dir-locals.el
|
.dir-locals.el
|
||||||
|
^\.tox
|
||||||
\.DS_Store$
|
\.DS_Store$
|
||||||
^build/
|
^build/
|
||||||
^dist/
|
^dist/
|
||||||
|
|||||||
@@ -1,6 +1,32 @@
|
|||||||
Release 1.0 (in development)
|
Release 1.1 (in development)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
Release 1.0.2 (in development)
|
||||||
|
==============================
|
||||||
|
|
||||||
|
Release 1.0.1 (Jul 27, 2010)
|
||||||
|
============================
|
||||||
|
|
||||||
|
* #470: Fix generated target names for reST domain objects; they
|
||||||
|
are not in the same namespace.
|
||||||
|
|
||||||
|
* #266: Add Bengali language.
|
||||||
|
|
||||||
|
* #473: Fix a bug in parsing JavaScript object names.
|
||||||
|
|
||||||
|
* #474: Fix building with SingleHTMLBuilder when there is no toctree.
|
||||||
|
|
||||||
|
* Fix display names for objects linked to by intersphinx with
|
||||||
|
explicit targets.
|
||||||
|
|
||||||
|
* Fix building with the JSON builder.
|
||||||
|
|
||||||
|
* Fix hyperrefs in object descriptions for LaTeX.
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.0 (Jul 23, 2010)
|
||||||
|
==========================
|
||||||
|
|
||||||
Incompatible changes
|
Incompatible changes
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
|||||||
@@ -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/
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ all: clean-pyc check test
|
|||||||
check:
|
check:
|
||||||
@$(PYTHON) utils/check_sources.py -i build -i dist -i sphinx/style/jquery.js \
|
@$(PYTHON) utils/check_sources.py -i build -i dist -i sphinx/style/jquery.js \
|
||||||
-i sphinx/pycode/pgen2 -i sphinx/util/smartypants.py -i .ropeproject \
|
-i sphinx/pycode/pgen2 -i sphinx/util/smartypants.py -i .ropeproject \
|
||||||
-i doc/_build -i ez_setup.py -i tests/path.py -i tests/coverage.py -i env .
|
-i doc/_build -i ez_setup.py -i tests/path.py -i tests/coverage.py \
|
||||||
|
-i env -i .tox .
|
||||||
|
|
||||||
clean: clean-pyc clean-patchfiles
|
clean: clean-pyc clean-patchfiles
|
||||||
|
|
||||||
|
|||||||
@@ -283,6 +283,7 @@ Project information
|
|||||||
|
|
||||||
Currently supported languages are:
|
Currently supported languages are:
|
||||||
|
|
||||||
|
* ``bn`` -- Bengali
|
||||||
* ``ca`` -- Catalan
|
* ``ca`` -- Catalan
|
||||||
* ``cs`` -- Czech
|
* ``cs`` -- Czech
|
||||||
* ``da`` -- Danish
|
* ``da`` -- Danish
|
||||||
@@ -782,6 +783,12 @@ the `Dublin Core metadata <http://dublincore.org/>`_.
|
|||||||
be an integer greater than zero. The default value is 3. Note: A deeply
|
be an integer greater than zero. The default value is 3. Note: A deeply
|
||||||
nested table of contents may be difficult to navigate.
|
nested table of contents may be difficult to navigate.
|
||||||
|
|
||||||
|
.. confval:: epub_tocdup
|
||||||
|
|
||||||
|
This flag determines if a toc entry is inserted again at the beginning of
|
||||||
|
it's nested toc listing. This allows easier navitation to the top of
|
||||||
|
a chapter, but can be confusing because it mixes entries of differnet
|
||||||
|
depth in one list. The default value is ``True``.
|
||||||
|
|
||||||
.. _latex-options:
|
.. _latex-options:
|
||||||
|
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ setup(
|
|||||||
'License :: OSI Approved :: BSD License',
|
'License :: OSI Approved :: BSD License',
|
||||||
'Operating System :: OS Independent',
|
'Operating System :: OS Independent',
|
||||||
'Programming Language :: Python',
|
'Programming Language :: Python',
|
||||||
|
'Programming Language :: Python :: 2',
|
||||||
'Topic :: Documentation',
|
'Topic :: Documentation',
|
||||||
'Topic :: Text Processing',
|
'Topic :: Text Processing',
|
||||||
'Topic :: Utilities',
|
'Topic :: Utilities',
|
||||||
|
|||||||
+2
-2
@@ -12,8 +12,8 @@
|
|||||||
import sys
|
import sys
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
__version__ = '1.0b2+'
|
__version__ = '1.1pre'
|
||||||
__released__ = '1.0b2' # used when Sphinx builds its own docs
|
__released__ = '1.1 (hg)' # used when Sphinx builds its own docs
|
||||||
|
|
||||||
package_dir = path.abspath(path.dirname(__file__))
|
package_dir = path.abspath(path.dirname(__file__))
|
||||||
|
|
||||||
|
|||||||
+84
-31
@@ -11,13 +11,14 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import codecs
|
import codecs
|
||||||
from os import path
|
|
||||||
import zipfile
|
import zipfile
|
||||||
|
from os import path
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.transforms import Transform
|
|
||||||
|
|
||||||
|
from sphinx import addnodes
|
||||||
from sphinx.builders.html import StandaloneHTMLBuilder
|
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||||
from sphinx.util.osutil import EEXIST
|
from sphinx.util.osutil import EEXIST
|
||||||
from sphinx.util.smartypants import sphinx_smarty_pants as ssp
|
from sphinx.util.smartypants import sphinx_smarty_pants as ssp
|
||||||
@@ -120,29 +121,10 @@ _media_types = {
|
|||||||
'.ttf': 'application/x-font-ttf',
|
'.ttf': 'application/x-font-ttf',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Regular expression to match colons only in local fragment identifiers.
|
||||||
# The transform to show link targets
|
# If the URI contains a colon before the #,
|
||||||
|
# it is an external link that should not change.
|
||||||
class VisibleLinksTransform(Transform):
|
_refuri_re = re.compile("([^#:]*#)(.*)")
|
||||||
"""
|
|
||||||
Add the link target of references to the text, unless it is already
|
|
||||||
present in the description.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# This transform must run after the references transforms
|
|
||||||
default_priority = 680
|
|
||||||
|
|
||||||
def apply(self):
|
|
||||||
for ref in self.document.traverse(nodes.reference):
|
|
||||||
uri = ref.get('refuri', '')
|
|
||||||
if ( uri.startswith('http:') or uri.startswith('https:') or \
|
|
||||||
uri.startswith('ftp:') ) and uri not in ref.astext():
|
|
||||||
uri = _link_target_template % {'uri': uri}
|
|
||||||
if uri:
|
|
||||||
idx = ref.parent.index(ref) + 1
|
|
||||||
link = nodes.inline(uri, uri)
|
|
||||||
link['classes'].append(_css_link_target_class)
|
|
||||||
ref.parent.insert(idx, link)
|
|
||||||
|
|
||||||
|
|
||||||
# The epub publisher
|
# The epub publisher
|
||||||
@@ -171,10 +153,6 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
|||||||
# the output files for epub must be .html only
|
# the output files for epub must be .html only
|
||||||
self.out_suffix = '.html'
|
self.out_suffix = '.html'
|
||||||
self.playorder = 0
|
self.playorder = 0
|
||||||
# Disable transform until the issue with cached doctrees is solved.
|
|
||||||
# Building the html file after the epub file shows the
|
|
||||||
# visible links also in the HTML output.
|
|
||||||
#self.app.add_transform(VisibleLinksTransform)
|
|
||||||
|
|
||||||
def get_theme_config(self):
|
def get_theme_config(self):
|
||||||
return self.config.epub_theme, {}
|
return self.config.epub_theme, {}
|
||||||
@@ -198,7 +176,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
|||||||
"""Collect section titles, their depth in the toc and the refuri."""
|
"""Collect section titles, their depth in the toc and the refuri."""
|
||||||
# XXX: is there a better way than checking the attribute
|
# XXX: is there a better way than checking the attribute
|
||||||
# toctree-l[1-8] on the parent node?
|
# toctree-l[1-8] on the parent node?
|
||||||
if isinstance(doctree, nodes.reference) and hasattr(doctree, 'refuri'):
|
if isinstance(doctree, nodes.reference) and doctree.has_key('refuri'):
|
||||||
refuri = doctree['refuri']
|
refuri = doctree['refuri']
|
||||||
if refuri.startswith('http://') or refuri.startswith('https://') \
|
if refuri.startswith('http://') or refuri.startswith('https://') \
|
||||||
or refuri.startswith('irc:') or refuri.startswith('mailto:'):
|
or refuri.startswith('irc:') or refuri.startswith('mailto:'):
|
||||||
@@ -243,6 +221,81 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
|||||||
'text': ssp(self.esc(text))
|
'text': ssp(self.esc(text))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
def fix_fragment(self, match):
|
||||||
|
"""Return a href attribute with colons replaced by hyphens.
|
||||||
|
"""
|
||||||
|
return match.group(1) + match.group(2).replace(':', '-')
|
||||||
|
|
||||||
|
def fix_ids(self, tree):
|
||||||
|
"""Replace colons with hyphens in href and id attributes.
|
||||||
|
Some readers crash because they interpret the part as a
|
||||||
|
transport protocol specification.
|
||||||
|
"""
|
||||||
|
for node in tree.traverse(nodes.reference):
|
||||||
|
if 'refuri' in node:
|
||||||
|
m = _refuri_re.match(node['refuri'])
|
||||||
|
if m:
|
||||||
|
node['refuri'] = self.fix_fragment(m)
|
||||||
|
if 'refid' in node:
|
||||||
|
node['refid'] = node['refid'].replace(':', '-')
|
||||||
|
for node in tree.traverse(addnodes.desc_signature):
|
||||||
|
ids = node.attributes['ids']
|
||||||
|
newids = []
|
||||||
|
for id in ids:
|
||||||
|
newids.append(id.replace(':', '-'))
|
||||||
|
node.attributes['ids'] = newids
|
||||||
|
|
||||||
|
def add_visible_links(self, tree):
|
||||||
|
"""Append visible link targets after external links.
|
||||||
|
"""
|
||||||
|
for node in tree.traverse(nodes.reference):
|
||||||
|
uri = node.get('refuri', '')
|
||||||
|
if (uri.startswith('http:') or uri.startswith('https:') or
|
||||||
|
uri.startswith('ftp:')) and uri not in node.astext():
|
||||||
|
uri = _link_target_template % {'uri': uri}
|
||||||
|
if uri:
|
||||||
|
idx = node.parent.index(node) + 1
|
||||||
|
link = nodes.inline(uri, uri)
|
||||||
|
link['classes'].append(_css_link_target_class)
|
||||||
|
node.parent.insert(idx, link)
|
||||||
|
|
||||||
|
def write_doc(self, docname, doctree):
|
||||||
|
"""Write one document file.
|
||||||
|
This method is overwritten in order to fix fragment identifiers
|
||||||
|
and to add visible external links.
|
||||||
|
"""
|
||||||
|
self.fix_ids(doctree)
|
||||||
|
self.add_visible_links(doctree)
|
||||||
|
return StandaloneHTMLBuilder.write_doc(self, docname, doctree)
|
||||||
|
|
||||||
|
def fix_genindex(self, tree):
|
||||||
|
"""Fix href attributes for genindex pages.
|
||||||
|
"""
|
||||||
|
# XXX: modifies tree inline
|
||||||
|
# Logic modeled from themes/basic/genindex.html
|
||||||
|
for key, columns in tree:
|
||||||
|
for entryname, (links, subitems) in columns:
|
||||||
|
for (i, link) in enumerate(links):
|
||||||
|
m = _refuri_re.match(link)
|
||||||
|
if m:
|
||||||
|
links[i] = self.fix_fragment(m)
|
||||||
|
for subentryname, subentrylinks in subitems:
|
||||||
|
for (i, link) in enumerate(subentrylinks):
|
||||||
|
m = _refuri_re.match(link)
|
||||||
|
if m:
|
||||||
|
subentrylinks[i] = self.fix_fragment(m)
|
||||||
|
|
||||||
|
def handle_page(self, pagename, addctx, templatename='page.html',
|
||||||
|
outfilename=None, event_arg=None):
|
||||||
|
"""Create a rendered page.
|
||||||
|
This method is overwritten for genindex pages in order to fix
|
||||||
|
href link attributes.
|
||||||
|
"""
|
||||||
|
if pagename.startswith('genindex'):
|
||||||
|
self.fix_genindex(addctx['genindexentries'])
|
||||||
|
StandaloneHTMLBuilder.handle_page(self, pagename, addctx, templatename,
|
||||||
|
outfilename, event_arg)
|
||||||
|
|
||||||
|
|
||||||
# Finish by building the epub file
|
# Finish by building the epub file
|
||||||
def handle_finish(self):
|
def handle_finish(self):
|
||||||
@@ -388,7 +441,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
|||||||
navstack.append(navlist)
|
navstack.append(navlist)
|
||||||
navlist = []
|
navlist = []
|
||||||
level += 1
|
level += 1
|
||||||
if lastnode:
|
if lastnode and self.config.epub_tocdup:
|
||||||
# Insert starting point in subtoc with same playOrder
|
# Insert starting point in subtoc with same playOrder
|
||||||
navlist.append(self.new_navpoint(lastnode, level, False))
|
navlist.append(self.new_navpoint(lastnode, level, False))
|
||||||
navlist.append(self.new_navpoint(node, level))
|
navlist.append(self.new_navpoint(node, level))
|
||||||
|
|||||||
+13
-15
@@ -30,7 +30,7 @@ from docutils.frontend import OptionParser
|
|||||||
from docutils.readers.doctree import Reader as DoctreeReader
|
from docutils.readers.doctree import Reader as DoctreeReader
|
||||||
|
|
||||||
from sphinx import package_dir, __version__
|
from sphinx import package_dir, __version__
|
||||||
from sphinx.util import copy_static_entry
|
from sphinx.util import jsonimpl, copy_static_entry
|
||||||
from sphinx.util.osutil import SEP, os_path, relative_uri, ensuredir, \
|
from sphinx.util.osutil import SEP, os_path, relative_uri, ensuredir, \
|
||||||
movefile, ustrftime, copyfile
|
movefile, ustrftime, copyfile
|
||||||
from sphinx.util.nodes import inline_all_toctrees
|
from sphinx.util.nodes import inline_all_toctrees
|
||||||
@@ -47,14 +47,6 @@ from sphinx.util.console import bold, darkgreen, brown
|
|||||||
from sphinx.writers.html import HTMLWriter, HTMLTranslator, \
|
from sphinx.writers.html import HTMLWriter, HTMLTranslator, \
|
||||||
SmartyPantsHTMLTranslator
|
SmartyPantsHTMLTranslator
|
||||||
|
|
||||||
try:
|
|
||||||
import json
|
|
||||||
except ImportError:
|
|
||||||
try:
|
|
||||||
import simplejson as json
|
|
||||||
except ImportError:
|
|
||||||
json = None
|
|
||||||
|
|
||||||
#: the filename for the inventory of objects
|
#: the filename for the inventory of objects
|
||||||
INVENTORY_FILENAME = 'objects.inv'
|
INVENTORY_FILENAME = 'objects.inv'
|
||||||
#: the filename for the "last build" file (for serializing builders)
|
#: the filename for the "last build" file (for serializing builders)
|
||||||
@@ -855,8 +847,14 @@ class SingleFileHTMLBuilder(StandaloneHTMLBuilder):
|
|||||||
def get_doc_context(self, docname, body, metatags):
|
def get_doc_context(self, docname, body, metatags):
|
||||||
# no relation links...
|
# no relation links...
|
||||||
toc = self.env.get_toctree_for(self.config.master_doc, self, False)
|
toc = self.env.get_toctree_for(self.config.master_doc, self, False)
|
||||||
self.fix_refuris(toc)
|
# if there is no toctree, toc is None
|
||||||
toc = self.render_partial(toc)['fragment']
|
if toc:
|
||||||
|
self.fix_refuris(toc)
|
||||||
|
toc = self.render_partial(toc)['fragment']
|
||||||
|
display_toc = True
|
||||||
|
else:
|
||||||
|
toc = ''
|
||||||
|
display_toc = False
|
||||||
return dict(
|
return dict(
|
||||||
parents = [],
|
parents = [],
|
||||||
prev = None,
|
prev = None,
|
||||||
@@ -869,7 +867,7 @@ class SingleFileHTMLBuilder(StandaloneHTMLBuilder):
|
|||||||
rellinks = [],
|
rellinks = [],
|
||||||
sourcename = '',
|
sourcename = '',
|
||||||
toc = toc,
|
toc = toc,
|
||||||
display_toc = True,
|
display_toc = display_toc,
|
||||||
)
|
)
|
||||||
|
|
||||||
def write(self, *ignored):
|
def write(self, *ignored):
|
||||||
@@ -1007,15 +1005,15 @@ class JSONHTMLBuilder(SerializingHTMLBuilder):
|
|||||||
"""
|
"""
|
||||||
A builder that dumps the generated HTML into JSON files.
|
A builder that dumps the generated HTML into JSON files.
|
||||||
"""
|
"""
|
||||||
implementation = json
|
implementation = jsonimpl
|
||||||
indexer_format = json
|
indexer_format = jsonimpl
|
||||||
name = 'json'
|
name = 'json'
|
||||||
out_suffix = '.fjson'
|
out_suffix = '.fjson'
|
||||||
globalcontext_filename = 'globalcontext.json'
|
globalcontext_filename = 'globalcontext.json'
|
||||||
searchindex_filename = 'searchindex.json'
|
searchindex_filename = 'searchindex.json'
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
if json is None:
|
if jsonimpl.json is None:
|
||||||
raise SphinxError(
|
raise SphinxError(
|
||||||
'The module simplejson (or json in Python >= 2.6) '
|
'The module simplejson (or json in Python >= 2.6) '
|
||||||
'is not available. The JSONHTMLBuilder builder will not work.')
|
'is not available. The JSONHTMLBuilder builder will not work.')
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ class Config(object):
|
|||||||
epub_post_files = ([], 'env'),
|
epub_post_files = ([], 'env'),
|
||||||
epub_exclude_files = ([], 'env'),
|
epub_exclude_files = ([], 'env'),
|
||||||
epub_tocdepth = (3, 'env'),
|
epub_tocdepth = (3, 'env'),
|
||||||
|
epub_tocdup = (True, 'env'),
|
||||||
|
|
||||||
# LaTeX options
|
# LaTeX options
|
||||||
latex_documents = ([], None),
|
latex_documents = ([], None),
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class LiteralInclude(Directive):
|
|||||||
rel_fn = filename[1:]
|
rel_fn = filename[1:]
|
||||||
else:
|
else:
|
||||||
docdir = path.dirname(env.doc2path(env.docname, base=None))
|
docdir = path.dirname(env.doc2path(env.docname, base=None))
|
||||||
rel_fn = path.normpath(path.join(docdir, filename))
|
rel_fn = path.join(docdir, filename)
|
||||||
try:
|
try:
|
||||||
fn = path.join(env.srcdir, rel_fn)
|
fn = path.join(env.srcdir, rel_fn)
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
|
|||||||
@@ -215,12 +215,7 @@ class VersionChange(Directive):
|
|||||||
else:
|
else:
|
||||||
ret = [node]
|
ret = [node]
|
||||||
env = self.state.document.settings.env
|
env = self.state.document.settings.env
|
||||||
env.versionchanges.setdefault(node['version'], []).append(
|
env.note_versionchange(node['type'], node['version'], node, self.lineno)
|
||||||
(node['type'], env.temp_data['docname'], self.lineno,
|
|
||||||
# XXX: python domain specific
|
|
||||||
env.temp_data.get('py:module'),
|
|
||||||
env.temp_data.get('object'),
|
|
||||||
node.astext()))
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class JSObject(ObjectDescription):
|
|||||||
else:
|
else:
|
||||||
# just a function or constructor
|
# just a function or constructor
|
||||||
objectname = ''
|
objectname = ''
|
||||||
fullname = ''
|
fullname = name
|
||||||
|
|
||||||
signode['object'] = objectname
|
signode['object'] = objectname
|
||||||
signode['fullname'] = fullname
|
signode['fullname'] = fullname
|
||||||
|
|||||||
@@ -28,9 +28,10 @@ class ReSTMarkup(ObjectDescription):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def add_target_and_index(self, name, sig, signode):
|
def add_target_and_index(self, name, sig, signode):
|
||||||
if name not in self.state.document.ids:
|
targetname = name + '-' + self.objtype
|
||||||
signode['names'].append(name)
|
if targetname not in self.state.document.ids:
|
||||||
signode['ids'].append(name)
|
signode['names'].append(targetname)
|
||||||
|
signode['ids'].append(targetname)
|
||||||
signode['first'] = (not self.names)
|
signode['first'] = (not self.names)
|
||||||
self.state.document.note_explicit_target(signode)
|
self.state.document.note_explicit_target(signode)
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ class ReSTMarkup(ObjectDescription):
|
|||||||
indextext = self.get_index_text(self.objtype, name)
|
indextext = self.get_index_text(self.objtype, name)
|
||||||
if indextext:
|
if indextext:
|
||||||
self.indexnode['entries'].append(('single', indextext,
|
self.indexnode['entries'].append(('single', indextext,
|
||||||
name, name))
|
targetname, targetname))
|
||||||
|
|
||||||
def get_index_text(self, objectname, name):
|
def get_index_text(self, objectname, name):
|
||||||
if self.objtype == 'directive':
|
if self.objtype == 'directive':
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ default_settings = {
|
|||||||
|
|
||||||
# This is increased every time an environment attribute is added
|
# This is increased every time an environment attribute is added
|
||||||
# or changed to properly invalidate pickle files.
|
# or changed to properly invalidate pickle files.
|
||||||
ENV_VERSION = 36
|
ENV_VERSION = 37
|
||||||
|
|
||||||
|
|
||||||
default_substitutions = set([
|
default_substitutions = set([
|
||||||
@@ -733,6 +733,12 @@ class BuildEnvironment:
|
|||||||
def note_dependency(self, filename):
|
def note_dependency(self, filename):
|
||||||
self.dependencies.setdefault(self.docname, set()).add(filename)
|
self.dependencies.setdefault(self.docname, set()).add(filename)
|
||||||
|
|
||||||
|
def note_versionchange(self, type, version, node, lineno):
|
||||||
|
self.versionchanges.setdefault(version, []).append(
|
||||||
|
(type, self.temp_data['docname'], lineno,
|
||||||
|
self.temp_data.get('py:module'),
|
||||||
|
self.temp_data.get('object'), node.astext()))
|
||||||
|
|
||||||
# post-processing of read doctrees
|
# post-processing of read doctrees
|
||||||
|
|
||||||
def filter_messages(self, doctree):
|
def filter_messages(self, doctree):
|
||||||
|
|||||||
@@ -191,10 +191,12 @@ def missing_reference(app, env, node, contnode):
|
|||||||
return
|
return
|
||||||
objtypes = ['%s:%s' % (domain, objtype) for objtype in objtypes]
|
objtypes = ['%s:%s' % (domain, objtype) for objtype in objtypes]
|
||||||
to_try = [(env.intersphinx_inventory, target)]
|
to_try = [(env.intersphinx_inventory, target)]
|
||||||
|
in_set = None
|
||||||
if ':' in target:
|
if ':' in target:
|
||||||
# first part may be the foreign doc set name
|
# first part may be the foreign doc set name
|
||||||
setname, newtarget = target.split(':', 1)
|
setname, newtarget = target.split(':', 1)
|
||||||
if setname in env.intersphinx_named_inventory:
|
if setname in env.intersphinx_named_inventory:
|
||||||
|
in_set = setname
|
||||||
to_try.append((env.intersphinx_named_inventory[setname], newtarget))
|
to_try.append((env.intersphinx_named_inventory[setname], newtarget))
|
||||||
for inventory, target in to_try:
|
for inventory, target in to_try:
|
||||||
for objtype in objtypes:
|
for objtype in objtypes:
|
||||||
@@ -204,10 +206,13 @@ def missing_reference(app, env, node, contnode):
|
|||||||
newnode = nodes.reference('', '', internal=False, refuri=uri,
|
newnode = nodes.reference('', '', internal=False, refuri=uri,
|
||||||
reftitle='(in %s v%s)' % (proj, version))
|
reftitle='(in %s v%s)' % (proj, version))
|
||||||
if dispname == '-':
|
if dispname == '-':
|
||||||
newnode.append(contnode)
|
dispname = target
|
||||||
else:
|
newnode.append(contnode.__class__(dispname, dispname))
|
||||||
newnode.append(contnode.__class__(dispname, dispname))
|
|
||||||
return newnode
|
return newnode
|
||||||
|
# at least get rid of the ':' in the target if no explicit title given
|
||||||
|
if in_set is not None and not node.get('refexplicit', True):
|
||||||
|
if len(contnode) and isinstance(contnode[0], nodes.Text):
|
||||||
|
contnode[0] = nodes.Text(newtarget, contnode[0].rawsource)
|
||||||
|
|
||||||
|
|
||||||
def setup(app):
|
def setup(app):
|
||||||
|
|||||||
@@ -61,3 +61,4 @@ def setup(app):
|
|||||||
app.add_role('cfunc', old_crole)
|
app.add_role('cfunc', old_crole)
|
||||||
app.add_role('cmacro', old_crole)
|
app.add_role('cmacro', old_crole)
|
||||||
app.add_role('ctype', old_crole)
|
app.add_role('ctype', old_crole)
|
||||||
|
app.add_role('cmember', old_crole)
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
Documentation.addTranslations({"locale": "bn", "plural_expr": "(n != 1)", "messages": {"Search Results": "\u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8\u09c7\u09b0 \u09ab\u09b2\u09be\u09ab\u09b2", "Preparing search...": "\u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8\u09c7\u09b0 \u09aa\u09cd\u09b0\u09b8\u09cd\u09a4\u09c1\u09a4\u09bf \u099a\u09b2\u099b\u09c7...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "\u0986\u09aa\u09a8\u09be\u09b0 \u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8\u09c7 \u0995\u09c7\u09be\u09a8 \u09ab\u09b2\u09be\u09ab\u09b2 \u09aa\u09be\u0993\u09df\u09be \u09af\u09be\u09df\u09a8\u09bf\u0964 \u0986\u09aa\u09a8\u09be\u09b0 \u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8\u09c7\u09b0 \u09b6\u09ac\u09cd\u09a6\u0997\u09c1\u09b2\u09c7\u09be\u09b0 \u09b8\u09a0\u09bf\u0995 \u09ac\u09be\u09a8\u09be\u09a8 \u0993 \u09ac\u09bf\u09ad\u09be\u0997 \u09a8\u09bf\u09b0\u09cd\u09ac\u09be\u099a\u09a8 \u09a8\u09bf\u09b6\u09cd\u099a\u09bf\u09a4 \u0995\u09b0\u09c1\u09a8\u0964", "Search finished, found %s page(s) matching the search query.": "\u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8 \u09b6\u09c7\u09b7 \u09b9\u09df\u09c7\u099b\u09c7, \u09ab\u09b2\u09be\u09ab\u09b2\u09c7 %s-\u099f\u09bf \u09aa\u09be\u09a4\u09be \u09aa\u09be\u0993\u09df\u09be \u0997\u09c7\u099b\u09c7\u0964", ", in ": ", -", "Permalink to this headline": "\u098f\u0987 \u09b6\u09bf\u09b0\u09c7\u09be\u09a8\u09be\u09ae\u09c7\u09b0 \u09aa\u09be\u09b0\u09cd\u09ae\u09be\u09b2\u09bf\u0999\u09cd\u0995", "Searching": "\u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8 \u099a\u09b2\u099b\u09c7", "Permalink to this definition": "\u098f\u0987 \u09b8\u0982\u099c\u09cd\u099e\u09be\u09b0 \u09aa\u09be\u09b0\u09cd\u09ae\u09be\u09b2\u09bf\u0999\u09cd\u0995", "Hide Search Matches": "\u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8\u09c7\u09b0 \u09ae\u09cd\u09af\u09be\u099a\u0997\u09c1\u09b2\u09c7\u09be \u09b2\u09c1\u0995\u09be\u09a8"}});
|
||||||
Binary file not shown.
@@ -0,0 +1,698 @@
|
|||||||
|
# Translations template for Sphinx.
|
||||||
|
# Copyright (C) 2009 ORGANIZATION
|
||||||
|
# This file is distributed under the same license as the Sphinx project.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Sphinx 1.0pre/[?1034h2e1ab15e035e\n"
|
||||||
|
"Report-Msgid-Bugs-To: nasim.haque@gmail.com\n"
|
||||||
|
"POT-Creation-Date: 2009-11-08 16:28+0100\n"
|
||||||
|
"PO-Revision-Date: 2009-11-10 13:42+0100\n"
|
||||||
|
"Last-Translator: Nasimul Haque <nasim.haque@gmail.com>\n"
|
||||||
|
"Language-Team: Nasimul Haque <nasim.haque@gmail.com>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=utf-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Generated-By: Babel 0.9.4\n"
|
||||||
|
|
||||||
|
#: sphinx/environment.py:130
|
||||||
|
#: sphinx/writers/latex.py:184
|
||||||
|
#, python-format
|
||||||
|
msgid "%B %d, %Y"
|
||||||
|
msgstr "%B %d, %Y"
|
||||||
|
|
||||||
|
#: sphinx/environment.py:348
|
||||||
|
#: sphinx/themes/basic/genindex-single.html:2
|
||||||
|
#: sphinx/themes/basic/genindex-split.html:2
|
||||||
|
#: sphinx/themes/basic/genindex-split.html:5
|
||||||
|
#: sphinx/themes/basic/genindex.html:2
|
||||||
|
#: sphinx/themes/basic/genindex.html:5
|
||||||
|
#: sphinx/themes/basic/genindex.html:48
|
||||||
|
#: sphinx/themes/basic/layout.html:134
|
||||||
|
#: sphinx/writers/latex.py:190
|
||||||
|
msgid "Index"
|
||||||
|
msgstr "ইনডেক্স"
|
||||||
|
|
||||||
|
#: sphinx/environment.py:349
|
||||||
|
#: sphinx/writers/latex.py:189
|
||||||
|
msgid "Module Index"
|
||||||
|
msgstr "মডিউল ইনডেক্স"
|
||||||
|
|
||||||
|
#: sphinx/environment.py:350
|
||||||
|
#: sphinx/themes/basic/defindex.html:16
|
||||||
|
msgid "Search Page"
|
||||||
|
msgstr "অনুসন্ধান পাতা"
|
||||||
|
|
||||||
|
#: sphinx/roles.py:167
|
||||||
|
#, python-format
|
||||||
|
msgid "Python Enhancement Proposals!PEP %s"
|
||||||
|
msgstr "পাইথন উন্নয়ন পরামর্শ!PEP %s"
|
||||||
|
|
||||||
|
#: sphinx/builders/changes.py:70
|
||||||
|
msgid "Builtins"
|
||||||
|
msgstr "বিল্টইন সমূহ"
|
||||||
|
|
||||||
|
#: sphinx/builders/changes.py:72
|
||||||
|
msgid "Module level"
|
||||||
|
msgstr "মডিউল লেভেল"
|
||||||
|
|
||||||
|
#: sphinx/builders/html.py:224
|
||||||
|
#, python-format
|
||||||
|
msgid "%b %d, %Y"
|
||||||
|
msgstr "%b %d, %Y"
|
||||||
|
|
||||||
|
#: sphinx/builders/html.py:243
|
||||||
|
#: sphinx/themes/basic/defindex.html:21
|
||||||
|
msgid "General Index"
|
||||||
|
msgstr "সাধারণ ইনডেক্স"
|
||||||
|
|
||||||
|
#: sphinx/builders/html.py:243
|
||||||
|
msgid "index"
|
||||||
|
msgstr "ইনডেক্স"
|
||||||
|
|
||||||
|
#: sphinx/builders/html.py:247
|
||||||
|
#: sphinx/builders/htmlhelp.py:220
|
||||||
|
#: sphinx/builders/qthelp.py:133
|
||||||
|
#: sphinx/themes/basic/defindex.html:19
|
||||||
|
#: sphinx/themes/basic/modindex.html:2
|
||||||
|
#: sphinx/themes/basic/modindex.html:13
|
||||||
|
#: sphinx/themes/scrolls/modindex.html:2
|
||||||
|
#: sphinx/themes/scrolls/modindex.html:13
|
||||||
|
msgid "Global Module Index"
|
||||||
|
msgstr "গ্লোবাল মডিউল ইনডেক্স"
|
||||||
|
|
||||||
|
#: sphinx/builders/html.py:248
|
||||||
|
msgid "modules"
|
||||||
|
msgstr "মডিউল সমূহ"
|
||||||
|
|
||||||
|
#: sphinx/builders/html.py:304
|
||||||
|
msgid "next"
|
||||||
|
msgstr "পরবর্তী"
|
||||||
|
|
||||||
|
#: sphinx/builders/html.py:313
|
||||||
|
msgid "previous"
|
||||||
|
msgstr "পূর্ববর্তী"
|
||||||
|
|
||||||
|
#: sphinx/builders/latex.py:162
|
||||||
|
msgid " (in "
|
||||||
|
msgstr "(-"
|
||||||
|
|
||||||
|
#: sphinx/directives/__init__.py:78
|
||||||
|
#: sphinx/directives/__init__.py:79
|
||||||
|
#: sphinx/directives/__init__.py:80
|
||||||
|
#: sphinx/directives/__init__.py:81
|
||||||
|
msgid "Raises"
|
||||||
|
msgstr "রেইজেস"
|
||||||
|
|
||||||
|
#: sphinx/directives/__init__.py:82
|
||||||
|
#: sphinx/directives/__init__.py:83
|
||||||
|
#: sphinx/directives/__init__.py:84
|
||||||
|
msgid "Variable"
|
||||||
|
msgstr "ভ্যারিয়েবল"
|
||||||
|
|
||||||
|
#: sphinx/directives/__init__.py:85
|
||||||
|
#: sphinx/directives/__init__.py:86
|
||||||
|
#: sphinx/directives/__init__.py:92
|
||||||
|
#: sphinx/directives/__init__.py:93
|
||||||
|
msgid "Returns"
|
||||||
|
msgstr "রিটার্নস"
|
||||||
|
|
||||||
|
#: sphinx/directives/__init__.py:94
|
||||||
|
msgid "Return type"
|
||||||
|
msgstr "রিটার্ন টাইপ"
|
||||||
|
|
||||||
|
#: sphinx/directives/__init__.py:169
|
||||||
|
msgid "Parameter"
|
||||||
|
msgstr "প্যারামিটার"
|
||||||
|
|
||||||
|
#: sphinx/directives/__init__.py:173
|
||||||
|
msgid "Parameters"
|
||||||
|
msgstr "প্যারামিটার"
|
||||||
|
|
||||||
|
#: sphinx/directives/other.py:127
|
||||||
|
msgid "Section author: "
|
||||||
|
msgstr "অনুচ্ছেদ লেখক:"
|
||||||
|
|
||||||
|
#: sphinx/directives/other.py:129
|
||||||
|
msgid "Module author: "
|
||||||
|
msgstr "মডিউল লেখক:"
|
||||||
|
|
||||||
|
#: sphinx/directives/other.py:131
|
||||||
|
msgid "Author: "
|
||||||
|
msgstr "লেখক:"
|
||||||
|
|
||||||
|
#: sphinx/directives/other.py:233
|
||||||
|
msgid "See also"
|
||||||
|
msgstr "আরও দেখুন"
|
||||||
|
|
||||||
|
#: sphinx/domains/c.py:124
|
||||||
|
#, python-format
|
||||||
|
msgid "%s (C function)"
|
||||||
|
msgstr "%s (C ফাংশন)"
|
||||||
|
|
||||||
|
#: sphinx/domains/c.py:126
|
||||||
|
#, python-format
|
||||||
|
msgid "%s (C member)"
|
||||||
|
msgstr "%s (C মেম্বার)"
|
||||||
|
|
||||||
|
#: sphinx/domains/c.py:128
|
||||||
|
#, python-format
|
||||||
|
msgid "%s (C macro)"
|
||||||
|
msgstr "%s (C ম্যাক্রো)"
|
||||||
|
|
||||||
|
#: sphinx/domains/c.py:130
|
||||||
|
#, python-format
|
||||||
|
msgid "%s (C type)"
|
||||||
|
msgstr "%s (C টাইপ)"
|
||||||
|
|
||||||
|
#: sphinx/domains/c.py:132
|
||||||
|
#, python-format
|
||||||
|
msgid "%s (C variable)"
|
||||||
|
msgstr "%s (C ভ্যারিয়েবল)"
|
||||||
|
|
||||||
|
#: sphinx/domains/c.py:162
|
||||||
|
msgid "C function"
|
||||||
|
msgstr "C ফাংশন"
|
||||||
|
|
||||||
|
#: sphinx/domains/c.py:163
|
||||||
|
msgid "C member"
|
||||||
|
msgstr "C মেম্বার"
|
||||||
|
|
||||||
|
#: sphinx/domains/c.py:164
|
||||||
|
msgid "C macro"
|
||||||
|
msgstr "C ম্যাক্রো"
|
||||||
|
|
||||||
|
#: sphinx/domains/c.py:165
|
||||||
|
msgid "C type"
|
||||||
|
msgstr "C টাইপ"
|
||||||
|
|
||||||
|
#: sphinx/domains/c.py:166
|
||||||
|
msgid "C variable"
|
||||||
|
msgstr "C ভ্যারিয়েবল"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:186
|
||||||
|
#, python-format
|
||||||
|
msgid "%s() (built-in function)"
|
||||||
|
msgstr "%s() (বিল্ট-ইন ফাংশন)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:187
|
||||||
|
#: sphinx/domains/python.py:244
|
||||||
|
#: sphinx/domains/python.py:256
|
||||||
|
#: sphinx/domains/python.py:269
|
||||||
|
#, python-format
|
||||||
|
msgid "%s() (in module %s)"
|
||||||
|
msgstr "%s() (%s মডিউলে)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:190
|
||||||
|
#, python-format
|
||||||
|
msgid "%s (built-in variable)"
|
||||||
|
msgstr "%s (বিল্ট-ইন ভ্যারিয়েবল)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:191
|
||||||
|
#: sphinx/domains/python.py:282
|
||||||
|
#, python-format
|
||||||
|
msgid "%s (in module %s)"
|
||||||
|
msgstr "%s (%s মডিউলে)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:207
|
||||||
|
#, python-format
|
||||||
|
msgid "%s (built-in class)"
|
||||||
|
msgstr "%s (বিল্ট-ইন ক্লাস)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:208
|
||||||
|
#, python-format
|
||||||
|
msgid "%s (class in %s)"
|
||||||
|
msgstr "%s (%s ক্লাসে)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:248
|
||||||
|
#, python-format
|
||||||
|
msgid "%s() (%s.%s method)"
|
||||||
|
msgstr "%s (%s.%s মেথড)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:250
|
||||||
|
#, python-format
|
||||||
|
msgid "%s() (%s method)"
|
||||||
|
msgstr "%s() (%s মেথড)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:260
|
||||||
|
#, python-format
|
||||||
|
msgid "%s() (%s.%s static method)"
|
||||||
|
msgstr "%s (%s.%s স্ট্যাটিক মেথড)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:263
|
||||||
|
#, python-format
|
||||||
|
msgid "%s() (%s static method)"
|
||||||
|
msgstr "%s() (%s স্ট্যাটিক মেথড)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:273
|
||||||
|
#, python-format
|
||||||
|
msgid "%s() (%s.%s class method)"
|
||||||
|
msgstr "%s() (%s.%s ক্লাস মেথড)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:276
|
||||||
|
#, python-format
|
||||||
|
msgid "%s() (%s class method)"
|
||||||
|
msgstr "%s() (%s ক্লাস মেথড)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:286
|
||||||
|
#, python-format
|
||||||
|
msgid "%s (%s.%s attribute)"
|
||||||
|
msgstr "%s (%s.%s এ্যট্রিবিউট)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:288
|
||||||
|
#, python-format
|
||||||
|
msgid "%s (%s attribute)"
|
||||||
|
msgstr "%s (%s এ্যট্রিবিউট)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:334
|
||||||
|
msgid "Platforms: "
|
||||||
|
msgstr "প্লাটফরম:"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:340
|
||||||
|
#, python-format
|
||||||
|
msgid "%s (module)"
|
||||||
|
msgstr "%s (মডিউল)"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:396
|
||||||
|
msgid "function"
|
||||||
|
msgstr "ফাংশন"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:397
|
||||||
|
msgid "data"
|
||||||
|
msgstr "ডাটা"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:398
|
||||||
|
msgid "class"
|
||||||
|
msgstr "ক্লাস"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:399
|
||||||
|
#: sphinx/locale/__init__.py:161
|
||||||
|
msgid "exception"
|
||||||
|
msgstr "এক্সেপশন"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:400
|
||||||
|
msgid "method"
|
||||||
|
msgstr "মেথড"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:401
|
||||||
|
msgid "attribute"
|
||||||
|
msgstr "এ্যট্রিবিউট"
|
||||||
|
|
||||||
|
#: sphinx/domains/python.py:402
|
||||||
|
#: sphinx/locale/__init__.py:157
|
||||||
|
msgid "module"
|
||||||
|
msgstr "মডিউল"
|
||||||
|
|
||||||
|
#: sphinx/domains/std.py:67
|
||||||
|
#: sphinx/domains/std.py:83
|
||||||
|
#, python-format
|
||||||
|
msgid "environment variable; %s"
|
||||||
|
msgstr "এনভায়রনমেন্ট ভ্যারিয়েবল; %s"
|
||||||
|
|
||||||
|
#: sphinx/domains/std.py:156
|
||||||
|
#, python-format
|
||||||
|
msgid "%scommand line option; %s"
|
||||||
|
msgstr "%sকমান্ড লাইন অপশন; %s"
|
||||||
|
|
||||||
|
#: sphinx/domains/std.py:324
|
||||||
|
msgid "glossary term"
|
||||||
|
msgstr "শব্দকোষ"
|
||||||
|
|
||||||
|
#: sphinx/domains/std.py:325
|
||||||
|
msgid "grammar token"
|
||||||
|
msgstr "ব্যকরণ টোকেন"
|
||||||
|
|
||||||
|
#: sphinx/domains/std.py:326
|
||||||
|
msgid "environment variable"
|
||||||
|
msgstr "এনভায়রনমেন্ট ভ্যারিয়েবল"
|
||||||
|
|
||||||
|
#: sphinx/domains/std.py:327
|
||||||
|
msgid "program option"
|
||||||
|
msgstr "প্রোগ্রাম অপশন"
|
||||||
|
|
||||||
|
#: sphinx/ext/autodoc.py:892
|
||||||
|
#, python-format
|
||||||
|
msgid " Bases: %s"
|
||||||
|
msgstr "বেস: %s"
|
||||||
|
|
||||||
|
#: sphinx/ext/autodoc.py:925
|
||||||
|
#, python-format
|
||||||
|
msgid "alias of :class:`%s`"
|
||||||
|
msgstr ":class:`%s` এর উপনাম"
|
||||||
|
|
||||||
|
#: sphinx/ext/todo.py:40
|
||||||
|
msgid "Todo"
|
||||||
|
msgstr "অসমাপ্ত কাজ"
|
||||||
|
|
||||||
|
#: sphinx/ext/todo.py:98
|
||||||
|
#, python-format
|
||||||
|
msgid "(The original entry is located in %s, line %d and can be found "
|
||||||
|
msgstr "(%s, %d লাইনে মূল অন্তর্ভুক্তিটি রয়েছে, যা পাওয়া যাবে"
|
||||||
|
|
||||||
|
#: sphinx/ext/todo.py:104
|
||||||
|
msgid "here"
|
||||||
|
msgstr "এখানে"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:138
|
||||||
|
msgid "Attention"
|
||||||
|
msgstr "দৃষ্টি আকর্ষণ"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:139
|
||||||
|
msgid "Caution"
|
||||||
|
msgstr "সতর্কীকরণ"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:140
|
||||||
|
msgid "Danger"
|
||||||
|
msgstr "বিপজ্জনক"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:141
|
||||||
|
msgid "Error"
|
||||||
|
msgstr "ভুল (এরর)"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:142
|
||||||
|
msgid "Hint"
|
||||||
|
msgstr "আভাস"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:143
|
||||||
|
msgid "Important"
|
||||||
|
msgstr "গুরুত্বপূর্ণ"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:144
|
||||||
|
msgid "Note"
|
||||||
|
msgstr "নোট"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:145
|
||||||
|
msgid "See Also"
|
||||||
|
msgstr "আরও দেখুন"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:146
|
||||||
|
msgid "Tip"
|
||||||
|
msgstr "পরামর্শ"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:147
|
||||||
|
msgid "Warning"
|
||||||
|
msgstr "সতর্কতা"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:151
|
||||||
|
#, python-format
|
||||||
|
msgid "New in version %s"
|
||||||
|
msgstr "%s ভার্সনে নতুন"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:152
|
||||||
|
#, python-format
|
||||||
|
msgid "Changed in version %s"
|
||||||
|
msgstr "%s ভার্সনে পরিবর্তিত"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:153
|
||||||
|
#, python-format
|
||||||
|
msgid "Deprecated since version %s"
|
||||||
|
msgstr "%s ভার্সন থেকে ডেপ্রিকেটেড"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:158
|
||||||
|
msgid "keyword"
|
||||||
|
msgstr "কিওয়ার্ড"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:159
|
||||||
|
msgid "operator"
|
||||||
|
msgstr "অপারেটর"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:160
|
||||||
|
msgid "object"
|
||||||
|
msgstr "অবজেক্ট"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:162
|
||||||
|
msgid "statement"
|
||||||
|
msgstr "স্ট্যাটমেন্ট"
|
||||||
|
|
||||||
|
#: sphinx/locale/__init__.py:163
|
||||||
|
msgid "built-in function"
|
||||||
|
msgstr "বিল্ট-ইন ফাংশন"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/defindex.html:2
|
||||||
|
msgid "Overview"
|
||||||
|
msgstr "ভুমিকা"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/defindex.html:11
|
||||||
|
msgid "Indices and tables:"
|
||||||
|
msgstr "ইনডেক্স ও টেবিল সমূহ:"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/defindex.html:14
|
||||||
|
msgid "Complete Table of Contents"
|
||||||
|
msgstr "পূর্ণাঙ্গ সূচীপত্র"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/defindex.html:15
|
||||||
|
msgid "lists all sections and subsections"
|
||||||
|
msgstr "সকল অনুচ্ছেদ সমূহের তালিকা"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/defindex.html:17
|
||||||
|
msgid "search this documentation"
|
||||||
|
msgstr "এই সহায়িকাতে অনুসন্ধা করুন"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/defindex.html:20
|
||||||
|
msgid "quick access to all modules"
|
||||||
|
msgstr "সকল মডিউলে দ্রুত প্রবেশ"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/defindex.html:22
|
||||||
|
msgid "all functions, classes, terms"
|
||||||
|
msgstr "সকল ফাংশন, ক্লাস, টার্ম"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/genindex-single.html:5
|
||||||
|
#, python-format
|
||||||
|
msgid "Index – %(key)s"
|
||||||
|
msgstr "ইনডেক্স – %(key)s"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/genindex-single.html:44
|
||||||
|
#: sphinx/themes/basic/genindex-split.html:14
|
||||||
|
#: sphinx/themes/basic/genindex-split.html:27
|
||||||
|
#: sphinx/themes/basic/genindex.html:54
|
||||||
|
msgid "Full index on one page"
|
||||||
|
msgstr "এক পাতায় সম্পূর্ণ ইনডেক্স"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/genindex-split.html:7
|
||||||
|
msgid "Index pages by letter"
|
||||||
|
msgstr "বর্ণানুসারে ইনডেক্স পাতা"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/genindex-split.html:15
|
||||||
|
msgid "can be huge"
|
||||||
|
msgstr "খুব বড় হতে পারে"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:10
|
||||||
|
msgid "Navigation"
|
||||||
|
msgstr "নেভিগেশন"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:42
|
||||||
|
msgid "Table Of Contents"
|
||||||
|
msgstr "সূচীপত্র"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:48
|
||||||
|
msgid "Previous topic"
|
||||||
|
msgstr "পূর্ববর্তী টপিক"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:50
|
||||||
|
msgid "previous chapter"
|
||||||
|
msgstr "পূর্ববর্তী অধ্যায়"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:53
|
||||||
|
msgid "Next topic"
|
||||||
|
msgstr "পরবর্তী টপিক"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:55
|
||||||
|
msgid "next chapter"
|
||||||
|
msgstr "পরবর্তী অধ্যায়"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:60
|
||||||
|
msgid "This Page"
|
||||||
|
msgstr "এই পাতা"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:63
|
||||||
|
msgid "Show Source"
|
||||||
|
msgstr "সোর্স দেখুন"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:73
|
||||||
|
msgid "Quick search"
|
||||||
|
msgstr "দ্রুত অনুসন্ধান"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:76
|
||||||
|
msgid "Go"
|
||||||
|
msgstr "যান"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:81
|
||||||
|
msgid "Enter search terms or a module, class or function name."
|
||||||
|
msgstr "অনুসন্ধানের জন্য টার্ম, মডিউল, ক্লাস অথবা ফাংশনের নাম দিন।"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:122
|
||||||
|
#, python-format
|
||||||
|
msgid "Search within %(docstitle)s"
|
||||||
|
msgstr "%(docstitle)s এর মধ্যে খুঁজুন"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:131
|
||||||
|
msgid "About these documents"
|
||||||
|
msgstr "এই ডকুমেন্ট সম্পর্কে"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:137
|
||||||
|
#: sphinx/themes/basic/search.html:2
|
||||||
|
#: sphinx/themes/basic/search.html:5
|
||||||
|
msgid "Search"
|
||||||
|
msgstr "অনুসন্ধান"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:140
|
||||||
|
msgid "Copyright"
|
||||||
|
msgstr "কপিরাইট"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:187
|
||||||
|
#: sphinx/themes/scrolls/layout.html:83
|
||||||
|
#, python-format
|
||||||
|
msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s."
|
||||||
|
msgstr "© <a href=\"%(path)s\">কপিরাইট</a> %(copyright)s."
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:189
|
||||||
|
#: sphinx/themes/scrolls/layout.html:85
|
||||||
|
#, python-format
|
||||||
|
msgid "© Copyright %(copyright)s."
|
||||||
|
msgstr "© কপিরাইট %(copyright)s."
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:193
|
||||||
|
#: sphinx/themes/scrolls/layout.html:89
|
||||||
|
#, python-format
|
||||||
|
msgid "Last updated on %(last_updated)s."
|
||||||
|
msgstr "%(last_updated)s সর্বশেষ পরিবর্তন করা হয়েছে।"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/layout.html:196
|
||||||
|
#: sphinx/themes/scrolls/layout.html:92
|
||||||
|
#, python-format
|
||||||
|
msgid "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s."
|
||||||
|
msgstr "<a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s দিয়ে তৈরী।"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/modindex.html:36
|
||||||
|
#: sphinx/themes/scrolls/modindex.html:37
|
||||||
|
msgid "Deprecated"
|
||||||
|
msgstr "ডেপ্রিকেটেড"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/opensearch.xml:4
|
||||||
|
#, python-format
|
||||||
|
msgid "Search %(docstitle)s"
|
||||||
|
msgstr "%(docstitle)s-এ খুঁজুন"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/search.html:9
|
||||||
|
msgid ""
|
||||||
|
"Please activate JavaScript to enable the search\n"
|
||||||
|
" functionality."
|
||||||
|
msgstr ""
|
||||||
|
"অনুসন্ধান করার জন্য অনুগ্রহপূর্বক জাভাস্ক্রিপ্ট \n"
|
||||||
|
" সক্রিয় করুন।"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/search.html:14
|
||||||
|
msgid ""
|
||||||
|
"From here you can search these documents. Enter your search\n"
|
||||||
|
" words into the box below and click \"search\". Note that the search\n"
|
||||||
|
" function will automatically search for all of the words. Pages\n"
|
||||||
|
" containing fewer words won't appear in the result list."
|
||||||
|
msgstr ""
|
||||||
|
"এখান থেকে এই নথিগুলোতে আপনি অনুসন্ধান করতে পারবেন। \n"
|
||||||
|
" আপনার কাঙ্ক্ষিত শব্দসমূহ নিচের বাক্সে লিখুন এবং \"অনুসন্ধান\" বাটনে ক্লিক করুন।\n"
|
||||||
|
" উল্লেখ্য, সকল শব্দসমূহের উপস্থিতি নিয়ে অনুসন্ধান করা হবে। যেসব পাতায় সকল\n"
|
||||||
|
" শব্দ নেই সেগুলো বাদ দেয়া হবে।"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/search.html:21
|
||||||
|
msgid "search"
|
||||||
|
msgstr "খুঁজুন"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/search.html:25
|
||||||
|
#: sphinx/themes/basic/static/searchtools.js:473
|
||||||
|
msgid "Search Results"
|
||||||
|
msgstr "অনুসন্ধানের ফলাফল"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/search.html:27
|
||||||
|
msgid "Your search did not match any results."
|
||||||
|
msgstr "আপনার অনুসন্ধানে কোন ফলাফল পাওয়া যায়নি।"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/changes/frameset.html:5
|
||||||
|
#: sphinx/themes/basic/changes/versionchanges.html:12
|
||||||
|
#, python-format
|
||||||
|
msgid "Changes in Version %(version)s — %(docstitle)s"
|
||||||
|
msgstr "%(version)s — %(docstitle)s-এ পরিবর্তন সমূহ"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/changes/rstsource.html:5
|
||||||
|
#, python-format
|
||||||
|
msgid "%(filename)s — %(docstitle)s"
|
||||||
|
msgstr "%(filename)s — %(docstitle)s"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/changes/versionchanges.html:17
|
||||||
|
#, python-format
|
||||||
|
msgid "Automatically generated list of changes in version %(version)s"
|
||||||
|
msgstr "স্বয়ংক্রিয়ভাবে তৈরী %(version)s-এ পরিবর্তন সমূহের তালিকা।"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/changes/versionchanges.html:18
|
||||||
|
msgid "Library changes"
|
||||||
|
msgstr "লাইব্রেরির পরিবর্তন"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/changes/versionchanges.html:23
|
||||||
|
msgid "C API changes"
|
||||||
|
msgstr "C API পরিবর্তন"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/changes/versionchanges.html:25
|
||||||
|
msgid "Other changes"
|
||||||
|
msgstr "অন্যান্য পরিবর্তন"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/static/doctools.js:138
|
||||||
|
#: sphinx/writers/html.py:462
|
||||||
|
#: sphinx/writers/html.py:467
|
||||||
|
msgid "Permalink to this headline"
|
||||||
|
msgstr "এই শিরোনামের পার্মালিঙ্ক"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/static/doctools.js:144
|
||||||
|
#: sphinx/writers/html.py:80
|
||||||
|
msgid "Permalink to this definition"
|
||||||
|
msgstr "এই সংজ্ঞার পার্মালিঙ্ক"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/static/doctools.js:173
|
||||||
|
msgid "Hide Search Matches"
|
||||||
|
msgstr "অনুসন্ধানের ম্যাচগুলো লুকান"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/static/searchtools.js:274
|
||||||
|
msgid "Searching"
|
||||||
|
msgstr "অনুসন্ধান চলছে"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/static/searchtools.js:279
|
||||||
|
msgid "Preparing search..."
|
||||||
|
msgstr "অনুসন্ধানের প্রস্তুতি চলছে..."
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/static/searchtools.js:352
|
||||||
|
msgid ", in "
|
||||||
|
msgstr ", -"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/static/searchtools.js:475
|
||||||
|
msgid "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories."
|
||||||
|
msgstr "আপনার অনুসন্ধানে কোন ফলাফল পাওয়া যায়নি। আপনার অনুসন্ধানের শব্দগুলোর সঠিক বানান ও বিভাগ নির্বাচন নিশ্চিত করুন।"
|
||||||
|
|
||||||
|
#: sphinx/themes/basic/static/searchtools.js:477
|
||||||
|
#, python-format
|
||||||
|
msgid "Search finished, found %s page(s) matching the search query."
|
||||||
|
msgstr "অনুসন্ধান শেষ হয়েছে, ফলাফলে %s-টি পাতা পাওয়া গেছে।"
|
||||||
|
|
||||||
|
#: sphinx/writers/latex.py:187
|
||||||
|
msgid "Release"
|
||||||
|
msgstr "রিলিজ"
|
||||||
|
|
||||||
|
#: sphinx/writers/latex.py:579
|
||||||
|
msgid "Footnotes"
|
||||||
|
msgstr "পাদটীকা"
|
||||||
|
|
||||||
|
#: sphinx/writers/latex.py:647
|
||||||
|
msgid "continued from previous page"
|
||||||
|
msgstr "পূর্ববর্তী পাতা হতে চলমান"
|
||||||
|
|
||||||
|
#: sphinx/writers/latex.py:652
|
||||||
|
msgid "Continued on next page"
|
||||||
|
msgstr "পরবর্তী পাতাতে চলমান"
|
||||||
|
|
||||||
|
#: sphinx/writers/text.py:166
|
||||||
|
#, python-format
|
||||||
|
msgid "Platform: %s"
|
||||||
|
msgstr "প্লাটফরম: %s"
|
||||||
|
|
||||||
|
#: sphinx/writers/text.py:428
|
||||||
|
msgid "[image]"
|
||||||
|
msgstr "[ছবি]"
|
||||||
|
|
||||||
@@ -279,6 +279,9 @@ epub_copyright = u'%(copyright_str)s'
|
|||||||
|
|
||||||
# The depth of the table of contents in toc.ncx.
|
# The depth of the table of contents in toc.ncx.
|
||||||
#epub_tocdepth = 3
|
#epub_tocdepth = 3
|
||||||
|
|
||||||
|
# Allow duplicate toc entries.
|
||||||
|
#epub_tocdup = True
|
||||||
'''
|
'''
|
||||||
|
|
||||||
INTERSPHINX_CONFIG = '''
|
INTERSPHINX_CONFIG = '''
|
||||||
|
|||||||
+2
-1
@@ -205,8 +205,9 @@ def indexmarkup_role(typ, rawtext, etext, lineno, inliner,
|
|||||||
_amp_re = re.compile(r'(?<!&)&(?![&\s])')
|
_amp_re = re.compile(r'(?<!&)&(?![&\s])')
|
||||||
|
|
||||||
def menusel_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
|
def menusel_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
|
||||||
|
text = utils.unescape(text)
|
||||||
if typ == 'menuselection':
|
if typ == 'menuselection':
|
||||||
text = utils.unescape(text).replace('-->', u'\N{TRIANGULAR BULLET}')
|
text = text.replace('-->', u'\N{TRIANGULAR BULLET}')
|
||||||
spans = _amp_re.split(text)
|
spans = _amp_re.split(text)
|
||||||
|
|
||||||
node = nodes.emphasis(rawtext=rawtext)
|
node = nodes.emphasis(rawtext=rawtext)
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -222,7 +226,10 @@ class DocFieldTransformer(object):
|
|||||||
if is_typefield:
|
if is_typefield:
|
||||||
# filter out only inline nodes; others will result in invalid
|
# filter out only inline nodes; others will result in invalid
|
||||||
# markup being written out
|
# markup being written out
|
||||||
content = filter(lambda n: isinstance(n, nodes.Inline), content)
|
content = filter(
|
||||||
|
lambda n: isinstance(n, nodes.Inline) or
|
||||||
|
isinstance(n, nodes.Text),
|
||||||
|
content)
|
||||||
if content:
|
if content:
|
||||||
types.setdefault(typename, {})[fieldarg] = content
|
types.setdefault(typename, {})[fieldarg] = content
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
sphinx.util.jsonimpl
|
||||||
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
JSON serializer implementation wrapper.
|
||||||
|
|
||||||
|
:copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
|
||||||
|
:license: BSD, see LICENSE for details.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import UserString
|
||||||
|
|
||||||
|
try:
|
||||||
|
import json
|
||||||
|
JSONEncoder = json.JSONEncoder
|
||||||
|
except ImportError:
|
||||||
|
try:
|
||||||
|
import simplejson as json
|
||||||
|
JSONEncoder = json.JSONEncoder
|
||||||
|
except ImportError:
|
||||||
|
json = None
|
||||||
|
JSONEncoder = object
|
||||||
|
|
||||||
|
|
||||||
|
class SphinxJSONEncoder(JSONEncoder):
|
||||||
|
"""JSONEncoder subclass that forces translation proxies."""
|
||||||
|
def default(self, obj):
|
||||||
|
if isinstance(obj, UserString.UserString):
|
||||||
|
return unicode(obj)
|
||||||
|
return JSONEncoder.default(self, obj)
|
||||||
|
|
||||||
|
|
||||||
|
def dump(obj, fp, *args, **kwds):
|
||||||
|
kwds['cls'] = SphinxJSONEncoder
|
||||||
|
return json.dump(obj, fp, *args, **kwds)
|
||||||
|
|
||||||
|
def dumps(obj, *args, **kwds):
|
||||||
|
kwds['cls'] = SphinxJSONEncoder
|
||||||
|
return json.dumps(obj, *args, **kwds)
|
||||||
|
|
||||||
|
load = json.load
|
||||||
|
loads = json.loads
|
||||||
@@ -250,7 +250,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
'\\label{%s}' % self.idescape(id)
|
'\\label{%s}' % self.idescape(id)
|
||||||
|
|
||||||
def hyperlink(self, id):
|
def hyperlink(self, id):
|
||||||
return '\\hyperref[%s]{' % (self.idescape(id))
|
return '{\\hyperref[%s]{' % (self.idescape(id))
|
||||||
|
|
||||||
def hyperpageref(self, id):
|
def hyperpageref(self, id):
|
||||||
return '\\autopageref*{%s}' % (self.idescape(id))
|
return '\\autopageref*{%s}' % (self.idescape(id))
|
||||||
@@ -1051,9 +1051,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
id = self.curfilestack[-1] + ':' + uri[1:]
|
id = self.curfilestack[-1] + ':' + uri[1:]
|
||||||
self.body.append(self.hyperlink(id))
|
self.body.append(self.hyperlink(id))
|
||||||
if self.builder.config.latex_show_pagerefs:
|
if self.builder.config.latex_show_pagerefs:
|
||||||
self.context.append('} (%s)' % self.hyperpageref(id))
|
self.context.append('}} (%s)' % self.hyperpageref(id))
|
||||||
else:
|
else:
|
||||||
self.context.append('}')
|
self.context.append('}}')
|
||||||
elif uri.startswith('%'):
|
elif uri.startswith('%'):
|
||||||
# references to documents or labels inside documents
|
# references to documents or labels inside documents
|
||||||
hashindex = uri.find('#')
|
hashindex = uri.find('#')
|
||||||
@@ -1067,12 +1067,12 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
if len(node) and hasattr(node[0], 'attributes') and \
|
if len(node) and hasattr(node[0], 'attributes') and \
|
||||||
'std-term' in node[0].get('classes', []):
|
'std-term' in node[0].get('classes', []):
|
||||||
# don't add a pageref for glossary terms
|
# don't add a pageref for glossary terms
|
||||||
self.context.append('}')
|
self.context.append('}}')
|
||||||
else:
|
else:
|
||||||
if self.builder.config.latex_show_pagerefs:
|
if self.builder.config.latex_show_pagerefs:
|
||||||
self.context.append('} (%s)' % self.hyperpageref(id))
|
self.context.append('}} (%s)' % self.hyperpageref(id))
|
||||||
else:
|
else:
|
||||||
self.context.append('}')
|
self.context.append('}}')
|
||||||
elif uri.startswith('@token'):
|
elif uri.startswith('@token'):
|
||||||
if self.in_production_list:
|
if self.in_production_list:
|
||||||
self.body.append('\\token{')
|
self.body.append('\\token{')
|
||||||
|
|||||||
+16
-14
@@ -97,21 +97,23 @@ Inline markup
|
|||||||
|
|
||||||
*Generic inline markup*
|
*Generic inline markup*
|
||||||
|
|
||||||
* :command:`command`
|
Adding \n to test unescaping.
|
||||||
* :dfn:`dfn`
|
|
||||||
* :guilabel:`guilabel with &accelerator`
|
* :command:`command\\n`
|
||||||
* :kbd:`kbd`
|
* :dfn:`dfn\\n`
|
||||||
* :mailheader:`mailheader`
|
* :guilabel:`guilabel with &accelerator and \\n`
|
||||||
* :makevar:`makevar`
|
* :kbd:`kbd\\n`
|
||||||
* :manpage:`manpage`
|
* :mailheader:`mailheader\\n`
|
||||||
* :mimetype:`mimetype`
|
* :makevar:`makevar\\n`
|
||||||
* :newsgroup:`newsgroup`
|
* :manpage:`manpage\\n`
|
||||||
* :program:`program`
|
* :mimetype:`mimetype\\n`
|
||||||
* :regexp:`regexp`
|
* :newsgroup:`newsgroup\\n`
|
||||||
* :menuselection:`File --> Close`
|
* :program:`program\\n`
|
||||||
|
* :regexp:`regexp\\n`
|
||||||
|
* :menuselection:`File --> Close\\n`
|
||||||
* :menuselection:`&File --> &Print`
|
* :menuselection:`&File --> &Print`
|
||||||
* :file:`a/{varpart}/b`
|
* :file:`a/{varpart}/b\\n`
|
||||||
* :samp:`print {i}`
|
* :samp:`print {i}\\n`
|
||||||
|
|
||||||
*Linking inline markup*
|
*Linking inline markup*
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ def teardown_module():
|
|||||||
def test_pickle(app):
|
def test_pickle(app):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
|
|
||||||
|
@with_app(buildername='json')
|
||||||
|
def test_json(app):
|
||||||
|
app.builder.build_all()
|
||||||
|
|
||||||
@with_app(buildername='linkcheck')
|
@with_app(buildername='linkcheck')
|
||||||
def test_linkcheck(app):
|
def test_linkcheck(app):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
|
|||||||
+171
-158
@@ -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,183 +50,197 @@ 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']", ''),
|
||||||
".//img[@src='_images/img1.png']": '',
|
(".//img[@src='_images/img1.png']", ''),
|
||||||
".//img[@src='_images/simg.png']": '',
|
(".//img[@src='_images/simg.png']", ''),
|
||||||
".//object[@data='_images/svgimg.svg']": '',
|
(".//object[@data='_images/svgimg.svg']", ''),
|
||||||
".//embed[@src='_images/svgimg.svg']": '',
|
(".//embed[@src='_images/svgimg.svg']", ''),
|
||||||
},
|
],
|
||||||
'subdir/images.html': {
|
'subdir/images.html': [
|
||||||
".//img[@src='../_images/img1.png']": '',
|
(".//img[@src='../_images/img1.png']", ''),
|
||||||
".//img[@src='../_images/rimg.png']": '',
|
(".//img[@src='../_images/rimg.png']", ''),
|
||||||
},
|
],
|
||||||
'subdir/includes.html': {
|
'subdir/includes.html': [
|
||||||
".//a[@href='../_downloads/img.png']": '',
|
(".//a[@href='../_downloads/img.png']", ''),
|
||||||
".//img[@src='../_images/img.png']": '',
|
(".//img[@src='../_images/img.png']", ''),
|
||||||
".//p": 'This is an include file.',
|
(".//p", 'This is an include file.'),
|
||||||
},
|
],
|
||||||
'includes.html': {
|
'includes.html': [
|
||||||
".//pre": u'Max Strauß',
|
(".//pre", u'Max Strauß'),
|
||||||
".//a[@href='_downloads/img.png']": '',
|
(".//a[@href='_downloads/img.png']", ''),
|
||||||
".//a[@href='_downloads/img1.png']": '',
|
(".//a[@href='_downloads/img1.png']", ''),
|
||||||
".//pre": u'"quotes"',
|
(".//pre", u'"quotes"'),
|
||||||
".//pre": u"'included'",
|
(".//pre", u"'included'"),
|
||||||
},
|
],
|
||||||
'autodoc.html': {
|
'autodoc.html': [
|
||||||
".//dt[@id='test_autodoc.Class']": '',
|
(".//dt[@id='test_autodoc.Class']", ''),
|
||||||
".//dt[@id='test_autodoc.function']/em": r'\*\*kwds',
|
(".//dt[@id='test_autodoc.function']/em", r'\*\*kwds'),
|
||||||
".//dd/p": r'Return spam\.',
|
(".//dd/p", r'Return spam\.'),
|
||||||
},
|
],
|
||||||
'extapi.html': {
|
'extapi.html': [
|
||||||
".//strong": 'from function: Foo',
|
(".//strong", 'from function: Foo'),
|
||||||
".//strong": 'from class: Bar',
|
(".//strong", 'from class: Bar'),
|
||||||
},
|
],
|
||||||
'markup.html': {
|
'markup.html': [
|
||||||
".//title": 'set by title directive',
|
(".//title", 'set by title directive'),
|
||||||
".//p/em": 'Section author: Georg Brandl',
|
(".//p/em", 'Section author: Georg Brandl'),
|
||||||
".//p/em": 'Module author: Georg Brandl',
|
(".//p/em", 'Module author: Georg Brandl'),
|
||||||
# created by the meta directive
|
# created by the meta directive
|
||||||
".//meta[@name='author'][@content='Me']": '',
|
(".//meta[@name='author'][@content='Me']", ''),
|
||||||
".//meta[@name='keywords'][@content='docs, sphinx']": '',
|
(".//meta[@name='keywords'][@content='docs, sphinx']", ''),
|
||||||
# a label created by ``.. _label:``
|
# a label created by ``.. _label:``
|
||||||
".//div[@id='label']": '',
|
(".//div[@id='label']", ''),
|
||||||
# code with standard code blocks
|
# code with standard code blocks
|
||||||
".//pre": '^some code$',
|
(".//pre", '^some code$'),
|
||||||
# an option list
|
# an option list
|
||||||
".//span[@class='option']": '--help',
|
(".//span[@class='option']", '--help'),
|
||||||
# admonitions
|
# admonitions
|
||||||
".//p[@class='first admonition-title']": 'My Admonition',
|
(".//p[@class='first admonition-title']", 'My Admonition'),
|
||||||
".//p[@class='last']": 'Note text.',
|
(".//p[@class='last']", 'Note text.'),
|
||||||
".//p[@class='last']": 'Warning text.',
|
(".//p[@class='last']", 'Warning text.'),
|
||||||
# inline markup
|
# inline markup
|
||||||
".//li/strong": '^command$',
|
(".//li/strong", r'^command\\n$'),
|
||||||
".//li/strong": '^program$',
|
(".//li/strong", r'^program\\n$'),
|
||||||
".//li/em": '^dfn$',
|
(".//li/em", r'^dfn\\n$'),
|
||||||
".//li/tt/span[@class='pre']": '^kbd$',
|
(".//li/tt/span[@class='pre']", r'^kbd\\n$'),
|
||||||
".//li/em": u'File \N{TRIANGULAR BULLET} Close',
|
(".//li/em", u'File \N{TRIANGULAR BULLET} Close'),
|
||||||
".//li/tt/span[@class='pre']": '^a/$',
|
(".//li/tt/span[@class='pre']", '^a/$'),
|
||||||
".//li/tt/em/span[@class='pre']": '^varpart$',
|
(".//li/tt/em/span[@class='pre']", '^varpart$'),
|
||||||
".//li/tt/em/span[@class='pre']": '^i$',
|
(".//li/tt/em/span[@class='pre']", '^i$'),
|
||||||
".//a[@href='http://www.python.org/dev/peps/pep-0008']"
|
(".//a[@href='http://www.python.org/dev/peps/pep-0008']"
|
||||||
"[@class='pep reference external']/strong": 'PEP 8',
|
"[@class='pep reference external']/strong", 'PEP 8'),
|
||||||
".//a[@href='http://tools.ietf.org/html/rfc1.html']"
|
(".//a[@href='http://tools.ietf.org/html/rfc1.html']"
|
||||||
"[@class='rfc reference external']/strong": 'RFC 1',
|
"[@class='rfc reference external']/strong", 'RFC 1'),
|
||||||
".//a[@href='objects.html#envvar-HOME']"
|
(".//a[@href='objects.html#envvar-HOME']"
|
||||||
"[@class='reference internal']/tt/span[@class='pre']": 'HOME',
|
"[@class='reference internal']/tt/span[@class='pre']", 'HOME'),
|
||||||
".//a[@href='#with']"
|
(".//a[@href='#with']"
|
||||||
"[@class='reference internal']/tt/span[@class='pre']": '^with$',
|
"[@class='reference internal']/tt/span[@class='pre']", '^with$'),
|
||||||
".//a[@href='#grammar-token-try_stmt']"
|
(".//a[@href='#grammar-token-try_stmt']"
|
||||||
"[@class='reference internal']/tt/span": '^statement$',
|
"[@class='reference internal']/tt/span", '^statement$'),
|
||||||
".//a[@href='subdir/includes.html']"
|
(".//a[@href='subdir/includes.html']"
|
||||||
"[@class='reference internal']/em": 'Including in subdir',
|
"[@class='reference internal']/em", 'Including in subdir'),
|
||||||
".//a[@href='objects.html#cmdoption-python-c']"
|
(".//a[@href='objects.html#cmdoption-python-c']"
|
||||||
"[@class='reference internal']/em": 'Python -c option',
|
"[@class='reference internal']/em", 'Python -c option'),
|
||||||
# abbreviations
|
# abbreviations
|
||||||
".//abbr[@title='abbreviation']": '^abbr$',
|
(".//abbr[@title='abbreviation']", '^abbr$'),
|
||||||
# version stuff
|
# version stuff
|
||||||
".//span[@class='versionmodified']": 'New in version 0.6',
|
(".//span[@class='versionmodified']", 'New in version 0.6'),
|
||||||
# footnote reference
|
# footnote reference
|
||||||
".//a[@class='footnote-reference']": r'\[1\]',
|
(".//a[@class='footnote-reference']", r'\[1\]'),
|
||||||
# created by reference lookup
|
# created by reference lookup
|
||||||
".//a[@href='contents.html#ref1']": '',
|
(".//a[@href='contents.html#ref1']", ''),
|
||||||
# ``seealso`` directive
|
# ``seealso`` directive
|
||||||
".//div/p[@class='first admonition-title']": 'See also',
|
(".//div/p[@class='first admonition-title']", 'See also'),
|
||||||
# a ``hlist`` directive
|
# a ``hlist`` directive
|
||||||
".//table[@class='hlist']/tr/td/ul/li": '^This$',
|
(".//table[@class='hlist']/tr/td/ul/li", '^This$'),
|
||||||
# a ``centered`` directive
|
# a ``centered`` directive
|
||||||
".//p[@class='centered']/strong": 'LICENSE',
|
(".//p[@class='centered']/strong", 'LICENSE'),
|
||||||
# a glossary
|
# a glossary
|
||||||
".//dl/dt[@id='term-boson']": 'boson',
|
(".//dl/dt[@id='term-boson']", 'boson'),
|
||||||
# a production list
|
# a production list
|
||||||
".//pre/strong": 'try_stmt',
|
(".//pre/strong", 'try_stmt'),
|
||||||
".//pre/a[@href='#grammar-token-try1_stmt']/tt/span": 'try1_stmt',
|
(".//pre/a[@href='#grammar-token-try1_stmt']/tt/span", 'try1_stmt'),
|
||||||
# tests for ``only`` directive
|
# tests for ``only`` directive
|
||||||
".//p": 'A global substitution.',
|
(".//p", 'A global substitution.'),
|
||||||
".//p": 'In HTML.',
|
(".//p", 'In HTML.'),
|
||||||
".//p": 'In both.',
|
(".//p", 'In both.'),
|
||||||
".//p": 'Always present',
|
(".//p", 'Always present'),
|
||||||
},
|
],
|
||||||
'objects.html': {
|
'objects.html': [
|
||||||
".//dt[@id='mod.Cls.meth1']": '',
|
(".//dt[@id='mod.Cls.meth1']", ''),
|
||||||
".//dt[@id='errmod.Error']": '',
|
(".//dt[@id='errmod.Error']", ''),
|
||||||
".//a[@href='#mod.Cls'][@class='reference internal']": '',
|
(".//a[@href='#mod.Cls'][@class='reference internal']", ''),
|
||||||
".//dl[@class='userdesc']": '',
|
(".//dl[@class='userdesc']", ''),
|
||||||
".//dt[@id='userdesc-myobj']": '',
|
(".//dt[@id='userdesc-myobj']", ''),
|
||||||
".//a[@href='#userdesc-myobj']": '',
|
(".//a[@href='#userdesc-myobj']", ''),
|
||||||
# C references
|
# C references
|
||||||
".//span[@class='pre']": 'CFunction()',
|
(".//span[@class='pre']", 'CFunction()'),
|
||||||
".//a[@href='#Sphinx_DoSomething']": '',
|
(".//a[@href='#Sphinx_DoSomething']", ''),
|
||||||
".//a[@href='#SphinxStruct.member']": '',
|
(".//a[@href='#SphinxStruct.member']", ''),
|
||||||
".//a[@href='#SPHINX_USE_PYTHON']": '',
|
(".//a[@href='#SPHINX_USE_PYTHON']", ''),
|
||||||
".//a[@href='#SphinxType']": '',
|
(".//a[@href='#SphinxType']", ''),
|
||||||
".//a[@href='#sphinx_global']": '',
|
(".//a[@href='#sphinx_global']", ''),
|
||||||
# reference from old C markup extension
|
# reference from old C markup extension
|
||||||
".//a[@href='#Sphinx_Func']": '',
|
(".//a[@href='#Sphinx_Func']", ''),
|
||||||
# test global TOC created by toctree()
|
# test global TOC created by toctree()
|
||||||
".//ul[@class='current']/li[@class='toctree-l1 current']/a[@href='']":
|
(".//ul[@class='current']/li[@class='toctree-l1 current']/a[@href='']",
|
||||||
'Testing object descriptions',
|
'Testing object descriptions'),
|
||||||
".//li[@class='toctree-l1']/a[@href='markup.html']":
|
(".//li[@class='toctree-l1']/a[@href='markup.html']",
|
||||||
'Testing various markup',
|
'Testing various markup'),
|
||||||
# custom sidebar
|
# custom sidebar
|
||||||
".//h4": 'Custom sidebar',
|
(".//h4", 'Custom sidebar'),
|
||||||
},
|
# docfields
|
||||||
'contents.html': {
|
(".//td[@class='field-body']/ul/li/strong", '^moo$'),
|
||||||
".//meta[@name='hc'][@content='hcval']": '',
|
(".//td[@class='field-body']/ul/li/strong",
|
||||||
".//meta[@name='hc_co'][@content='hcval_co']": '',
|
tail_check(r'\(Moo\) .* Moo')),
|
||||||
".//meta[@name='testopt'][@content='testoverride']": '',
|
],
|
||||||
".//td[@class='label']": r'\[Ref1\]',
|
'contents.html': [
|
||||||
".//td[@class='label']": '',
|
(".//meta[@name='hc'][@content='hcval']", ''),
|
||||||
".//li[@class='toctree-l1']/a": 'Testing various markup',
|
(".//meta[@name='hc_co'][@content='hcval_co']", ''),
|
||||||
".//li[@class='toctree-l2']/a": 'Inline markup',
|
(".//meta[@name='testopt'][@content='testoverride']", ''),
|
||||||
".//title": 'Sphinx <Tests>',
|
(".//td[@class='label']", r'\[Ref1\]'),
|
||||||
".//div[@class='footer']": 'Georg Brandl & Team',
|
(".//td[@class='label']", ''),
|
||||||
".//a[@href='http://python.org/']"
|
(".//li[@class='toctree-l1']/a", 'Testing various markup'),
|
||||||
"[@class='reference external']": '',
|
(".//li[@class='toctree-l2']/a", 'Inline markup'),
|
||||||
".//li/a[@href='genindex.html']/em": 'Index',
|
(".//title", 'Sphinx <Tests>'),
|
||||||
".//li/a[@href='py-modindex.html']/em": 'Module Index',
|
(".//div[@class='footer']", 'Georg Brandl & Team'),
|
||||||
".//li/a[@href='search.html']/em": 'Search Page',
|
(".//a[@href='http://python.org/']"
|
||||||
|
"[@class='reference external']", ''),
|
||||||
|
(".//li/a[@href='genindex.html']/em", 'Index'),
|
||||||
|
(".//li/a[@href='py-modindex.html']/em", 'Module Index'),
|
||||||
|
(".//li/a[@href='search.html']/em", 'Search Page'),
|
||||||
# custom sidebar only for contents
|
# custom sidebar only for contents
|
||||||
".//h4": 'Contents sidebar',
|
(".//h4", 'Contents sidebar'),
|
||||||
},
|
],
|
||||||
'bom.html': {
|
'bom.html': [
|
||||||
".//title": " File with UTF-8 BOM",
|
(".//title", " File with UTF-8 BOM"),
|
||||||
},
|
],
|
||||||
'extensions.html': {
|
'extensions.html': [
|
||||||
".//a[@href='http://python.org/dev/']": "http://python.org/dev/",
|
(".//a[@href='http://python.org/dev/']", "http://python.org/dev/"),
|
||||||
".//a[@href='http://bugs.python.org/issue1000']": "issue 1000",
|
(".//a[@href='http://bugs.python.org/issue1000']", "issue 1000"),
|
||||||
".//a[@href='http://bugs.python.org/issue1042']": "explicit caption",
|
(".//a[@href='http://bugs.python.org/issue1042']", "explicit caption"),
|
||||||
},
|
],
|
||||||
'_static/statictmpl.html': {
|
'_static/statictmpl.html': [
|
||||||
".//project": 'Sphinx <Tests>',
|
(".//project", 'Sphinx <Tests>'),
|
||||||
},
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
if pygments:
|
if pygments:
|
||||||
HTML_XPATH['includes.html'].update({
|
HTML_XPATH['includes.html'].extend([
|
||||||
".//pre/span[@class='s']": u'üöä',
|
(".//pre/span[@class='s']", u'üöä'),
|
||||||
".//div[@class='inc-pyobj1 highlight-text']//pre":
|
(".//div[@class='inc-pyobj1 highlight-text']//pre",
|
||||||
r'^class Foo:\n pass\n\s*$',
|
r'^class Foo:\n pass\n\s*$'),
|
||||||
".//div[@class='inc-pyobj2 highlight-text']//pre":
|
(".//div[@class='inc-pyobj2 highlight-text']//pre",
|
||||||
r'^ def baz\(\):\n pass\n\s*$',
|
r'^ def baz\(\):\n pass\n\s*$'),
|
||||||
".//div[@class='inc-lines highlight-text']//pre":
|
(".//div[@class='inc-lines highlight-text']//pre",
|
||||||
r'^class Foo:\n pass\nclass Bar:\n$',
|
r'^class Foo:\n pass\nclass Bar:\n$'),
|
||||||
".//div[@class='inc-startend highlight-text']//pre":
|
(".//div[@class='inc-startend highlight-text']//pre",
|
||||||
ur'^foo = u"Including Unicode characters: üöä"\n$',
|
ur'^foo = u"Including Unicode characters: üöä"\n$'),
|
||||||
".//div[@class='inc-preappend highlight-text']//pre":
|
(".//div[@class='inc-preappend highlight-text']//pre",
|
||||||
r'(?m)^START CODE$',
|
r'(?m)^START CODE$'),
|
||||||
".//div[@class='inc-pyobj-dedent highlight-python']//span":
|
(".//div[@class='inc-pyobj-dedent highlight-python']//span",
|
||||||
r'def',
|
r'def'),
|
||||||
".//div[@class='inc-tab3 highlight-text']//pre":
|
(".//div[@class='inc-tab3 highlight-text']//pre",
|
||||||
r'-| |-',
|
r'-| |-'),
|
||||||
".//div[@class='inc-tab8 highlight-python']//pre":
|
(".//div[@class='inc-tab8 highlight-python']//pre",
|
||||||
r'-| |-',
|
r'-| |-'),
|
||||||
})
|
])
|
||||||
HTML_XPATH['subdir/includes.html'].update({
|
HTML_XPATH['subdir/includes.html'].extend([
|
||||||
".//pre/span": 'line 1',
|
(".//pre/span", 'line 1'),
|
||||||
".//pre/span": 'line 2',
|
(".//pre/span", 'line 2'),
|
||||||
})
|
])
|
||||||
|
|
||||||
class NslessParser(ET.XMLParser):
|
class NslessParser(ET.XMLParser):
|
||||||
"""XMLParser that throws away namespaces in tag names."""
|
"""XMLParser that throws away namespaces in tag names."""
|
||||||
@@ -285,14 +298,14 @@ 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()
|
||||||
parser.entity.update(htmlentitydefs.entitydefs)
|
parser.entity.update(htmlentitydefs.entitydefs)
|
||||||
etree = ET.parse(os.path.join(app.outdir, fname), parser)
|
etree = ET.parse(os.path.join(app.outdir, fname), parser)
|
||||||
for path, check in paths.iteritems():
|
for path, check in paths:
|
||||||
yield check_xpath, etree, fname, path, check
|
yield check_xpath, etree, fname, path, check
|
||||||
|
|
||||||
check_static_entries(app.builder.outdir)
|
check_static_entries(app.builder.outdir)
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,10 @@ def test_read_inventory_v2():
|
|||||||
def test_missing_reference(tempdir, app):
|
def test_missing_reference(tempdir, app):
|
||||||
inv_file = tempdir / 'inventory'
|
inv_file = tempdir / 'inventory'
|
||||||
write_file(inv_file, inventory_v2)
|
write_file(inv_file, inventory_v2)
|
||||||
app.config.intersphinx_mapping = {'http://docs.python.org/': inv_file}
|
app.config.intersphinx_mapping = {
|
||||||
|
'http://docs.python.org/': inv_file,
|
||||||
|
'py3k': ('http://docs.python.org/py3k/', inv_file),
|
||||||
|
}
|
||||||
app.config.intersphinx_cache_limit = 0
|
app.config.intersphinx_cache_limit = 0
|
||||||
|
|
||||||
# load the inventory and check if it's done correctly
|
# load the inventory and check if it's done correctly
|
||||||
@@ -91,7 +94,7 @@ def test_missing_reference(tempdir, app):
|
|||||||
('foo', '2.0', 'http://docs.python.org/foo.html#module-module2', '-')
|
('foo', '2.0', 'http://docs.python.org/foo.html#module-module2', '-')
|
||||||
|
|
||||||
# create fake nodes and check referencing
|
# create fake nodes and check referencing
|
||||||
contnode = nodes.emphasis('foo')
|
contnode = nodes.emphasis('foo', 'foo')
|
||||||
refnode = addnodes.pending_xref('')
|
refnode = addnodes.pending_xref('')
|
||||||
refnode['reftarget'] = 'module1.func'
|
refnode['reftarget'] = 'module1.func'
|
||||||
refnode['reftype'] = 'func'
|
refnode['reftype'] = 'func'
|
||||||
@@ -101,7 +104,7 @@ def test_missing_reference(tempdir, app):
|
|||||||
assert isinstance(rn, nodes.reference)
|
assert isinstance(rn, nodes.reference)
|
||||||
assert rn['refuri'] == 'http://docs.python.org/sub/foo.html#module1.func'
|
assert rn['refuri'] == 'http://docs.python.org/sub/foo.html#module1.func'
|
||||||
assert rn['reftitle'] == '(in foo v2.0)'
|
assert rn['reftitle'] == '(in foo v2.0)'
|
||||||
assert rn[0] is contnode
|
assert rn[0].astext() == 'module1.func'
|
||||||
|
|
||||||
# create unresolvable nodes and check None return value
|
# create unresolvable nodes and check None return value
|
||||||
refnode['reftype'] = 'foo'
|
refnode['reftype'] = 'foo'
|
||||||
@@ -110,3 +113,27 @@ def test_missing_reference(tempdir, app):
|
|||||||
refnode['reftype'] = 'function'
|
refnode['reftype'] = 'function'
|
||||||
refnode['reftarget'] = 'foo.func'
|
refnode['reftarget'] = 'foo.func'
|
||||||
assert missing_reference(app, app.env, refnode, contnode) is None
|
assert missing_reference(app, app.env, refnode, contnode) is None
|
||||||
|
|
||||||
|
# check handling of prefixes
|
||||||
|
|
||||||
|
# prefix given, target found: prefix is stripped
|
||||||
|
refnode['reftype'] = 'mod'
|
||||||
|
refnode['reftarget'] = 'py3k:module2'
|
||||||
|
rn = missing_reference(app, app.env, refnode, contnode)
|
||||||
|
assert rn[0].astext() == 'module2'
|
||||||
|
|
||||||
|
# prefix given, target not found and nonexplicit title: prefix is stripped
|
||||||
|
refnode['reftarget'] = 'py3k:unknown'
|
||||||
|
refnode['refexplicit'] = False
|
||||||
|
contnode[0] = nodes.Text('py3k:unknown')
|
||||||
|
rn = missing_reference(app, app.env, refnode, contnode)
|
||||||
|
assert rn is None
|
||||||
|
assert contnode[0].astext() == 'unknown'
|
||||||
|
|
||||||
|
# prefix given, target not found and explicit title: nothing is changed
|
||||||
|
refnode['reftarget'] = 'py3k:unknown'
|
||||||
|
refnode['refexplicit'] = True
|
||||||
|
contnode[0] = nodes.Text('py3k:unknown')
|
||||||
|
rn = missing_reference(app, app.env, refnode, contnode)
|
||||||
|
assert rn is None
|
||||||
|
assert contnode[0].astext() == 'py3k:unknown'
|
||||||
|
|||||||
Reference in New Issue
Block a user