diff options
| author | Georg Brandl <georg@python.org> | 2009-01-03 12:15:59 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2009-01-03 12:15:59 +0100 |
| commit | 8173958ad6fa425f5fa608a533f5ec0a61ed4946 (patch) | |
| tree | 572425192ae7573afcdb09f18e318be14d7a4122 | |
| parent | 3bf92166f17abdaff79fa7b58fb193cc54199f35 (diff) | |
| parent | 4bd28c3d1ae757869df45839d6fa1b56e692f76a (diff) | |
| download | sphinx-8173958ad6fa425f5fa608a533f5ec0a61ed4946.tar.gz | |
merge in 0.5
77 files changed, 4789 insertions, 3016 deletions
@@ -12,6 +12,7 @@ Other contributors, listed alphabetically, are: * Dave Kuhlman -- original LaTeX writer * Thomas Lamb -- linkcheck builder * Benjamin Peterson -- unittests +* Antonio Valentino -- qthelp builder * Pauli Virtanen -- autodoc improvements * Sebastian Wiesner -- image handling, distutils support @@ -1,3 +1,89 @@ +Release 0.6 (in development) +============================ + +New features added +------------------ + +* Incompatible changes: + + - Templating now requires the Jinja2 library, which is an enhanced + version of the old Jinja1 engine. Since the syntax and semantic + is largely the same, very few fixes should be necessary in + custom templates. + + - The ``autodoc_skip_member`` event now also gets to decide + whether to skip members whose name starts with underscores. + Previously, these members were always automatically skipped. + Therefore, if you handle this event, add something like this + to your event handler to restore the old behavior:: + + if name.startswith('_'): + return True + +* Markup: + + - Due to popular demand, added a ``:doc:`` role which directly + links to another document without the need of creating a + label to which a ``:ref:`` could link to. + + - #4: Added a ``:download:`` role that marks a non-document file + for inclusion into the HTML output and links to it. + + - The ``toctree`` directive now supports a ``:hidden:`` flag, + which will prevent links from being generated in place of + the directive -- this allows you to define your document + structure, but place the links yourself. + + - #77: If a description environment with info field list only + contains one ``:param:`` entry, no bullet list is generated. + + - #6: Don't generate redundant ``<ul>`` for top-level TOC tree + items, which leads to a visual separation of TOC entries. + + - #23: Added a ``classmethod`` directive along with ``method`` + and ``staticmethod``. + +* Configuration: + + - The new ``html_add_permalinks`` config value can be used to + switch off the generated "paragraph sign" permalinks for each + heading and definition environment. + + - The new ``html_show_sourcelink`` config value can be used to + switch off the links to the reST sources in the sidebar. + + - The default value for ``htmlhelp_basename`` is now the project + title, cleaned up as a filename. + +* Builders: + + - New builder for Qt help collections, by Antonio Valentino. + + - The new ``html_link_suffix`` config value can be used to select + the suffix of generated links between HTML files. + +* New translations: + + - Italian by Sandro Dentella. + +* Extensions and API: + + - Autodoc now handles inner classes and their methods. + + - There is now a ``Sphinx.add_lexer()`` method to be able to use + custom Pygments lexers easily. + +* Other changes: + + - Config overrides for single dict keys can now be given on the + command line. + + - There is now a ``doctest_global_setup`` config value that can + be used to give setup code for all doctests in the documentation. + + - Source links in HTML are now generated with ``rel="nofollow"``. + + Release 0.5.2 (in development) ============================== @@ -18,9 +18,11 @@ included, please mail to `the Google group * Grok: http://grok.zope.org/doc/current/ * IFM: http://fluffybunny.memebot.com/ifm-docs/index.html * Jinja: http://jinja.pocoo.org/2/documentation/ +* MapServer: http://mapserver.osgeo.org/ * Matplotlib: http://matplotlib.sourceforge.net/ * Mayavi: http://code.enthought.com/projects/mayavi/docs/development/html/mayavi * Mixin.com: http://dev.mixin.com/ +* mpmath: http://mpmath.googlecode.com/svn/trunk/doc/build/index.html * NetworkX: http://networkx.lanl.gov/ * NumPy: http://docs.scipy.org/doc/numpy/reference/ * ObjectListView: http://objectlistview.sourceforge.net/python @@ -39,6 +41,6 @@ included, please mail to `the Google group * SymPy: http://docs.sympy.org/ * tinyTiM: http://tinytim.sourceforge.net/docs/2.0/ * TurboGears: http://turbogears.org/2.0/docs/ +* WFront: http://discorporate.us/projects/WFront/ * Zope 3: e.g. http://docs.carduner.net/z3c-tutorial/ -* mpmath: http://mpmath.googlecode.com/svn/trunk/doc/build/index.html * zc.async: http://packages.python.org/zc.async/1.5.0/ @@ -1,6 +1,4 @@ -[extractors] -jinja = sphinx._jinja.babel_extract [python: **.py] -[jinja: **/templates/**.html] -[jinja: **/templates/**.xml] +[jinja2: **/templates/**.html] +[jinja2: **/templates/**.xml] [javascript: **.js] diff --git a/doc/Makefile b/doc/Makefile index cb5fc645..6da1654b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -11,12 +11,12 @@ PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) \ $(SPHINXOPTS) . -.PHONY: help clean html web htmlhelp latex changes linkcheck +.PHONY: help clean html pickle htmlhelp qthelp latex changes linkcheck doctest help: @echo "Please use \`make <target>' where <target> is one of" @echo " html to make standalone HTML files" - @echo " web to make files usable by Sphinx.web" + @echo " pickle to make pickle files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " changes to make an overview over all changed/added/deprecated items" @@ -31,13 +31,15 @@ html: @echo @echo "Build finished. The HTML pages are in _build/html." +text: + mkdir -p _build/text _build/doctrees + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) _build/text + @echo + @echo "Build finished." + pickle: mkdir -p _build/pickle _build/doctrees $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) _build/pickle - @echo - @echo "Build finished; now you can run" - @echo " python -m sphinx.web _build/pickle" - @echo "to start the server." htmlhelp: mkdir -p _build/htmlhelp _build/doctrees @@ -46,6 +48,16 @@ htmlhelp: @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in _build/htmlhelp." +qthelp: + mkdir -p _build/qthelp _build/doctrees + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) _build/qthelp + @echo + @echo "Build finished; now you can run qcollectiongenerator with the" \ + ".qhcp project file in build/qthelp." + @echo "# qcollectiongenerator _build/qthelp/Sphinx.qhcp" + @echo "To view the help collection:" + @echo "# assistant -collectionFile _build/qthelp/Sphinx.qhc" + latex: mkdir -p _build/latex _build/doctrees $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex diff --git a/doc/builders.rst b/doc/builders.rst index 508ab3c5..dd07a96a 100644 --- a/doc/builders.rst +++ b/doc/builders.rst @@ -3,7 +3,7 @@ Available builders ================== -.. module:: sphinx.builder +.. module:: sphinx.builders :synopsis: Available built-in builder classes. These are the built-in Sphinx builders. More builders can be added by @@ -13,6 +13,7 @@ The builder's "name" must be given to the **-b** command-line option of :program:`sphinx-build` to select a builder. +.. module:: sphinx.builders.html .. class:: StandaloneHTMLBuilder This is the standard HTML builder. Its output is a directory with HTML @@ -30,6 +31,7 @@ The builder's "name" must be given to the **-b** command-line option of Its name is ``htmlhelp``. +.. module:: sphinx.builders.latex .. class:: LaTeXBuilder This builder produces a bunch of LaTeX files in the output directory. You @@ -50,6 +52,7 @@ The builder's "name" must be given to the **-b** command-line option of Its name is ``latex``. +.. module:: sphinx.builders.text .. class:: TextBuilder This builder produces a text file for each reST file -- this is almost the @@ -60,6 +63,7 @@ The builder's "name" must be given to the **-b** command-line option of .. versionadded:: 0.4 +.. currentmodule:: sphinx.builders.html .. class:: SerializingHTMLBuilder This builder uses a module that implements the Python serialization API @@ -135,6 +139,7 @@ The builder's "name" must be given to the **-b** command-line option of .. versionadded:: 0.5 +.. module:: sphinx.builders.changes .. class:: ChangesBuilder This builder produces an HTML overview of all :dir:`versionadded`, @@ -144,6 +149,7 @@ The builder's "name" must be given to the **-b** command-line option of Its name is ``changes``. +.. module:: sphinx.builders.linkcheck .. class:: CheckExternalLinksBuilder This builder scans all documents for external links, tries to open them with diff --git a/doc/concepts.rst b/doc/concepts.rst index ca7aaf7c..379888ff 100644 --- a/doc/concepts.rst +++ b/doc/concepts.rst @@ -85,6 +85,18 @@ tables of contents. The ``toctree`` directive is the central element. This includes first all documents whose names start with ``intro``, then all documents in the ``recipe`` folder, then all remaining documents (except the one containing the directive, of course.) [#]_ + + You can also give a "hidden" option to the directive, like this:: + + .. toctree:: + :hidden: + + doc_1 + doc_2 + + This will still notify Sphinx of the document hierarchy, but not insert links + into the document at the location of the directive -- this makes sense if you + intend to insert these links yourself, in a different style. In the end, all documents in the :term:`source directory` (or subdirectories) must occur in some ``toctree`` directive; Sphinx will emit a warning if it @@ -100,6 +112,9 @@ tables of contents. The ``toctree`` directive is the central element. .. versionchanged:: 0.3 Added "globbing" option. + .. versionchanged:: 0.6 + Added "hidden" option. + Special names ------------- diff --git a/doc/config.rst b/doc/config.rst index e6af9aae..dd25cf22 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -22,8 +22,8 @@ Important points to note: * The term "fully-qualified name" refers to a string that names an importable Python object inside a module; for example, the FQN - ``"sphinx.builder.Builder"`` means the ``Builder`` class in the - ``sphinx.builder`` module. + ``"sphinx.builders.Builder"`` means the ``Builder`` class in the + ``sphinx.builders`` module. * Remember that document names use ``/`` as the path separator and don't contain the file name extension. @@ -205,6 +205,7 @@ Project information * ``en`` -- English * ``es`` -- Spanish * ``fr`` -- French + * ``it`` -- Italian * ``nl`` -- Dutch * ``pl`` -- Polish * ``pt_BR`` -- Brazilian Portuguese @@ -332,6 +333,15 @@ that use Sphinx' HTMLWriter class. If true, *SmartyPants* will be used to convert quotes and dashes to typographically correct entities. Default: ``True``. +.. confval:: html_add_permalinks + + If true, Sphinx will add "permalinks" for each heading and description + environment as paragraph signs that become visible when the mouse hovers over + them. Default: ``True``. + + .. versionadded:: 0.6 + Previously, this was always activated. + .. confval:: html_sidebars Custom sidebar templates, must be a dictionary that maps document names to @@ -399,6 +409,13 @@ that use Sphinx' HTMLWriter class. will only display the titles of matching documents, and no excerpt from the matching contents. +.. confval:: html_show_sourcelink + + If true (and :confval:`html_copy_source` is true as well), links to the + reST sources will be added to the sidebar. The default is ``True``. + + .. versionadded:: 0.6 + .. confval:: html_use_opensearch If nonempty, an `OpenSearch <http://opensearch.org>` description file will be @@ -415,10 +432,18 @@ that use Sphinx' HTMLWriter class. .. versionadded:: 0.4 +.. confval:: html_link_suffix + + Suffix for generated links to HTML files. The default is whatever + :confval:`html_file_suffix` is set to; it can be set differently (e.g. to + support different web server setups). + + .. versionadded:: 0.6 + .. confval:: html_translator_class A string with the fully-qualified name of a HTML Translator class, that is, a - subclass of Sphinx' :class:`~sphinx.htmlwriter.HTMLTranslator`, that is used + subclass of Sphinx' :class:`~sphinx.writers.html.HTMLTranslator`, that is used to translate document trees to HTML. Default is ``None`` (use the builtin translator). diff --git a/doc/ext/appapi.rst b/doc/ext/appapi.rst index fcc29e38..3dd5282b 100644 --- a/doc/ext/appapi.rst +++ b/doc/ext/appapi.rst @@ -13,7 +13,7 @@ the following public API: .. method:: Sphinx.add_builder(builder) Register a new builder. *builder* must be a class that inherits from - :class:`~sphinx.builder.Builder`. + :class:`~sphinx.builders.Builder`. .. method:: Sphinx.add_config_value(name, default, rebuild_env) @@ -167,6 +167,13 @@ the following public API: :confval:`the docs for the config value <html_static_path>`. .. versionadded:: 0.5 + +.. method:: Sphinx.add_lexer(alias, lexer) + + Use *lexer*, which must be an instance of a Pygments lexer class, to + highlight code blocks with the given language *alias*. + + .. versionadded:: 0.6 .. method:: Sphinx.connect(event, callback) diff --git a/doc/ext/builderapi.rst b/doc/ext/builderapi.rst index adc41016..5c671f2d 100644 --- a/doc/ext/builderapi.rst +++ b/doc/ext/builderapi.rst @@ -5,7 +5,7 @@ Writing new builders .. todo:: Expand this. -.. currentmodule:: sphinx.builder +.. currentmodule:: sphinx.builders .. class:: Builder @@ -20,7 +20,7 @@ Writing new builders .. automethod:: build_update .. automethod:: build - These methods must be overridden in concrete builder classes: + These methods can be overridden in concrete builder classes: .. automethod:: init .. automethod:: get_outdated_docs @@ -28,3 +28,7 @@ Writing new builders .. automethod:: prepare_writing .. automethod:: write_doc .. automethod:: finish + + Useful helpers: + + .. automethod:: init_templates diff --git a/doc/ext/doctest.rst b/doc/ext/doctest.rst index 9de6ba9e..7117f6a9 100644 --- a/doc/ext/doctest.rst +++ b/doc/ext/doctest.rst @@ -149,6 +149,14 @@ There are also these config values for customizing the doctest extension: A list of directories that will be added to :data:`sys.path` when the doctest builder is used. (Make sure it contains absolute paths.) +.. confval:: doctest_global_setup + + Python code that is treated like it were put in a ``testsetup`` directive for + *every* file that is tested, and for every group. You can use this to + e.g. import modules you will always need in your doctests. + + .. versionadded:: 0.6 + .. confval:: doctest_test_doctest_blocks If this is a nonempty string (the default is ``'default'``), standard reST diff --git a/doc/glossary.rst b/doc/glossary.rst index 6a80ad36..7ec787ff 100644 --- a/doc/glossary.rst +++ b/doc/glossary.rst @@ -6,7 +6,7 @@ Glossary .. glossary:: builder - A class (inheriting from :class:`~sphinx.builder.Builder`) that takes + A class (inheriting from :class:`~sphinx.builders.Builder`) that takes parsed documents and performs an action on them. Normally, builders translate the documents to an output format, but it is also possible to use the builder builders that e.g. check for broken links in the diff --git a/doc/intro.rst b/doc/intro.rst index 47e016b3..7ce9d1fa 100644 --- a/doc/intro.rst +++ b/doc/intro.rst @@ -111,8 +111,12 @@ The :program:`sphinx-build` script has several more options: .. versionadded:: 0.5 **-D** *setting=value* - Override a configuration value set in the :file:`conf.py` file. (The value - must be a string value.) + Override a configuration value set in the :file:`conf.py` file. The value + must be a string or dictionary value. For the latter, supply the setting + name and key like this: ``-D latex_elements.docclass=scrartcl``. + + .. versionchanged:: 0.6 + The value can now be a dictionary value. **-A** *name=value* Make the *name* assigned to *value* in the HTML templates. diff --git a/doc/markup/desc.rst b/doc/markup/desc.rst index 892cdc4a..67605c77 100644 --- a/doc/markup/desc.rst +++ b/doc/markup/desc.rst @@ -205,6 +205,12 @@ The directives are: .. versionadded:: 0.4 +.. directive:: .. classmethod:: name(signature) + + Like :dir:`method`, but indicates that the method is a class method. + + .. versionadded:: 0.6 + .. _signatures: diff --git a/doc/markup/inline.rst b/doc/markup/inline.rst index 5dbd638e..9f8a01a5 100644 --- a/doc/markup/inline.rst +++ b/doc/markup/inline.rst @@ -224,7 +224,50 @@ to labels: Using :role:`ref` is advised over standard reStructuredText links to sections (like ```Section title`_``) because it works across files, when section headings are changed, and for all builders that support cross-references. - + + +Cross-referencing documents +--------------------------- + +.. versionadded:: 0.6 + +There is also a way to directly link to documents: + +.. role:: doc + + Link to the specified document; the document name can be specified in + absolute or relative fashion. For example, if the reference + ``:doc:`parrot``` occurs in the document ``sketches/index``, then the link + refers to ``sketches/parrot``. If the reference is ``:doc:`/people``` or + ``:doc:`../people```, the link refers to ``people``. + + If no explicit link text is given (like usual: ``:doc:`Monty Python members + </people>```), the link caption will be the title of the given document. + + +Referencing downloadable files +------------------------------ + +.. versionadded:: 0.6 + +.. role:: download + + This role lets you link to files within your source tree that are not reST + documents that can be viewed, but files that can be downloaded. + + When you use this role, the referenced file is automatically marked for + inclusion in the output when building (obviously, for HTML output only). + All downloadable files are put into the ``_downloads`` subdirectory of the + output directory; duplicate filenames are handled. + + An example:: + + See :download:`this example script <../example.py>`. + + The given filename is relative to the directory the current source file is + contained in. The ``../example.py`` file will be copied to the output + directory, and a suitable link generated to it. + Other semantic markup --------------------- @@ -330,7 +373,7 @@ in a different style: curly braces to indicate a "variable" part, as in ``:file:``. If you don't need the "variable part" indication, use the standard - ````code```` instead. + ````code```` instead. The following roles generate external links: @@ -351,6 +394,7 @@ The following roles generate external links: Note that there are no special roles for including hyperlinks as you can use the standard reST markup for that purpose. + .. _default-substitutions: Substitutions diff --git a/doc/templating.rst b/doc/templating.rst index 61a8a72b..ff4bdd51 100644 --- a/doc/templating.rst +++ b/doc/templating.rst @@ -19,10 +19,10 @@ No. You have several other options: configuration value accordingly. * You can :ref:`write a custom builder <writing-builders>` that derives from - :class:`~sphinx.builder.StandaloneHTMLBuilder` and calls your template engine + :class:`~sphinx.builders.StandaloneHTMLBuilder` and calls your template engine of choice. -* You can use the :class:`~sphinx.builder.PickleHTMLBuilder` that produces +* You can use the :class:`~sphinx.builders.PickleHTMLBuilder` that produces pickle files with the page contents, and postprocess them using a custom tool, or use them in your Web application. @@ -135,6 +135,10 @@ The following blocks exist in the ``layout`` template: `sidebarrel` The relation links (previous, next document) within the sidebar. +`sidebarsourcelink` + The "Show source" link within the sidebar (normally only shown if this is + enabled by :confval:`html_show_sourcelink`). + `sidebarsearch` The search box within the sidebar. Override this if you want to place some content at the bottom of the sidebar. @@ -36,7 +36,7 @@ are already present, work fine and can be seen "in action" in the Python docs: and inclusion of appropriately formatted docstrings. ''' -requires = ['Pygments>=0.8', 'Jinja>=1.1', 'docutils>=0.4'] +requires = ['Pygments>=0.8', 'Jinja2>=2.0', 'docutils>=0.4'] if sys.version_info < (2, 4): print 'ERROR: Sphinx requires at least Python 2.4 to run.' diff --git a/sphinx/__init__.py b/sphinx/__init__.py index 1dccf1c0..e0d8813f 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -10,10 +10,13 @@ """ import sys +from os import path __revision__ = '$Revision$' -__version__ = '0.5.1+' -__released__ = '0.5.1' +__version__ = '0.6' +__released__ = '0.6 (hg)' + +package_dir = path.abspath(path.dirname(__file__)) def main(argv=sys.argv): @@ -28,17 +31,23 @@ def main(argv=sys.argv): errstr = str(err) if errstr.lower().startswith('no module named'): whichmod = errstr[16:] + hint = '' if whichmod.startswith('docutils'): whichmod = 'Docutils library' elif whichmod.startswith('jinja'): whichmod = 'Jinja library' elif whichmod == 'roman': whichmod = 'roman module (which is distributed with Docutils)' + hint = ('This can happen if you upgraded docutils using\n' + 'easy_install without uninstalling the old version' + 'first.') else: whichmod += ' module' print >>sys.stderr, \ 'Error: The %s cannot be found. Did you install Sphinx '\ 'and its dependencies correctly?' % whichmod + if hint: + print >> sys.stderr, hint return 1 raise return cmdline.main(argv) diff --git a/sphinx/_jinja.py b/sphinx/_jinja.py index 3adf0de8..fba432c4 100644 --- a/sphinx/_jinja.py +++ b/sphinx/_jinja.py @@ -12,6 +12,7 @@ import codecs from os import path +from sphinx import package_dir from sphinx.util import mtimes_of_files from sphinx.application import TemplateBridge @@ -88,7 +89,7 @@ class TranslatorEnvironment(Environment): class BuiltinTemplates(TemplateBridge): def init(self, builder): self.templates = {} - base_templates_path = path.join(path.dirname(__file__), 'templates') + base_templates_path = path.join(package_dir, 'templates') ext_templates_path = [path.join(builder.confdir, dir) for dir in builder.config.templates_path] self.templates_path = [base_templates_path] + ext_templates_path diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py index 6ea47d31..b267913b 100644 --- a/sphinx/addnodes.py +++ b/sphinx/addnodes.py @@ -23,8 +23,12 @@ class desc(nodes.Admonition, nodes.Element): pass class desc_addname(nodes.Part, nodes.Inline, nodes.TextElement): pass # compatibility alias desc_classname = desc_addname -# return type (C); object type, e.g. -> annotation (Python) +# return type (C); object type class desc_type(nodes.Part, nodes.Inline, nodes.TextElement): pass +# -> annotation (Python) +class desc_returns(desc_type): + def astext(self): + return ' -> ' + nodes.TextElement.astext(self) # main name of object class desc_name(nodes.Part, nodes.Inline, nodes.TextElement): pass # argument list @@ -64,6 +68,9 @@ class pending_xref(nodes.Element): pass # compact paragraph -- never makes a <p> class compact_paragraph(nodes.paragraph): pass +# reference to a file to download +class download_reference(nodes.reference): pass + # for the ACKS list class acks(nodes.Element): pass @@ -90,8 +97,9 @@ class meta(nodes.Special, nodes.PreBibliographic, nodes.Element): pass # make them known to docutils. this is needed, because the HTML writer # will choke at some point if these are not added -nodes._add_node_class_names("""index desc desc_content desc_signature desc_type - desc_addname desc_name desc_parameterlist desc_parameter desc_optional +nodes._add_node_class_names("""index desc desc_content desc_signature + desc_type desc_returns desc_addname desc_name desc_parameterlist + desc_parameter desc_optional download_reference centered versionmodified seealso productionlist production toctree pending_xref compact_paragraph highlightlang literal_emphasis glossary acks module start_of_file tabular_col_spec meta""".split()) diff --git a/sphinx/application.py b/sphinx/application.py index ecc2037a..1ad7823f 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -7,7 +7,6 @@ Gracefully adapted from the TextPress system by Armin. - :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -22,7 +21,7 @@ from docutils.parsers.rst import directives, roles import sphinx from sphinx.roles import xfileref_role, innernodetypes from sphinx.config import Config -from sphinx.builder import builtin_builders, StandaloneHTMLBuilder +from sphinx.builders import BUILTIN_BUILDERS from sphinx.directives import desc_directive, target_directive, additional_xref_types from sphinx.environment import SphinxStandaloneReader from sphinx.util.console import bold @@ -77,7 +76,7 @@ class Sphinx(object): confoverrides, status, warning=sys.stderr, freshenv=False): self.next_listener_id = 0 self._listeners = {} - self.builderclasses = builtin_builders.copy() + self.builderclasses = BUILTIN_BUILDERS.copy() self.builder = None self.srcdir = srcdir @@ -125,6 +124,11 @@ class Sphinx(object): buildername))) builderclass = self.builderclasses[buildername] + if isinstance(builderclass, tuple): + # builtin builder + mod, cls = builderclass + builderclass = getattr( + __import__('sphinx.builders.' + mod, None, None, [cls]), cls) self.builder = builderclass(self, freshenv=freshenv) self.emit('builder-inited') @@ -227,8 +231,12 @@ class Sphinx(object): if not hasattr(builder, 'name'): raise ExtensionError('Builder class %s has no "name" attribute' % builder) if builder.name in self.builderclasses: - raise ExtensionError('Builder %r already exists (in module %s)' % ( - builder.name, self.builderclasses[builder.name].__module__)) + if isinstance(self.builderclasses[builder.name], tuple): + raise ExtensionError('Builder %r is a builtin builder' % + builder.name) + else: + raise ExtensionError('Builder %r already exists (in module %s)' % ( + builder.name, self.builderclasses[builder.name].__module__)) self.builderclasses[builder.name] = builder def add_config_value(self, name, default, rebuild_env): @@ -250,11 +258,11 @@ class Sphinx(object): raise ExtensionError('Value for key %r must be a (visit, depart) ' 'function tuple' % key) if key == 'html': - from sphinx.htmlwriter import HTMLTranslator as translator + from sphinx.writers.html import HTMLTranslator as translator elif key == 'latex': - from sphinx.latexwriter import LaTeXTranslator as translator + from sphinx.writers.latex import LaTeXTranslator as translator elif key == 'text': - from sphinx.textwriter import TextTranslator as translator + from sphinx.writers.text import TextTranslator as translator else: # ignore invalid keys for compatibility continue @@ -291,9 +299,16 @@ class Sphinx(object): SphinxStandaloneReader.transforms.append(transform) def add_javascript(self, filename): + from sphinx.builders.html import StandaloneHTMLBuilder StandaloneHTMLBuilder.script_files.append( posixpath.join('_static', filename)) + def add_lexer(self, alias, lexer): + from sphinx.highlighting import lexers + if lexers is None: + return + lexers[alias] = lexer + class TemplateBridge(object): """ diff --git a/sphinx/builder.py b/sphinx/builder.py index 33322d58..13c56e18 100644 --- a/sphinx/builder.py +++ b/sphinx/builder.py @@ -3,1274 +3,26 @@ sphinx.builder ~~~~~~~~~~~~~~ - Builder classes for different output formats. + .. warning:: + + This module is only kept for API compatibility; new code should + import these classes directly from the sphinx.builders package. :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ -import os -import time -import codecs -import shutil -import gettext -import cPickle as pickle -from os import path -from cgi import escape - -from docutils import nodes -from docutils.io import StringOutput, FileOutput, DocTreeInput -from docutils.core import publish_parts -from docutils.utils import new_document -from docutils.frontend import OptionParser -from docutils.readers.doctree import Reader as DoctreeReader - -from sphinx import addnodes, locale, __version__ -from sphinx.util import ensuredir, relative_uri, SEP, os_path, texescape, ustrftime -from sphinx.htmlhelp import build_hhx -from sphinx.htmlwriter import HTMLWriter, HTMLTranslator, SmartyPantsHTMLTranslator -from sphinx.textwriter import TextWriter -from sphinx.latexwriter import LaTeXWriter -from sphinx.environment import BuildEnvironment, NoUri -from sphinx.highlighting import PygmentsBridge -from sphinx.util.console import bold, purple, darkgreen -from sphinx.search import js_index - -try: - import json -except ImportError: - try: - import simplejson as json - except ImportError: - json = None - -# side effect: registers roles and directives -from sphinx import roles -from sphinx import directives - -ENV_PICKLE_FILENAME = 'environment.pickle' -LAST_BUILD_FILENAME = 'last_build' -INVENTORY_FILENAME = 'objects.inv' - - -class Builder(object): - """ - Builds target formats from the reST sources. - """ - - # builder's name, for the -b command line options - name = '' - - def __init__(self, app, env=None, freshenv=False): - self.srcdir = app.srcdir - self.confdir = app.confdir - self.outdir = app.outdir - self.doctreedir = app.doctreedir - if not path.isdir(self.doctreedir): - os.makedirs(self.doctreedir) - - self.app = app - self.warn = app.warn - self.info = app.info - self.config = app.config - - self.load_i18n() - - # images that need to be copied over (source -> dest) - self.images = {} - - # if None, this is set in load_env() - self.env = env - self.freshenv = freshenv - - self.init() - self.load_env() - - # helper methods - - def init(self): - """Load necessary templates and perform initialization.""" - raise NotImplementedError - - def init_templates(self): - # Call this from init() if you need templates. - if self.config.template_bridge: - self.templates = self.app.import_object( - self.config.template_bridge, 'template_bridge setting')() - else: - from sphinx._jinja import BuiltinTemplates - self.templates = BuiltinTemplates() - self.templates.init(self) - - def get_target_uri(self, docname, typ=None): - """ - Return the target URI for a document name (typ can be used to qualify - the link characteristic for individual builders). - """ - raise NotImplementedError - - def get_relative_uri(self, from_, to, typ=None): - """ - Return a relative URI between two source filenames. May raise environment.NoUri - if there's no way to return a sensible URI. - """ - return relative_uri(self.get_target_uri(from_), - self.get_target_uri(to, typ)) - - def get_outdated_docs(self): - """ - Return an iterable of output files that are outdated, or a string describing - what an update build will build. - """ - raise NotImplementedError - - def status_iterator(self, iterable, summary, colorfunc=darkgreen): - l = -1 - for item in iterable: - if l == -1: - self.info(bold(summary), nonl=1) - l = 0 - self.info(colorfunc(item) + ' ', nonl=1) - yield item - if l == 0: - self.info() - - supported_image_types = [] - - def post_process_images(self, doctree): - """ - Pick the best candidate for all image URIs. - """ - for node in doctree.traverse(nodes.image): - if '?' in node['candidates']: - # don't rewrite nonlocal image URIs - continue - if '*' not in node['candidates']: - for imgtype in self.supported_image_types: - candidate = node['candidates'].get(imgtype, None) - if candidate: - break - else: - self.warn('%s:%s: no matching candidate for image URI %r' % - (node.source, getattr(node, 'lineno', ''), node['uri'])) - continue - node['uri'] = candidate - else: - candidate = node['uri'] - if candidate not in self.env.images: - # non-existing URI; let it alone - continue - self.images[candidate] = self.env.images[candidate][1] - - # build methods - - def load_i18n(self): - """ - Load translated strings from the configured localedirs if - enabled in the configuration. - """ - self.translator = None - if self.config.language is not None: - self.info(bold('loading translations [%s]... ' % self.config.language), - nonl=True) - locale_dirs = [path.join(path.dirname(__file__), 'locale')] + \ - [path.join(self.srcdir, x) for x in self.config.locale_dirs] - for dir_ in locale_dirs: - try: - trans = gettext.translation('sphinx', localedir=dir_, - languages=[self.config.language]) - if self.translator is None: - self.translator = trans - else: - self.translator._catalog.update(trans.catalog) - except Exception: - # Language couldn't be found in the specified path - pass - if self.translator is not None: - self.info('done') - else: - self.info('locale not available') - if self.translator is None: - self.translator = gettext.NullTranslations() - self.translator.install(unicode=True) - locale.init() # translate common labels - - def load_env(self): - """Set up the build environment.""" - if self.env: - return - if not self.freshenv: - try: - self.info(bold('loading pickled environment... '), nonl=True) - self.env = BuildEnvironment.frompickle(self.config, - path.join(self.doctreedir, ENV_PICKLE_FILENAME)) - self.info('done') - except Exception, err: - if type(err) is IOError and err.errno == 2: - self.info('not found') - else: - self.info('failed: %s' % err) - self.env = BuildEnvironment(self.srcdir, self.doctreedir, self.config) - self.env.find_files(self.config) - else: - self.env = BuildEnvironment(self.srcdir, self.doctreedir, self.config) - self.env.find_files(self.config) - self.env.set_warnfunc(self.warn) - - def build_all(self): - """Build all source files.""" - self.build(None, summary='all source files', method='all') - - def build_specific(self, filenames): - """Only rebuild as much as needed for changes in the source_filenames.""" - # bring the filenames to the canonical format, that is, - # relative to the source directory and without source_suffix. - dirlen = len(self.srcdir) + 1 - to_write = [] - suffix = self.config.source_suffix - for filename in filenames: - filename = path.abspath(filename)[dirlen:] - if filename.endswith(suffix): - filename = filename[:-len(suffix)] - filename = filename.replace(os.path.sep, SEP) - to_write.append(filename) - self.build(to_write, method='specific', - summary='%d source files given on command ' - 'line' % len(to_write)) - - def build_update(self): - """Only rebuild files changed or added since last build.""" - to_build = self.get_outdated_docs() - if isinstance(to_build, str): - self.build(['__all__'], to_build) - else: - to_build = list(to_build) - self.build(to_build, - summary='targets for %d source files that are ' - 'out of date' % len(to_build)) - - def build(self, docnames, summary=None, method='update'): - if summary: - self.info(bold('building [%s]: ' % self.name), nonl=1) - self.info(summary) - - updated_docnames = [] - # while reading, collect all warnings from docutils - warnings = [] - self.env.set_warnfunc(warnings.append) - self.info(bold('updating environment: '), nonl=1) - iterator = self.env.update(self.config, self.srcdir, self.doctreedir, self.app) - # the first item in the iterator is a summary message - self.info(iterator.next()) - for docname in self.status_iterator(iterator, 'reading sources... ', purple): - updated_docnames.append(docname) - # nothing further to do, the environment has already done the reading - for warning in warnings: - if warning.strip(): - self.warn(warning) - self.env.set_warnfunc(self.warn) - - if updated_docnames: - # save the environment - self.info(bold('pickling environment... '), nonl=True) - self.env.topickle(path.join(self.doctreedir, ENV_PICKLE_FILENAME)) - self.info('done') - - # global actions - self.info(bold('checking consistency... '), nonl=True) - self.env.check_consistency() - self.info('done') - else: - if method == 'update' and not docnames: - self.info(bold('no targets are out of date.')) - return - - # another indirection to support methods which don't build files - # individually - self.write(docnames, updated_docnames, method) - - # finish (write static files etc.) - self.finish() - status = self.app.statuscode == 0 and 'succeeded' or 'finished with problems' - if self.app._warncount: - self.info(bold('build %s, %s warning%s.' % - (status, self.app._warncount, - self.app._warncount != 1 and 's' or ''))) - else: - self.info(bold('build %s.' % status)) - - def write(self, build_docnames, updated_docnames, method='update'): - if build_docnames is None or build_docnames == ['__all__']: - # build_all - build_docnames = self.env.found_docs - if method == 'update': - # build updated ones as well - docnames = set(build_docnames) | set(updated_docnames) - else: - docnames = set(build_docnames) - - # add all toctree-containing files that may have changed - for docname in list(docnames): - for tocdocname in self.env.files_to_rebuild.get(docname, []): - docnames.add(tocdocname) - docnames.add(self.config.master_doc) - - self.info(bold('preparing documents... '), nonl=True) - self.prepare_writing(docnames) - self.info('done') - - # write target files - warnings = [] - self.env.set_warnfunc(warnings.append) - for docname in self.status_iterator(sorted(docnames), - 'writing output... ', darkgreen): - doctree = self.env.get_and_resolve_doctree(docname, self) - self.write_doc(docname, doctree) - for warning in warnings: - if warning.strip(): - self.warn(warning) - self.env.set_warnfunc(self.warn) - - def prepare_writing(self, docnames): - raise NotImplementedError - - def write_doc(self, docname, doctree): - raise NotImplementedError - - def finish(self): - raise NotImplementedError - - -class StandaloneHTMLBuilder(Builder): - """ - Builds standalone HTML docs. - """ - name = 'html' - copysource = True - out_suffix = '.html' - indexer_format = js_index - supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', - 'image/jpeg'] - searchindex_filename = 'searchindex.js' - add_header_links = True - add_definition_links = True - - # This is a class attribute because it is mutated by Sphinx.add_javascript. - script_files = ['_static/jquery.js', '_static/doctools.js'] - - def init(self): - """Load templates.""" - self.init_templates() - self.init_translator_class() - if self.config.html_file_suffix: - self.out_suffix = self.config.html_file_suffix - - if self.config.language is not None: - jsfile = path.join(path.dirname(__file__), 'locale', self.config.language, - 'LC_MESSAGES', 'sphinx.js') - if path.isfile(jsfile): - self.script_files.append('_static/translations.js') - - def init_translator_class(self): - if self.config.html_translator_class: - self.translator_class = self.app.import_object( - self.config.html_translator_class, 'html_translator_class setting') - elif self.config.html_use_smartypants: - self.translator_class = SmartyPantsHTMLTranslator - else: - self.translator_class = HTMLTranslator - - def render_partial(self, node): - """Utility: Render a lone doctree node.""" - doc = new_document('<partial node>') - doc.append(node) - return publish_parts( - doc, - source_class=DocTreeInput, - reader=DoctreeReader(), - writer=HTMLWriter(self), - settings_overrides={'output_encoding': 'unicode'} - ) - - def prepare_writing(self, docnames): - from sphinx.search import IndexBuilder - - self.indexer = IndexBuilder(self.env) - self.load_indexer(docnames) - self.docwriter = HTMLWriter(self) - self.docsettings = OptionParser( - defaults=self.env.settings, - components=(self.docwriter,)).get_default_values() - - # format the "last updated on" string, only once is enough since it - # typically doesn't include the time of day - lufmt = self.config.html_last_updated_fmt - if lufmt is not None: - self.last_updated = ustrftime(lufmt or _('%b %d, %Y')) - else: - self.last_updated = None - - logo = self.config.html_logo and \ - path.basename(self.config.html_logo) or '' - - favicon = self.config.html_favicon and \ - path.basename(self.config.html_favicon) or '' - if favicon and os.path.splitext(favicon)[1] != '.ico': - self.warn('html_favicon is not an .ico file') - - if not isinstance(self.config.html_use_opensearch, basestring): - self.warn('html_use_opensearch config value must now be a string') - - self.relations = self.env.collect_relations() - - rellinks = [] - if self.config.html_use_index: - rellinks.append(('genindex', _('General Index'), 'I', _('index'))) - if self.config.html_use_modindex and self.env.modules: - rellinks.append(('modindex', _('Global Module Index'), 'M', _('modules'))) - - self.globalcontext = dict( - project = self.config.project, - release = self.config.release, - version = self.config.version, - last_updated = self.last_updated, - copyright = self.config.copyright, - master_doc = self.config.master_doc, - style = self.config.html_style, - use_opensearch = self.config.html_use_opensearch, - docstitle = self.config.html_title, - shorttitle = self.config.html_short_title, - show_sphinx = self.config.html_show_sphinx, - has_source = self.config.html_copy_source, - file_suffix = self.out_suffix, - script_files = self.script_files, - sphinx_version = __version__, - rellinks = rellinks, - builder = self.name, - parents = [], - logo = logo, - favicon = favicon, - ) - self.globalcontext.update(self.config.html_context) - - def get_doc_context(self, docname, body, metatags): - """Collect items for the template context of a page.""" - # find out relations - prev = next = None - parents = [] - rellinks = self.globalcontext['rellinks'][:] - related = self.relations.get(docname) - titles = self.env.titles - if related and related[2]: - try: - next = {'link': self.get_relative_uri(docname, related[2]), - 'title': self.render_partial(titles[related[2]])['title']} - rellinks.append((related[2], next['title'], 'N', _('next'))) - except KeyError: - next = None - if related and related[1]: - try: - prev = {'link': self.get_relative_uri(docname, related[1]), - 'title': self.render_partial(titles[related[1]])['title']} - rellinks.append((related[1], prev['title'], 'P', _('previous'))) - except KeyError: - # the relation is (somehow) not in the TOC tree, handle that gracefully - prev = None - while related and related[0]: - try: - parents.append( - {'link': self.get_relative_uri(docname, related[0]), - 'title': self.render_partial(titles[related[0]])['title']}) - except KeyError: - pass - related = self.relations.get(related[0]) - if parents: - parents.pop() # remove link to the master file; we have a generic - # "back to index" link already - parents.reverse() - - # title rendered as HTML - title = titles.get(docname) - title = title and self.render_partial(title)['title'] or '' - # the name for the copied source - sourcename = self.config.html_copy_source and docname + '.txt' or '' - - # metadata for the document - meta = self.env.metadata.get(docname) - - return dict( - parents = parents, - prev = prev, - next = next, - title = title, - meta = meta, - body = body, - metatags = metatags, - rellinks = rellinks, - sourcename = sourcename, - toc = self.render_partial(self.env.get_toc_for(docname))['fragment'], - # only display a TOC if there's more than one item to show - display_toc = (self.env.toc_num_entries[docname] > 1), - ) - - def write_doc(self, docname, doctree): - self.post_process_images(doctree) - destination = StringOutput(encoding='utf-8') - doctree.settings = self.docsettings - - self.imgpath = relative_uri(self.get_target_uri(docname), '_images') - self.docwriter.write(doctree, destination) - self.docwriter.assemble_parts() - body = self.docwriter.parts['fragment'] - metatags = self.docwriter.clean_meta - - ctx = self.get_doc_context(docname, body, metatags) - self.index_page(docname, doctree, ctx.get('title', '')) - self.handle_page(docname, ctx, event_arg=doctree) - - def finish(self): - self.info(bold('writing additional files...'), nonl=1) - - # the global general index - - if self.config.html_use_index: - # the total count of lines for each index letter, used to distribute - # the entries into two columns - genindex = self.env.create_index(self) - indexcounts = [] - for _, entries in genindex: - indexcounts.append(sum(1 + len(subitems) - for _, (_, subitems) in entries)) - - genindexcontext = dict( - genindexentries = genindex, - genindexcounts = indexcounts, - split_index = self.config.html_split_index, - ) - self.info(' genindex', nonl=1) - - if self.config.html_split_index: - self.handle_page('genindex', genindexcontext, 'genindex-split.html') - self.handle_page('genindex-all', genindexcontext, 'genindex.html') - for (key, entries), count in zip(genindex, indexcounts): - ctx = {'key': key, 'entries': entries, 'count': count, - 'genindexentries': genindex} - self.handle_page('genindex-' + key, ctx, 'genindex-single.html') - else: - self.handle_page('genindex', genindexcontext, 'genindex.html') - - # the global module index - - if self.config.html_use_modindex and self.env.modules: - # the sorted list of all modules, for the global module index - modules = sorted(((mn, (self.get_relative_uri('modindex', fn) + - '#module-' + mn, sy, pl, dep)) - for (mn, (fn, sy, pl, dep)) in - self.env.modules.iteritems()), - key=lambda x: x[0].lower()) - # collect all platforms - platforms = set() - # sort out collapsable modules - modindexentries = [] - letters = [] - pmn = '' - num_toplevels = 0 - num_collapsables = 0 - cg = 0 # collapse group - fl = '' # first letter - for mn, (fn, sy, pl, dep) in modules: - pl = pl and pl.split(', ') or [] - platforms.update(pl) - if fl != mn[0].lower() and mn[0] != '_': - # heading - modindexentries.append(['', False, 0, False, - mn[0].upper(), '', [], False]) - letters.append(mn[0].upper()) - tn = mn.split('.')[0] - if tn != mn: - # submodule - if pmn == tn: - # first submodule - make parent collapsable - modindexentries[-1][1] = True - num_collapsables += 1 - elif not pmn.startswith(tn): - # submodule without parent in list, add dummy entry - cg += 1 - modindexentries.append([tn, True, cg, False, '', '', [], False]) - else: - num_toplevels += 1 - cg += 1 - modindexentries.append([mn, False, cg, (tn != mn), fn, sy, pl, dep]) - pmn = mn - fl = mn[0].lower() - platforms = sorted(platforms) - - # apply heuristics when to collapse modindex at page load: - # only collapse if number of toplevel modules is larger than - # number of submodules - collapse = len(modules) - num_toplevels < num_toplevels - - modindexcontext = dict( - modindexentries = modindexentries, - platforms = platforms, - letters = letters, - collapse_modindex = collapse, - ) - self.info(' modindex', nonl=1) - self.handle_page('modindex', modindexcontext, 'modindex.html') - - # the search page - if self.name != 'htmlhelp': - self.info(' search', nonl=1) - self.handle_page('search', {}, 'search.html') - - # additional pages from conf.py - for pagename, template in self.config.html_additional_pages.items(): - self.info(' '+pagename, nonl=1) - self.handle_page(pagename, {}, template) - - if self.config.html_use_opensearch and self.name != 'htmlhelp': - self.info(' opensearch', nonl=1) - fn = path.join(self.outdir, '_static', 'opensearch.xml') - self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn) - - self.info() - - # copy image files - if self.images: - self.info(bold('copying images...'), nonl=True) - ensuredir(path.join(self.outdir, '_images')) - for src, dest in self.images.iteritems(): - self.info(' '+src, nonl=1) - shutil.copyfile(path.join(self.srcdir, src), - path.join(self.outdir, '_images', dest)) - self.info() - - # copy static files - self.info(bold('copying static files... '), nonl=True) - ensuredir(path.join(self.outdir, '_static')) - # first, create pygments style file - f = open(path.join(self.outdir, '_static', 'pygments.css'), 'w') - f.write(PygmentsBridge('html', self.config.pygments_style).get_stylesheet()) - f.close() - # then, copy translations JavaScript file - if self.config.language is not None: - jsfile = path.join(path.dirname(__file__), 'locale', self.config.language, - 'LC_MESSAGES', 'sphinx.js') - if path.isfile(jsfile): - shutil.copyfile(jsfile, path.join(self.outdir, '_static', - 'translations.js')) - # then, copy over all user-supplied static files - staticdirnames = [path.join(path.dirname(__file__), 'static')] + \ - [path.join(self.confdir, spath) - for spath in self.config.html_static_path] - for staticdirname in staticdirnames: - for filename in os.listdir(staticdirname): - if filename.startswith('.'): - continue - fullname = path.join(staticdirname, filename) - targetname = path.join(self.outdir, '_static', filename) - if path.isfile(fullname): - shutil.copyfile(fullname, targetname) - elif path.isdir(fullname): - if filename in self.config.exclude_dirnames: - continue - if path.exists(targetname): - shutil.rmtree(targetname) - shutil.copytree(fullname, targetname) - # last, copy logo file (handled differently) - if self.config.html_logo: - logobase = path.basename(self.config.html_logo) - shutil.copyfile(path.join(self.confdir, self.config.html_logo), - path.join(self.outdir, '_static', logobase)) - self.info('done') - - # dump the search index - self.handle_finish() - - def get_outdated_docs(self): - if self.templates: - template_mtime = self.templates.newest_template_mtime() - else: - template_mtime = 0 - for docname in self.env.found_docs: - if docname not in self.env.all_docs: - yield docname - continue - targetname = self.env.doc2path(docname, self.outdir, self.out_suffix) - try: - targetmtime = path.getmtime(targetname) - except Exception: - targetmtime = 0 - try: - srcmtime = max(path.getmtime(self.env.doc2path(docname)), - template_mtime) - if srcmtime > targetmtime: - yield docname - except EnvironmentError: - # source doesn't exist anymore - pass - - def load_indexer(self, docnames): - keep = set(self.env.all_docs) - set(docnames) - try: - f = open(path.join(self.outdir, self.searchindex_filename), 'rb') - try: - self.indexer.load(f, self.indexer_format) - finally: - f.close() - except (IOError, OSError, ValueError): - if keep: - self.warn("search index couldn't be loaded, but not all documents " - "will be built: the index will be incomplete.") - # delete all entries for files that will be rebuilt - self.indexer.prune(keep) - - def index_page(self, pagename, doctree, title): - # only index pages with title - if self.indexer is not None and title: - self.indexer.feed(pagename, title, doctree) - - # --------- these are overwritten by the serialization builder - - def get_target_uri(self, docname, typ=None): - return docname + self.out_suffix - - def handle_page(self, pagename, addctx, templatename='page.html', - outfilename=None, event_arg=None): - ctx = self.globalcontext.copy() - # current_page_name is backwards compatibility - ctx['pagename'] = ctx['current_page_name'] = pagename - - def pathto(otheruri, resource=False, - baseuri=self.get_target_uri(pagename)): - if not resource: - otheruri = self.get_target_uri(otheruri) - return relative_uri(baseuri, otheruri) - ctx['pathto'] = pathto - ctx['hasdoc'] = lambda name: name in self.env.all_docs - ctx['customsidebar'] = self.config.html_sidebars.get(pagename) - ctx.update(addctx) - - self.app.emit('html-page-context', pagename, templatename, ctx, event_arg) - - output = self.templates.render(templatename, ctx) - if not outfilename: - outfilename = path.join(self.outdir, os_path(pagename) + self.out_suffix) - ensuredir(path.dirname(outfilename)) # normally different from self.outdir - try: - f = codecs.open(outfilename, 'w', 'utf-8') - try: - f.write(output) - finally: - f.close() - except (IOError, OSError), err: - self.warn("Error writing file %s: %s" % (outfilename, err)) - if self.copysource and ctx.get('sourcename'): - # copy the source file for the "show source" link - source_name = path.join(self.outdir, '_sources', os_path(ctx['sourcename'])) - ensuredir(path.dirname(source_name)) - shutil.copyfile(self.env.doc2path(pagename), source_name) - - def handle_finish(self): - self.info(bold('dumping search index... '), nonl=True) - self.indexer.prune(self.env.all_docs) - searchindexfn = path.join(self.outdir, self.searchindex_filename) - # first write to a temporary file, so that if dumping fails, the existing - # index won't be overwritten - f = open(searchindexfn + '.tmp', 'wb') - try: - self.indexer.dump(f, self.indexer_format) - finally: - f.close() - os.rename(searchindexfn + '.tmp', searchindexfn) - self.info('done') - - self.info(bold('dumping object inventory... '), nonl=True) - f = open(path.join(self.outdir, INVENTORY_FILENAME), 'w') - try: - f.write('# Sphinx inventory version 1\n') - f.write('# Project: %s\n' % self.config.project.encode('utf-8')) - f.write('# Version: %s\n' % self.config.version) - for modname, info in self.env.modules.iteritems(): - f.write('%s mod %s\n' % (modname, self.get_target_uri(info[0]))) - for refname, (docname, desctype) in self.env.descrefs.iteritems(): - f.write('%s %s %s\n' % (refname, desctype, self.get_target_uri(docname))) - finally: - f.close() - self.info('done') - - -class SerializingHTMLBuilder(StandaloneHTMLBuilder): - """ - An abstract builder that serializes the HTML generated. - """ - #: the serializing implementation to use. Set this to a module that - #: implements a `dump`, `load`, `dumps` and `loads` functions - #: (pickle, simplejson etc.) - implementation = None - - #: the filename for the global context file - globalcontext_filename = None - - supported_image_types = ('image/svg+xml', 'image/png', 'image/gif', - 'image/jpeg') - - def init(self): - self.init_translator_class() - self.templates = None # no template bridge necessary - - def get_target_uri(self, docname, typ=None): - if docname == 'index': - return '' - if docname.endswith(SEP + 'index'): - return docname[:-5] # up to sep - return docname + SEP - - def handle_page(self, pagename, ctx, templatename='page.html', - outfilename=None, event_arg=None): - ctx['current_page_name'] = pagename - sidebarfile = self.config.html_sidebars.get(pagename) - if sidebarfile: - ctx['customsidebar'] = sidebarfile - - if not outfilename: - outfilename = path.join(self.outdir, os_path(pagename) + self.out_suffix) - - self.app.emit('html-page-context', pagename, templatename, ctx, event_arg) - - ensuredir(path.dirname(outfilename)) - f = open(outfilename, 'wb') - try: - self.implementation.dump(ctx, f, 2) - finally: - f.close() - - # if there is a source file, copy the source file for the - # "show source" link - if ctx.get('sourcename'): - source_name = path.join(self.outdir, '_sources', - os_path(ctx['sourcename'])) - ensuredir(path.dirname(source_name)) - shutil.copyfile(self.env.doc2path(pagename), source_name) - - def handle_finish(self): - # dump the global context - outfilename = path.join(self.outdir, self.globalcontext_filename) - f = open(outfilename, 'wb') - try: - self.implementation.dump(self.globalcontext, f, 2) - finally: - f.close() - - # super here to dump the search index - StandaloneHTMLBuilder.handle_finish(self) - - # copy the environment file from the doctree dir to the output dir - # as needed by the web app - shutil.copyfile(path.join(self.doctreedir, ENV_PICKLE_FILENAME), - path.join(self.outdir, ENV_PICKLE_FILENAME)) - - # touch 'last build' file, used by the web application to determine - # when to reload its environment and clear the cache - open(path.join(self.outdir, LAST_BUILD_FILENAME), 'w').close() - - -class PickleHTMLBuilder(SerializingHTMLBuilder): - """ - A Builder that dumps the generated HTML into pickle files. - """ - implementation = pickle - indexer_format = pickle - name = 'pickle' - out_suffix = '.fpickle' - globalcontext_filename = 'globalcontext.pickle' - searchindex_filename = 'searchindex.pickle' - - -class JSONHTMLBuilder(SerializingHTMLBuilder): - """ - A builder that dumps the generated HTML into JSON files. - """ - implementation = json - indexer_format = json - name = 'json' - out_suffix = '.fjson' - globalcontext_filename = 'globalcontext.json' - searchindex_filename = 'searchindex.json' - - def init(self): - if json is None: - from sphinx.application import SphinxError - raise SphinxError('The module simplejson (or json in Python >= 2.6) ' - 'is not available. The JSONHTMLBuilder builder ' - 'will not work.') - SerializingHTMLBuilder.init(self) - - -class HTMLHelpBuilder(StandaloneHTMLBuilder): - """ - Builder that also outputs Windows HTML help project, contents and index files. - Adapted from the original Doc/tools/prechm.py. - """ - name = 'htmlhelp' - - # don't copy the reST source - copysource = False - supported_image_types = ['image/png', 'image/gif', 'image/jpeg'] - - # don't add links - add_header_links = False - add_definition_links = False - - def init(self): - StandaloneHTMLBuilder.init(self) - # the output files for HTML help must be .html only - self.out_suffix = '.html' - - def handle_finish(self): - build_hhx(self, self.outdir, self.config.htmlhelp_basename) - - -class LaTeXBuilder(Builder): - """ - Builds LaTeX output to create PDF. - """ - name = 'latex' - supported_image_types = ['application/pdf', 'image/png', 'image/gif', - 'image/jpeg'] - - def init(self): - self.docnames = [] - self.document_data = [] - texescape.init() - - def get_outdated_docs(self): - return 'all documents' # for now - - def get_target_uri(self, docname, typ=None): - if typ == 'token': - # token references are always inside production lists and must be - # replaced by \token{} in LaTeX - return '@token' - if docname not in self.docnames: - raise NoUri - else: - return '' - - def init_document_data(self): - preliminary_document_data = map(list, self.config.latex_documents) - if not preliminary_document_data: - self.warn('No "latex_documents" config value found; no documents ' - 'will be written.') - return - # assign subdirs to titles - self.titles = [] - for entry in preliminary_document_data: - docname = entry[0] - if docname not in self.env.all_docs: - self.warn('"latex_documents" config value references unknown ' - 'document %s' % docname) - continue - self.document_data.append(entry) - if docname.endswith(SEP+'index'): - docname = docname[:-5] - self.titles.append((docname, entry[2])) - - def write(self, *ignored): - # first, assemble the "appendix" docs that are in every PDF - appendices = [] - for fname in self.config.latex_appendices: - appendices.append(self.env.get_doctree(fname)) - - docwriter = LaTeXWriter(self) - docsettings = OptionParser( - defaults=self.env.settings, - components=(docwriter,)).get_default_values() - - self.init_document_data() - - for entry in self.document_data: - docname, targetname, title, author, docclass = entry[:5] - toctree_only = False - if len(entry) > 5: - toctree_only = entry[5] - destination = FileOutput( - destination_path=path.join(self.outdir, targetname), - encoding='utf-8') - self.info("processing " + targetname + "... ", nonl=1) - doctree = self.assemble_doctree(docname, toctree_only, - appendices=(docclass == 'manual') and appendices or []) - self.post_process_images(doctree) - self.info("writing... ", nonl=1) - doctree.settings = docsettings - doctree.settings.author = author - doctree.settings.title = title - doctree.settings.docname = docname - doctree.settings.docclass = docclass - docwriter.write(doctree, destination) - self.info("done") - - def assemble_doctree(self, indexfile, toctree_only, appendices): - self.docnames = set([indexfile] + appendices) - self.info(darkgreen(indexfile) + " ", nonl=1) - def process_tree(docname, tree): - tree = tree.deepcopy() - for toctreenode in tree.traverse(addnodes.toctree): - newnodes = [] - includefiles = map(str, toctreenode['includefiles']) - for includefile in includefiles: - try: - self.info(darkgreen(includefile) + " ", nonl=1) - subtree = process_tree(includefile, - self.env.get_doctree(includefile)) - self.docnames.add(includefile) - except Exception: - self.warn('%s: toctree contains ref to nonexisting file %r' % - (docname, includefile)) - else: - sof = addnodes.start_of_file() - sof.children = subtree.children - newnodes.append(sof) - toctreenode.parent.replace(toctreenode, newnodes) - return tree - tree = self.env.get_doctree(indexfile) - if toctree_only: - # extract toctree nodes from the tree and put them in a fresh document - new_tree = new_document('<latex output>') - new_sect = nodes.section() - new_sect += nodes.title(u'<Set title in conf.py>', u'<Set title in conf.py>') - new_tree += new_sect - for node in tree.traverse(addnodes.toctree): - new_sect += node - tree = new_tree - largetree = process_tree(indexfile, tree) - largetree.extend(appendices) - self.info() - self.info("resolving references...") - self.env.resolve_references(largetree, indexfile, self) - # resolve :ref:s to distant tex files -- we can't add a cross-reference, - # but append the document name - for pendingnode in largetree.traverse(addnodes.pending_xref): - docname = pendingnode['refdocname'] - sectname = pendingnode['refsectname'] - newnodes = [nodes.emphasis(sectname, sectname)] - for subdir, title in self.titles: - if docname.startswith(subdir): - newnodes.append(nodes.Text(_(' (in '), _(' (in '))) - newnodes.append(nodes.emphasis(title, title)) - newnodes.append(nodes.Text(')', ')')) - break - else: - pass - pendingnode.replace_self(newnodes) - return largetree - - def finish(self): - # copy image files - if self.images: - self.info(bold('copying images...'), nonl=1) - for src, dest in self.images.iteritems(): - self.info(' '+src, nonl=1) - shutil.copyfile(path.join(self.srcdir, src), - path.join(self.outdir, dest)) - self.info() - - # the logo is handled differently - if self.config.latex_logo: - logobase = path.basename(self.config.latex_logo) - shutil.copyfile(path.join(self.confdir, self.config.latex_logo), - path.join(self.outdir, logobase)) - - self.info(bold('copying TeX support files... '), nonl=True) - staticdirname = path.join(path.dirname(__file__), 'texinputs') - for filename in os.listdir(staticdirname): - if not filename.startswith('.'): - shutil.copyfile(path.join(staticdirname, filename), - path.join(self.outdir, filename)) - self.info('done') - - -class ChangesBuilder(Builder): - """ - Write a summary with all versionadded/changed directives. - """ - name = 'changes' - - def init(self): - self.init_templates() - - def get_outdated_docs(self): - return self.outdir - - typemap = { - 'versionadded': 'added', - 'versionchanged': 'changed', - 'deprecated': 'deprecated', - } - - def write(self, *ignored): - version = self.config.version - libchanges = {} - apichanges = [] - otherchanges = {} - if version not in self.env.versionchanges: - self.info(bold('no changes in this version.')) - return - self.info(bold('writing summary file...')) - for type, docname, lineno, module, descname, content in \ - self.env.versionchanges[version]: - ttext = self.typemap[type] - context = content.replace('\n', ' ') - if descname and docname.startswith('c-api'): - if not descname: - continue - if context: - entry = '<b>%s</b>: <i>%s:</i> %s' % (descname, ttext, context) - else: - entry = '<b>%s</b>: <i>%s</i>.' % (descname, ttext) - apichanges.append((entry, docname, lineno)) - elif descname or module: - if not module: - module = _('Builtins') - if not descname: - descname = _('Module level') - if context: - entry = '<b>%s</b>: <i>%s:</i> %s' % (descname, ttext, context) - else: - entry = '<b>%s</b>: <i>%s</i>.' % (descname, ttext) - libchanges.setdefault(module, []).append((entry, docname, lineno)) - else: - if not context: - continue - entry = '<i>%s:</i> %s' % (ttext.capitalize(), context) - title = self.env.titles[docname].astext() - otherchanges.setdefault((docname, title), []).append( - (entry, docname, lineno)) - - ctx = { - 'project': self.config.project, - 'version': version, - 'docstitle': self.config.html_title, - 'shorttitle': self.config.html_short_title, - 'libchanges': sorted(libchanges.iteritems()), - 'apichanges': sorted(apichanges), - 'otherchanges': sorted(otherchanges.iteritems()), - 'show_sphinx': self.config.html_show_sphinx, - } - f = open(path.join(self.outdir, 'index.html'), 'w') - try: - f.write(self.templates.render('changes/frameset.html', ctx)) - finally: - f.close() - f = open(path.join(self.outdir, 'changes.html'), 'w') - try: - f.write(self.templates.render('changes/versionchanges.html', ctx)) - finally: - f.close() - - hltext = ['.. versionadded:: %s' % version, - '.. versionchanged:: %s' % version, - '.. deprecated:: %s' % version] - - def hl(no, line): - line = '<a name="L%s"> </a>' % no + escape(line) - for x in hltext: - if x in line: - line = '<span class="hl">%s</span>' % line - break - return line - - self.info(bold('copying source files...')) - for docname in self.env.all_docs: - f = open(self.env.doc2path(docname)) - lines = f.readlines() - targetfn = path.join(self.outdir, 'rst', os_path(docname)) + '.html' - ensuredir(path.dirname(targetfn)) - f = codecs.open(targetfn, 'w', 'utf8') - try: - text = ''.join(hl(i+1, line) for (i, line) in enumerate(lines)) - ctx = {'filename': self.env.doc2path(docname, None), 'text': text} - f.write(self.templates.render('changes/rstsource.html', ctx)) - finally: - f.close() - shutil.copyfile(path.join(path.dirname(__file__), 'static', 'default.css'), - path.join(self.outdir, 'default.css')) - - def hl(self, text, version): - text = escape(text) - for directive in ['versionchanged', 'versionadded', 'deprecated']: - text = text.replace('.. %s:: %s' % (directive, version), - '<b>.. %s:: %s</b>' % (directive, version)) - return text - - def finish(self): - pass - - -class TextBuilder(Builder): - name = 'text' - out_suffix = '.txt' - - def init(self): - pass - - def get_outdated_docs(self): - for docname in self.env.found_docs: - if docname not in self.env.all_docs: - yield docname - continue - targetname = self.env.doc2path(docname, self.outdir, self.out_suffix) - try: - targetmtime = path.getmtime(targetname) - except Exception: - targetmtime = 0 - try: - srcmtime = path.getmtime(self.env.doc2path(docname)) - if srcmtime > targetmtime: - yield docname - except EnvironmentError: - # source doesn't exist anymore - pass - - def get_target_uri(self, docname, typ=None): - return '' - - def prepare_writing(self, docnames): - self.writer = TextWriter(self) - - def write_doc(self, docname, doctree): - destination = StringOutput(encoding='utf-8') - self.writer.write(doctree, destination) - outfilename = path.join(self.outdir, os_path(docname) + self.out_suffix) - ensuredir(path.dirname(outfilename)) # normally different from self.outdir - try: - f = codecs.open(outfilename, 'w', 'utf-8') - try: - f.write(self.writer.output) - finally: - f.close() - except (IOError, OSError), err: - self.warn("Error writing file %s: %s" % (outfilename, err)) - - def finish(self): - pass - - -# compatibility alias -WebHTMLBuilder = PickleHTMLBuilder - +import warnings -from sphinx.linkcheck import CheckExternalLinksBuilder +from sphinx.builders import Builder +from sphinx.builders.text import TextBuilder +from sphinx.builders.html import StandaloneHTMLBuilder, WebHTMLBuilder, \ + PickleHTMLBuilder, JSONHTMLBuilder +from sphinx.builders.latex import LaTeXBuilder +from sphinx.builders.changes import ChangesBuilder +from sphinx.builders.htmlhelp import HTMLHelpBuilder +from sphinx.builders.linkcheck import CheckExternalLinksBuilder -builtin_builders = { - 'html': StandaloneHTMLBuilder, - 'pickle': PickleHTMLBuilder, - 'json': JSONHTMLBuilder, - 'web': PickleHTMLBuilder, - 'htmlhelp': HTMLHelpBuilder, - 'latex': LaTeXBuilder, - 'text': TextBuilder, - 'changes': ChangesBuilder, - 'linkcheck': CheckExternalLinksBuilder, -} +warnings.warn('The sphinx.builder module is deprecated; please import ' + 'builders from the respective sphinx.builders submodules.', + DeprecationWarning, stacklevel=2) diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py new file mode 100644 index 00000000..52b4b0ac --- /dev/null +++ b/sphinx/builders/__init__.py @@ -0,0 +1,346 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders + ~~~~~~~~~~~~~~~ + + Builder superclass for all builders. + + :copyright: 2007-2008 by Georg Brandl, Sebastian Wiesner, Horst Gutmann. + :license: BSD, see LICENSE for details. +""" + +import os +import gettext +from os import path + +from docutils import nodes + +from sphinx import package_dir, locale +from sphinx.util import SEP, relative_uri +from sphinx.environment import BuildEnvironment +from sphinx.util.console import bold, purple, darkgreen + +# side effect: registers roles and directives +from sphinx import roles +from sphinx import directives + + +ENV_PICKLE_FILENAME = 'environment.pickle' + + +class Builder(object): + """ + Builds target formats from the reST sources. + """ + + # builder's name, for the -b command line options + name = '' + + def __init__(self, app, env=None, freshenv=False): + self.srcdir = app.srcdir + self.confdir = app.confdir + self.outdir = app.outdir + self.doctreedir = app.doctreedir + if not path.isdir(self.doctreedir): + os.makedirs(self.doctreedir) + + self.app = app + self.warn = app.warn + self.info = app.info + self.config = app.config + + self.load_i18n() + + # images that need to be copied over (source -> dest) + self.images = {} + + # if None, this is set in load_env() + self.env = env + self.freshenv = freshenv + + self.init() + self.load_env() + + # helper methods + + def init(self): + """ + Load necessary templates and perform initialization. The default + implementation does nothing. + """ + pass + + def init_templates(self): + """ + Initialize the template system. + + Call this method from init() if you need templates in your builder. + """ + if self.config.template_bridge: + self.templates = self.app.import_object( + self.config.template_bridge, 'template_bridge setting')() + else: + from sphinx.jinja2glue import BuiltinTemplates + self.templates = BuiltinTemplates() + self.templates.init(self) + + def get_target_uri(self, docname, typ=None): + """ + Return the target URI for a document name (*typ* can be used to qualify + the link characteristic for individual builders). + """ + raise NotImplementedError + + def get_relative_uri(self, from_, to, typ=None): + """ + Return a relative URI between two source filenames. May raise environment.NoUri + if there's no way to return a sensible URI. + """ + return relative_uri(self.get_target_uri(from_), + self.get_target_uri(to, typ)) + + def get_outdated_docs(self): + """ + Return an iterable of output files that are outdated, or a string describing + what an update build will build. + + If the builder does not output individual files corresponding to source files, + return a string here. If it does, return an iterable of those files that need + to be written. + """ + raise NotImplementedError + + def status_iterator(self, iterable, summary, colorfunc=darkgreen): + l = -1 + for item in iterable: + if l == -1: + self.info(bold(summary), nonl=1) + l = 0 + self.info(colorfunc(item) + ' ', nonl=1) + yield item + if l == 0: + self.info() + + supported_image_types = [] + + def post_process_images(self, doctree): + """ + Pick the best candidate for all image URIs. + """ + for node in doctree.traverse(nodes.image): + if '?' in node['candidates']: + # don't rewrite nonlocal image URIs + continue + if '*' not in node['candidates']: + for imgtype in self.supported_image_types: + candidate = node['candidates'].get(imgtype, None) + if candidate: + break + else: + self.warn('%s:%s: no matching candidate for image URI %r' % + (node.source, getattr(node, 'lineno', ''), node['uri'])) + continue + node['uri'] = candidate + else: + candidate = node['uri'] + if candidate not in self.env.images: + # non-existing URI; let it alone + continue + self.images[candidate] = self.env.images[candidate][1] + + # build methods + + def load_i18n(self): + """ + Load translated strings from the configured localedirs if + enabled in the configuration. + """ + self.translator = None + if self.config.language is not None: + self.info(bold('loading translations [%s]... ' % self.config.language), + nonl=True) + locale_dirs = [path.join(package_dir, 'locale')] + \ + [path.join(self.srcdir, x) for x in self.config.locale_dirs] + for dir_ in locale_dirs: + try: + trans = gettext.translation('sphinx', localedir=dir_, + languages=[self.config.language]) + if self.translator is None: + self.translator = trans + else: + self.translator._catalog.update(trans.catalog) + except Exception: + # Language couldn't be found in the specified path + pass + if self.translator is not None: + self.info('done') + else: + self.info('locale not available') + if self.translator is None: + self.translator = gettext.NullTranslations() + self.translator.install(unicode=True) + locale.init() # translate common labels + + def load_env(self): + """Set up the build environment.""" + if self.env: + return + if not self.freshenv: + try: + self.info(bold('loading pickled environment... '), nonl=True) + self.env = BuildEnvironment.frompickle(self.config, + path.join(self.doctreedir, ENV_PICKLE_FILENAME)) + self.info('done') + except Exception, err: + if type(err) is IOError and err.errno == 2: + self.info('not found') + else: + self.info('failed: %s' % err) + self.env = BuildEnvironment(self.srcdir, self.doctreedir, self.config) + self.env.find_files(self.config) + else: + self.env = BuildEnvironment(self.srcdir, self.doctreedir, self.config) + self.env.find_files(self.config) + self.env.set_warnfunc(self.warn) + + def build_all(self): + """Build all source files.""" + self.build(None, summary='all source files', method='all') + + def build_specific(self, filenames): + """Only rebuild as much as needed for changes in the *filenames*.""" + # bring the filenames to the canonical format, that is, + # relative to the source directory and without source_suffix. + dirlen = len(self.srcdir) + 1 + to_write = [] + suffix = self.config.source_suffix + for filename in filenames: + filename = path.abspath(filename)[dirlen:] + if filename.endswith(suffix): + filename = filename[:-len(suffix)] + filename = filename.replace(os.path.sep, SEP) + to_write.append(filename) + self.build(to_write, method='specific', + summary='%d source files given on command ' + 'line' % len(to_write)) + + def build_update(self): + """Only rebuild what was changed or added since last build.""" + to_build = self.get_outdated_docs() + if isinstance(to_build, str): + self.build(['__all__'], to_build) + else: + to_build = list(to_build) + self.build(to_build, + summary='targets for %d source files that are ' + 'out of date' % len(to_build)) + + def build(self, docnames, summary=None, method='update'): + """ + Main build method. First updates the environment, and then calls :meth:`write`. + """ + if summary: + self.info(bold('building [%s]: ' % self.name), nonl=1) + self.info(summary) + + updated_docnames = [] + # while reading, collect all warnings from docutils + warnings = [] + self.env.set_warnfunc(warnings.append) + self.info(bold('updating environment: '), nonl=1) + iterator = self.env.update(self.config, self.srcdir, self.doctreedir, self.app) + # the first item in the iterator is a summary message + self.info(iterator.next()) + for docname in self.status_iterator(iterator, 'reading sources... ', purple): + updated_docnames.append(docname) + # nothing further to do, the environment has already done the reading + for warning in warnings: + if warning.strip(): + self.warn(warning) + self.env.set_warnfunc(self.warn) + + if updated_docnames: + # save the environment + self.info(bold('pickling environment... '), nonl=True) + self.env.topickle(path.join(self.doctreedir, ENV_PICKLE_FILENAME)) + self.info('done') + + # global actions + self.info(bold('checking consistency... '), nonl=True) + self.env.check_consistency() + self.info('done') + else: + if method == 'update' and not docnames: + self.info(bold('no targets are out of date.')) + return + + # another indirection to support builders that don't build files individually + self.write(docnames, updated_docnames, method) + + # finish (write static files etc.) + self.finish() + status = self.app.statuscode == 0 and 'succeeded' or 'finished with problems' + if self.app._warncount: + self.info(bold('build %s, %s warning%s.' % + (status, self.app._warncount, + self.app._warncount != 1 and 's' or ''))) + else: + self.info(bold('build %s.' % status)) + + def write(self, build_docnames, updated_docnames, method='update'): + if build_docnames is None or build_docnames == ['__all__']: + # build_all + build_docnames = self.env.found_docs + if method == 'update': + # build updated ones as well + docnames = set(build_docnames) | set(updated_docnames) + else: + docnames = set(build_docnames) + + # add all toctree-containing files that may have changed + for docname in list(docnames): + for tocdocname in self.env.files_to_rebuild.get(docname, []): + docnames.add(tocdocname) + docnames.add(self.config.master_doc) + + self.info(bold('preparing documents... '), nonl=True) + self.prepare_writing(docnames) + self.info('done') + + # write target files + warnings = [] + self.env.set_warnfunc(warnings.append) + for docname in self.status_iterator(sorted(docnames), + 'writing output... ', darkgreen): + doctree = self.env.get_and_resolve_doctree(docname, self) + self.write_doc(docname, doctree) + for warning in warnings: + if warning.strip(): + self.warn(warning) + self.env.set_warnfunc(self.warn) + + def prepare_writing(self, docnames): + raise NotImplementedError + + def write_doc(self, docname, doctree): + raise NotImplementedError + + def finish(self): + """ + Finish the building process. The default implementation does nothing. + """ + pass + + +BUILTIN_BUILDERS = { + 'html': ('html', 'StandaloneHTMLBuilder'), + 'pickle': ('html', 'PickleHTMLBuilder'), + 'json': ('html', 'JSONHTMLBuilder'), + 'web': ('html', 'PickleHTMLBuilder'), + 'htmlhelp': ('htmlhelp', 'HTMLHelpBuilder'), + 'qthelp': ('qthelp', 'QtHelpBuilder'), + 'latex': ('latex', 'LaTeXBuilder'), + 'text': ('text', 'TextBuilder'), + 'changes': ('changes', 'ChangesBuilder'), + 'linkcheck': ('linkcheck', 'CheckExternalLinksBuilder'), +} diff --git a/sphinx/builders/changes.py b/sphinx/builders/changes.py new file mode 100644 index 00000000..8770d49b --- /dev/null +++ b/sphinx/builders/changes.py @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.changes + ~~~~~~~~~~~~~~~~~~~~~~~ + + Changelog builder. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import codecs +import shutil +from os import path +from cgi import escape + +from sphinx import package_dir +from sphinx.util import ensuredir, os_path +from sphinx.builders import Builder +from sphinx.util.console import bold + + +class ChangesBuilder(Builder): + """ + Write a summary with all versionadded/changed directives. + """ + name = 'changes' + + def init(self): + self.init_templates() + + def get_outdated_docs(self): + return self.outdir + + typemap = { + 'versionadded': 'added', + 'versionchanged': 'changed', + 'deprecated': 'deprecated', + } + + def write(self, *ignored): + version = self.config.version + libchanges = {} + apichanges = [] + otherchanges = {} + if version not in self.env.versionchanges: + self.info(bold('no changes in this version.')) + return + self.info(bold('writing summary file...')) + for type, docname, lineno, module, descname, content in \ + self.env.versionchanges[version]: + ttext = self.typemap[type] + context = content.replace('\n', ' ') + if descname and docname.startswith('c-api'): + if not descname: + continue + if context: + entry = '<b>%s</b>: <i>%s:</i> %s' % (descname, ttext, context) + else: + entry = '<b>%s</b>: <i>%s</i>.' % (descname, ttext) + apichanges.append((entry, docname, lineno)) + elif descname or module: + if not module: + module = _('Builtins') + if not descname: + descname = _('Module level') + if context: + entry = '<b>%s</b>: <i>%s:</i> %s' % (descname, ttext, context) + else: + entry = '<b>%s</b>: <i>%s</i>.' % (descname, ttext) + libchanges.setdefault(module, []).append((entry, docname, lineno)) + else: + if not context: + continue + entry = '<i>%s:</i> %s' % (ttext.capitalize(), context) + title = self.env.titles[docname].astext() + otherchanges.setdefault((docname, title), []).append( + (entry, docname, lineno)) + + ctx = { + 'project': self.config.project, + 'version': version, + 'docstitle': self.config.html_title, + 'shorttitle': self.config.html_short_title, + 'libchanges': sorted(libchanges.iteritems()), + 'apichanges': sorted(apichanges), + 'otherchanges': sorted(otherchanges.iteritems()), + 'show_sphinx': self.config.html_show_sphinx, + } + f = codecs.open(path.join(self.outdir, 'index.html'), 'w', 'utf8') + try: + f.write(self.templates.render('changes/frameset.html', ctx)) + finally: + f.close() + f = codecs.open(path.join(self.outdir, 'changes.html'), 'w', 'utf8') + try: + f.write(self.templates.render('changes/versionchanges.html', ctx)) + finally: + f.close() + + hltext = ['.. versionadded:: %s' % version, + '.. versionchanged:: %s' % version, + '.. deprecated:: %s' % version] + + def hl(no, line): + line = '<a name="L%s"> </a>' % no + escape(line) + for x in hltext: + if x in line: + line = '<span class="hl">%s</span>' % line + break + return line + + self.info(bold('copying source files...')) + for docname in self.env.all_docs: + f = codecs.open(self.env.doc2path(docname), 'r', 'latin1') + lines = f.readlines() + targetfn = path.join(self.outdir, 'rst', os_path(docname)) + '.html' + ensuredir(path.dirname(targetfn)) + f = codecs.open(targetfn, 'w', 'latin1') + try: + text = ''.join(hl(i+1, line) for (i, line) in enumerate(lines)) + ctx = {'filename': self.env.doc2path(docname, None), 'text': text} + f.write(self.templates.render('changes/rstsource.html', ctx)) + finally: + f.close() + shutil.copyfile(path.join(package_dir, 'static', 'default.css'), + path.join(self.outdir, 'default.css')) + + def hl(self, text, version): + text = escape(text) + for directive in ['versionchanged', 'versionadded', 'deprecated']: + text = text.replace('.. %s:: %s' % (directive, version), + '<b>.. %s:: %s</b>' % (directive, version)) + return text + + def finish(self): + pass diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py new file mode 100644 index 00000000..1d1af1c0 --- /dev/null +++ b/sphinx/builders/html.py @@ -0,0 +1,631 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.html + ~~~~~~~~~~~~~~~~~~~~ + + Several HTML builders. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import os +import codecs +import shutil +import cPickle as pickle +from os import path + +from docutils.io import DocTreeInput, StringOutput +from docutils.core import publish_parts +from docutils.utils import new_document +from docutils.frontend import OptionParser +from docutils.readers.doctree import Reader as DoctreeReader + +from sphinx import package_dir, __version__ +from sphinx.util import SEP, os_path, relative_uri, ensuredir, ustrftime +from sphinx.search import js_index +from sphinx.builders import Builder, ENV_PICKLE_FILENAME +from sphinx.highlighting import PygmentsBridge +from sphinx.util.console import bold +from sphinx.writers.html import HTMLWriter, HTMLTranslator, SmartyPantsHTMLTranslator + +try: + import json +except ImportError: + try: + import simplejson as json + except ImportError: + json = None + + +INVENTORY_FILENAME = 'objects.inv' +LAST_BUILD_FILENAME = 'last_build' + + +class StandaloneHTMLBuilder(Builder): + """ + Builds standalone HTML docs. + """ + name = 'html' + copysource = True + out_suffix = '.html' + link_suffix = '.html' # defaults to matching out_suffix + indexer_format = js_index + supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', + 'image/jpeg'] + searchindex_filename = 'searchindex.js' + add_permalinks = True + embedded = False # for things like HTML help or Qt help: suppresses sidebar + + # This is a class attribute because it is mutated by Sphinx.add_javascript. + script_files = ['_static/jquery.js', '_static/doctools.js'] + + def init(self): + """Load templates.""" + self.init_templates() + self.init_translator_class() + if self.config.html_file_suffix: + self.out_suffix = self.config.html_file_suffix + + if self.config.html_link_suffix is not None: + self.link_suffix = self.config.html_link_suffix + else: + self.link_suffix = self.out_suffix + + if self.config.language is not None: + jsfile = path.join(package_dir, 'locale', self.config.language, + 'LC_MESSAGES', 'sphinx.js') + if path.isfile(jsfile): + self.script_files.append('_static/translations.js') + + def init_translator_class(self): + if self.config.html_translator_class: + self.translator_class = self.app.import_object( + self.config.html_translator_class, 'html_translator_class setting') + elif self.config.html_use_smartypants: + self.translator_class = SmartyPantsHTMLTranslator + else: + self.translator_class = HTMLTranslator + + def render_partial(self, node): + """Utility: Render a lone doctree node.""" + doc = new_document('<partial node>') + doc.append(node) + return publish_parts( + doc, + source_class=DocTreeInput, + reader=DoctreeReader(), + writer=HTMLWriter(self), + settings_overrides={'output_encoding': 'unicode'} + ) + + def prepare_writing(self, docnames): + from sphinx.search import IndexBuilder + + self.indexer = IndexBuilder(self.env) + self.load_indexer(docnames) + self.docwriter = HTMLWriter(self) + self.docsettings = OptionParser( + defaults=self.env.settings, + components=(self.docwriter,)).get_default_values() + + # format the "last updated on" string, only once is enough since it + # typically doesn't include the time of day + lufmt = self.config.html_last_updated_fmt + if lufmt is not None: + self.last_updated = ustrftime(lufmt or _('%b %d, %Y')) + else: + self.last_updated = None + + logo = self.config.html_logo and \ + path.basename(self.config.html_logo) or '' + + favicon = self.config.html_favicon and \ + path.basename(self.config.html_favicon) or '' + if favicon and os.path.splitext(favicon)[1] != '.ico': + self.warn('html_favicon is not an .ico file') + + if not isinstance(self.config.html_use_opensearch, basestring): + self.warn('html_use_opensearch config value must now be a string') + + self.relations = self.env.collect_relations() + + rellinks = [] + if self.config.html_use_index: + rellinks.append(('genindex', _('General Index'), 'I', _('index'))) + if self.config.html_use_modindex and self.env.modules: + rellinks.append(('modindex', _('Global Module Index'), 'M', _('modules'))) + + self.globalcontext = dict( + embedded = self.embedded, + project = self.config.project, + release = self.config.release, + version = self.config.version, + last_updated = self.last_updated, + copyright = self.config.copyright, + master_doc = self.config.master_doc, + style = self.config.html_style, + use_opensearch = self.config.html_use_opensearch, + docstitle = self.config.html_title, + shorttitle = self.config.html_short_title, + show_sphinx = self.config.html_show_sphinx, + has_source = self.config.html_copy_source, + show_source = self.config.html_show_sourcelink, + file_suffix = self.out_suffix, + script_files = self.script_files, + sphinx_version = __version__, + rellinks = rellinks, + builder = self.name, + parents = [], + logo = logo, + favicon = favicon, + ) + self.globalcontext.update(self.config.html_context) + + def get_doc_context(self, docname, body, metatags): + """Collect items for the template context of a page.""" + # find out relations + prev = next = None + parents = [] + rellinks = self.globalcontext['rellinks'][:] + related = self.relations.get(docname) + titles = self.env.titles + if related and related[2]: + try: + next = {'link': self.get_relative_uri(docname, related[2]), + 'title': self.render_partial(titles[related[2]])['title']} + rellinks.append((related[2], next['title'], 'N', _('next'))) + except KeyError: + next = None + if related and related[1]: + try: + prev = {'link': self.get_relative_uri(docname, related[1]), + 'title': self.render_partial(titles[related[1]])['title']} + rellinks.append((related[1], prev['title'], 'P', _('previous'))) + except KeyError: + # the relation is (somehow) not in the TOC tree, handle that gracefully + prev = None + while related and related[0]: + try: + parents.append( + {'link': self.get_relative_uri(docname, related[0]), + 'title': self.render_partial(titles[related[0]])['title']}) + except KeyError: + pass + related = self.relations.get(related[0]) + if parents: + parents.pop() # remove link to the master file; we have a generic + # "back to index" link already + parents.reverse() + + # title rendered as HTML + title = titles.get(docname) + title = title and self.render_partial(title)['title'] or '' + # the name for the copied source + sourcename = self.config.html_copy_source and docname + '.txt' or '' + + # metadata for the document + meta = self.env.metadata.get(docname) + + return dict( + parents = parents, + prev = prev, + next = next, + title = title, + meta = meta, + body = body, + metatags = metatags, + rellinks = rellinks, + sourcename = sourcename, + toc = self.render_partial(self.env.get_toc_for(docname))['fragment'], + # only display a TOC if there's more than one item to show + display_toc = (self.env.toc_num_entries[docname] > 1), + ) + + def write_doc(self, docname, doctree): + self.post_process_images(doctree) + destination = StringOutput(encoding='utf-8') + doctree.settings = self.docsettings + + self.imgpath = relative_uri(self.get_target_uri(docname), '_images') + self.dlpath = relative_uri(self.get_target_uri(docname), '_downloads') + self.docwriter.write(doctree, destination) + self.docwriter.assemble_parts() + body = self.docwriter.parts['fragment'] + metatags = self.docwriter.clean_meta + + ctx = self.get_doc_context(docname, body, metatags) + self.index_page(docname, doctree, ctx.get('title', '')) + self.handle_page(docname, ctx, event_arg=doctree) + + def finish(self): + self.info(bold('writing additional files...'), nonl=1) + + # the global general index + + if self.config.html_use_index: + # the total count of lines for each index letter, used to distribute + # the entries into two columns + genindex = self.env.create_index(self) + indexcounts = [] + for _, entries in genindex: + indexcounts.append(sum(1 + len(subitems) + for _, (_, subitems) in entries)) + + genindexcontext = dict( + genindexentries = genindex, + genindexcounts = indexcounts, + split_index = self.config.html_split_index, + ) + self.info(' genindex', nonl=1) + + if self.config.html_split_index: + self.handle_page('genindex', genindexcontext, 'genindex-split.html') + self.handle_page('genindex-all', genindexcontext, 'genindex.html') + for (key, entries), count in zip(genindex, indexcounts): + ctx = {'key': key, 'entries': entries, 'count': count, + 'genindexentries': genindex} + self.handle_page('genindex-' + key, ctx, 'genindex-single.html') + else: + self.handle_page('genindex', genindexcontext, 'genindex.html') + + # the global module index + + if self.config.html_use_modindex and self.env.modules: + # the sorted list of all modules, for the global module index + modules = sorted(((mn, (self.get_relative_uri('modindex', fn) + + '#module-' + mn, sy, pl, dep)) + for (mn, (fn, sy, pl, dep)) in + self.env.modules.iteritems()), + key=lambda x: x[0].lower()) + # collect all platforms + platforms = set() + # sort out collapsable modules + modindexentries = [] + letters = [] + pmn = '' + num_toplevels = 0 + num_collapsables = 0 + cg = 0 # collapse group + fl = '' # first letter + for mn, (fn, sy, pl, dep) in modules: + pl = pl and pl.split(', ') or [] + platforms.update(pl) + if fl != mn[0].lower() and mn[0] != '_': + # heading + modindexentries.append(['', False, 0, False, + mn[0].upper(), '', [], False]) + letters.append(mn[0].upper()) + tn = mn.split('.')[0] + if tn != mn: + # submodule + if pmn == tn: + # first submodule - make parent collapsable + modindexentries[-1][1] = True + num_collapsables += 1 + elif not pmn.startswith(tn): + # submodule without parent in list, add dummy entry + cg += 1 + modindexentries.append([tn, True, cg, False, '', '', [], False]) + else: + num_toplevels += 1 + cg += 1 + modindexentries.append([mn, False, cg, (tn != mn), fn, sy, pl, dep]) + pmn = mn + fl = mn[0].lower() + platforms = sorted(platforms) + + # apply heuristics when to collapse modindex at page load: + # only collapse if number of toplevel modules is larger than + # number of submodules + collapse = len(modules) - num_toplevels < num_toplevels + + modindexcontext = dict( + modindexentries = modindexentries, + platforms = platforms, + letters = letters, + collapse_modindex = collapse, + ) + self.info(' modindex', nonl=1) + self.handle_page('modindex', modindexcontext, 'modindex.html') + + # the search page + if self.name != 'htmlhelp': + self.info(' search', nonl=1) + self.handle_page('search', {}, 'search.html') + + # additional pages from conf.py + for pagename, template in self.config.html_additional_pages.items(): + self.info(' '+pagename, nonl=1) + self.handle_page(pagename, {}, template) + + if self.config.html_use_opensearch and self.name != 'htmlhelp': + self.info(' opensearch', nonl=1) + fn = path.join(self.outdir, '_static', 'opensearch.xml') + self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn) + + self.info() + + # copy image files + if self.images: + self.info(bold('copying images...'), nonl=True) + ensuredir(path.join(self.outdir, '_images')) + for src, dest in self.images.iteritems(): + self.info(' '+src, nonl=1) + shutil.copyfile(path.join(self.srcdir, src), + path.join(self.outdir, '_images', dest)) + self.info() + + # copy downloadable files + if self.env.dlfiles: + self.info(bold('copying downloadable files...'), nonl=True) + ensuredir(path.join(self.outdir, '_downloads')) + for src, (_, dest) in self.env.dlfiles.iteritems(): + self.info(' '+src, nonl=1) + shutil.copyfile(path.join(self.srcdir, src), + path.join(self.outdir, '_downloads', dest)) + self.info() + + # copy static files + self.info(bold('copying static files... '), nonl=True) + ensuredir(path.join(self.outdir, '_static')) + # first, create pygments style file + f = open(path.join(self.outdir, '_static', 'pygments.css'), 'w') + f.write(PygmentsBridge('html', self.config.pygments_style).get_stylesheet()) + f.close() + # then, copy translations JavaScript file + if self.config.language is not None: + jsfile = path.join(package_dir, 'locale', self.config.language, + 'LC_MESSAGES', 'sphinx.js') + if path.isfile(jsfile): + shutil.copyfile(jsfile, path.join(self.outdir, '_static', + 'translations.js')) + # then, copy over all user-supplied static files + staticdirnames = [path.join(package_dir, 'static')] + \ + [path.join(self.confdir, spath) + for spath in self.config.html_static_path] + for staticdirname in staticdirnames: + for filename in os.listdir(staticdirname): + if filename.startswith('.'): + continue + fullname = path.join(staticdirname, filename) + targetname = path.join(self.outdir, '_static', filename) + if path.isfile(fullname): + shutil.copyfile(fullname, targetname) + elif path.isdir(fullname): + if filename in self.config.exclude_dirnames: + continue + if path.exists(targetname): + shutil.rmtree(targetname) + shutil.copytree(fullname, targetname) + # last, copy logo file (handled differently) + if self.config.html_logo: + logobase = path.basename(self.config.html_logo) + shutil.copyfile(path.join(self.confdir, self.config.html_logo), + path.join(self.outdir, '_static', logobase)) + self.info('done') + + # dump the search index + self.handle_finish() + + def get_outdated_docs(self): + if self.templates: + template_mtime = self.templates.newest_template_mtime() + else: + template_mtime = 0 + for docname in self.env.found_docs: + if docname not in self.env.all_docs: + yield docname + continue + targetname = self.env.doc2path(docname, self.outdir, self.out_suffix) + try: + targetmtime = path.getmtime(targetname) + except Exception: + targetmtime = 0 + try: + srcmtime = max(path.getmtime(self.env.doc2path(docname)), + template_mtime) + if srcmtime > targetmtime: + yield docname + except EnvironmentError: + # source doesn't exist anymore + pass + + def load_indexer(self, docnames): + keep = set(self.env.all_docs) - set(docnames) + try: + f = open(path.join(self.outdir, self.searchindex_filename), 'rb') + try: + self.indexer.load(f, self.indexer_format) + finally: + f.close() + except (IOError, OSError, ValueError): + if keep: + self.warn("search index couldn't be loaded, but not all documents " + "will be built: the index will be incomplete.") + # delete all entries for files that will be rebuilt + self.indexer.prune(keep) + + def index_page(self, pagename, doctree, title): + # only index pages with title + if self.indexer is not None and title: + self.indexer.feed(pagename, title, doctree) + + # --------- these are overwritten by the serialization builder + + def get_target_uri(self, docname, typ=None): + return docname + self.link_suffix + + def handle_page(self, pagename, addctx, templatename='page.html', + outfilename=None, event_arg=None): + ctx = self.globalcontext.copy() + # current_page_name is backwards compatibility + ctx['pagename'] = ctx['current_page_name'] = pagename + + def pathto(otheruri, resource=False, + baseuri=self.get_target_uri(pagename)): + if not resource: + otheruri = self.get_target_uri(otheruri) + return relative_uri(baseuri, otheruri) + ctx['pathto'] = pathto + ctx['hasdoc'] = lambda name: name in self.env.all_docs + ctx['customsidebar'] = self.config.html_sidebars.get(pagename) + ctx.update(addctx) + + self.app.emit('html-page-context', pagename, templatename, ctx, event_arg) + + output = self.templates.render(templatename, ctx) + if not outfilename: + outfilename = path.join(self.outdir, os_path(pagename) + self.out_suffix) + ensuredir(path.dirname(outfilename)) # normally different from self.outdir + try: + f = codecs.open(outfilename, 'w', 'utf-8') + try: + f.write(output) + finally: + f.close() + except (IOError, OSError), err: + self.warn("Error writing file %s: %s" % (outfilename, err)) + if self.copysource and ctx.get('sourcename'): + # copy the source file for the "show source" link + source_name = path.join(self.outdir, '_sources', os_path(ctx['sourcename'])) + ensuredir(path.dirname(source_name)) + shutil.copyfile(self.env.doc2path(pagename), source_name) + + def handle_finish(self): + self.info(bold('dumping search index... '), nonl=True) + self.indexer.prune(self.env.all_docs) + searchindexfn = path.join(self.outdir, self.searchindex_filename) + # first write to a temporary file, so that if dumping fails, the existing + # index won't be overwritten + f = open(searchindexfn + '.tmp', 'wb') + try: + self.indexer.dump(f, self.indexer_format) + finally: + f.close() + os.rename(searchindexfn + '.tmp', searchindexfn) + self.info('done') + + self.info(bold('dumping object inventory... '), nonl=True) + f = open(path.join(self.outdir, INVENTORY_FILENAME), 'w') + try: + f.write('# Sphinx inventory version 1\n') + f.write('# Project: %s\n' % self.config.project.encode('utf-8')) + f.write('# Version: %s\n' % self.config.version) + for modname, info in self.env.modules.iteritems(): + f.write('%s mod %s\n' % (modname, self.get_target_uri(info[0]))) + for refname, (docname, desctype) in self.env.descrefs.iteritems(): + f.write('%s %s %s\n' % (refname, desctype, self.get_target_uri(docname))) + finally: + f.close() + self.info('done') + + +class SerializingHTMLBuilder(StandaloneHTMLBuilder): + """ + An abstract builder that serializes the HTML generated. + """ + #: the serializing implementation to use. Set this to a module that + #: implements a `dump`, `load`, `dumps` and `loads` functions + #: (pickle, simplejson etc.) + implementation = None + + #: the filename for the global context file + globalcontext_filename = None + + supported_image_types = ('image/svg+xml', 'image/png', 'image/gif', + 'image/jpeg') + + def init(self): + self.init_translator_class() + self.templates = None # no template bridge necessary + + def get_target_uri(self, docname, typ=None): + if docname == 'index': + return '' + if docname.endswith(SEP + 'index'): + return docname[:-5] # up to sep + return docname + SEP + + def handle_page(self, pagename, ctx, templatename='page.html', + outfilename=None, event_arg=None): + ctx['current_page_name'] = pagename + sidebarfile = self.config.html_sidebars.get(pagename) + if sidebarfile: + ctx['customsidebar'] = sidebarfile + + if not outfilename: + outfilename = path.join(self.outdir, os_path(pagename) + self.out_suffix) + + self.app.emit('html-page-context', pagename, templatename, ctx, event_arg) + + ensuredir(path.dirname(outfilename)) + f = open(outfilename, 'wb') + try: + self.implementation.dump(ctx, f, 2) + finally: + f.close() + + # if there is a source file, copy the source file for the + # "show source" link + if ctx.get('sourcename'): + source_name = path.join(self.outdir, '_sources', + os_path(ctx['sourcename'])) + ensuredir(path.dirname(source_name)) + shutil.copyfile(self.env.doc2path(pagename), source_name) + + def handle_finish(self): + # dump the global context + outfilename = path.join(self.outdir, self.globalcontext_filename) + f = open(outfilename, 'wb') + try: + self.implementation.dump(self.globalcontext, f, 2) + finally: + f.close() + + # super here to dump the search index + StandaloneHTMLBuilder.handle_finish(self) + + # copy the environment file from the doctree dir to the output dir + # as needed by the web app + shutil.copyfile(path.join(self.doctreedir, ENV_PICKLE_FILENAME), + path.join(self.outdir, ENV_PICKLE_FILENAME)) + + # touch 'last build' file, used by the web application to determine + # when to reload its environment and clear the cache + open(path.join(self.outdir, LAST_BUILD_FILENAME), 'w').close() + + +class PickleHTMLBuilder(SerializingHTMLBuilder): + """ + A Builder that dumps the generated HTML into pickle files. + """ + implementation = pickle + indexer_format = pickle + name = 'pickle' + out_suffix = '.fpickle' + globalcontext_filename = 'globalcontext.pickle' + searchindex_filename = 'searchindex.pickle' + +# compatibility alias +WebHTMLBuilder = PickleHTMLBuilder + + +class JSONHTMLBuilder(SerializingHTMLBuilder): + """ + A builder that dumps the generated HTML into JSON files. + """ + implementation = json + indexer_format = json + name = 'json' + out_suffix = '.fjson' + globalcontext_filename = 'globalcontext.json' + searchindex_filename = 'searchindex.json' + + def init(self): + if json is None: + from sphinx.application import SphinxError + raise SphinxError('The module simplejson (or json in Python >= 2.6) ' + 'is not available. The JSONHTMLBuilder builder ' + 'will not work.') + SerializingHTMLBuilder.init(self) diff --git a/sphinx/builders/htmlhelp.py b/sphinx/builders/htmlhelp.py new file mode 100644 index 00000000..9baaa235 --- /dev/null +++ b/sphinx/builders/htmlhelp.py @@ -0,0 +1,246 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.htmlhelp + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Build HTML help support files. + Parts adapted from Python's Doc/tools/prechm.py. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import os +import cgi +from os import path + +from docutils import nodes + +from sphinx import addnodes +from sphinx.builders.html import StandaloneHTMLBuilder + + +# Project file (*.hhp) template. 'outname' is the file basename (like +# the pythlp in pythlp.hhp); 'version' is the doc version number (like +# the 2.2 in Python 2.2). +# The magical numbers in the long line under [WINDOWS] set most of the +# user-visible features (visible buttons, tabs, etc). +# About 0x10384e: This defines the buttons in the help viewer. The +# following defns are taken from htmlhelp.h. Not all possibilities +# actually work, and not all those that work are available from the Help +# Workshop GUI. In particular, the Zoom/Font button works and is not +# available from the GUI. The ones we're using are marked with 'x': +# +# 0x000002 Hide/Show x +# 0x000004 Back x +# 0x000008 Forward x +# 0x000010 Stop +# 0x000020 Refresh +# 0x000040 Home x +# 0x000080 Forward +# 0x000100 Back +# 0x000200 Notes +# 0x000400 Contents +# 0x000800 Locate x +# 0x001000 Options x +# 0x002000 Print x +# 0x004000 Index +# 0x008000 Search +# 0x010000 History +# 0x020000 Favorites +# 0x040000 Jump 1 +# 0x080000 Jump 2 +# 0x100000 Zoom/Font x +# 0x200000 TOC Next +# 0x400000 TOC Prev + +project_template = '''\ +[OPTIONS] +Binary TOC=Yes +Binary Index=No +Compiled file=%(outname)s.chm +Contents file=%(outname)s.hhc +Default Window=%(outname)s +Default topic=index.html +Display compile progress=No +Full text search stop list file=%(outname)s.stp +Full-text search=Yes +Index file=%(outname)s.hhk +Language=0x409 +Title=%(title)s + +[WINDOWS] +%(outname)s="%(title)s","%(outname)s.hhc","%(outname)s.hhk",\ +"index.html","index.html",,,,,0x63520,220,0x10384e,[0,0,1024,768],,,,,,,0 + +[FILES] +''' + +contents_header = '''\ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<HTML> +<HEAD> +<meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1"> +<!-- Sitemap 1.0 --> +</HEAD><BODY> +<OBJECT type="text/site properties"> + <param name="Window Styles" value="0x801227"> + <param name="ImageType" value="Folder"> +</OBJECT> +<UL> +''' + +contents_footer = '''\ +</UL></BODY></HTML> +''' + +object_sitemap = '''\ +<OBJECT type="text/sitemap"> + <param name="Name" value="%s"> + <param name="Local" value="%s"> +</OBJECT> +''' + +# List of words the full text search facility shouldn't index. This +# becomes file outname.stp. Note that this list must be pretty small! +# Different versions of the MS docs claim the file has a maximum size of +# 256 or 512 bytes (including \r\n at the end of each line). +# Note that "and", "or", "not" and "near" are operators in the search +# language, so no point indexing them even if we wanted to. +stopwords = """ +a and are as at +be but by +for +if in into is it +near no not +of on or +such +that the their then there these they this to +was will with +""".split() + + +class HTMLHelpBuilder(StandaloneHTMLBuilder): + """ + Builder that also outputs Windows HTML help project, contents and index files. + Adapted from the original Doc/tools/prechm.py. + """ + name = 'htmlhelp' + + # don't copy the reST source + copysource = False + supported_image_types = ['image/png', 'image/gif', 'image/jpeg'] + + # don't add links + add_permalinks = False + # don't add sidebar etc. + embedded = True + + def init(self): + StandaloneHTMLBuilder.init(self) + # the output files for HTML help must be .html only + self.out_suffix = '.html' + + def handle_finish(self): + self.build_hhx(self.outdir, self.config.htmlhelp_basename) + + def build_hhx(self, outdir, outname): + self.info('dumping stopword list...') + f = open(path.join(outdir, outname+'.stp'), 'w') + try: + for word in sorted(stopwords): + print >>f, word + finally: + f.close() + + self.info('writing project file...') + f = open(path.join(outdir, outname+'.hhp'), 'w') + try: + f.write(project_template % {'outname': outname, + 'title': self.config.html_title, + 'version': self.config.version, + 'project': self.config.project}) + if not outdir.endswith(os.sep): + outdir += os.sep + olen = len(outdir) + for root, dirs, files in os.walk(outdir): + staticdir = (root == path.join(outdir, '_static')) + for fn in files: + if (staticdir and not fn.endswith('.js')) or fn.endswith('.html'): + print >>f, path.join(root, fn)[olen:].replace(os.sep, '\\') + finally: + f.close() + + self.info('writing TOC file...') + f = open(path.join(outdir, outname+'.hhc'), 'w') + try: + f.write(contents_header) + # special books + f.write('<LI> ' + object_sitemap % (self.config.html_short_title, + 'index.html')) + if self.config.html_use_modindex: + f.write('<LI> ' + object_sitemap % (_('Global Module Index'), + 'modindex.html')) + # the TOC + tocdoc = self.env.get_and_resolve_doctree(self.config.master_doc, self, + prune_toctrees=False) + def write_toc(node, ullevel=0): + if isinstance(node, nodes.list_item): + f.write('<LI> ') + for subnode in node: + write_toc(subnode, ullevel) + elif isinstance(node, nodes.reference): + link = node['refuri'] + title = cgi.escape(node.astext()).replace('"','"') + item = object_sitemap % (title, link) + f.write(item.encode('ascii', 'xmlcharrefreplace')) + elif isinstance(node, nodes.bullet_list): + if ullevel != 0: + f.write('<UL>\n') + for subnode in node: + write_toc(subnode, ullevel+1) + if ullevel != 0: + f.write('</UL>\n') + elif isinstance(node, addnodes.compact_paragraph): + for subnode in node: + write_toc(subnode, ullevel) + istoctree = lambda node: isinstance(node, addnodes.compact_paragraph) and \ + node.has_key('toctree') + for node in tocdoc.traverse(istoctree): + write_toc(node) + f.write(contents_footer) + finally: + f.close() + + self.info('writing index file...') + index = self.env.create_index(self) + f = open(path.join(outdir, outname+'.hhk'), 'w') + try: + f.write('<UL>\n') + def write_index(title, refs, subitems): + def write_param(name, value): + item = ' <param name="%s" value="%s">\n' % (name, value) + f.write(item.encode('ascii', 'xmlcharrefreplace')) + title = cgi.escape(title) + f.write('<LI> <OBJECT type="text/sitemap">\n') + write_param('Keyword', title) + if len(refs) == 0: + write_param('See Also', title) + elif len(refs) == 1: + write_param('Local', refs[0]) + else: + for i, ref in enumerate(refs): + write_param('Name', '[%d] %s' % (i, ref)) # XXX: better title? + write_param('Local', ref) + f.write('</OBJECT>\n') + if subitems: + f.write('<UL> ') + for subitem in subitems: + write_index(subitem[0], subitem[1], []) + f.write('</UL>') + for (key, group) in index: + for title, (refs, subitems) in group: + write_index(title, refs, subitems) + f.write('</UL>\n') + finally: + f.close() diff --git a/sphinx/builders/latex.py b/sphinx/builders/latex.py new file mode 100644 index 00000000..3b7b0c19 --- /dev/null +++ b/sphinx/builders/latex.py @@ -0,0 +1,186 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.latex + ~~~~~~~~~~~~~~~~~~~~~ + + LaTeX builder. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import os +import shutil +from os import path + +from docutils import nodes +from docutils.io import FileOutput +from docutils.utils import new_document +from docutils.frontend import OptionParser + +from sphinx import package_dir, addnodes +from sphinx.util import SEP, texescape +from sphinx.builders import Builder +from sphinx.environment import NoUri +from sphinx.util.console import bold, darkgreen +from sphinx.writers.latex import LaTeXWriter + + +class LaTeXBuilder(Builder): + """ + Builds LaTeX output to create PDF. + """ + name = 'latex' + supported_image_types = ['application/pdf', 'image/png', 'image/gif', + 'image/jpeg'] + + def init(self): + self.docnames = [] + self.document_data = [] + texescape.init() + + def get_outdated_docs(self): + return 'all documents' # for now + + def get_target_uri(self, docname, typ=None): + if typ == 'token': + # token references are always inside production lists and must be + # replaced by \token{} in LaTeX + return '@token' + if docname not in self.docnames: + raise NoUri + else: + return '%' + docname + + def init_document_data(self): + preliminary_document_data = map(list, self.config.latex_documents) + if not preliminary_document_data: + self.warn('No "latex_documents" config value found; no documents ' + 'will be written.') + return + # assign subdirs to titles + self.titles = [] + for entry in preliminary_document_data: + docname = entry[0] + if docname not in self.env.all_docs: + self.warn('"latex_documents" config value references unknown ' + 'document %s' % docname) + continue + self.document_data.append(entry) + if docname.endswith(SEP+'index'): + docname = docname[:-5] + self.titles.append((docname, entry[2])) + + def write(self, *ignored): + # first, assemble the "appendix" docs that are in every PDF + appendices = [] + for fname in self.config.latex_appendices: + appendices.append(self.env.get_doctree(fname)) + + docwriter = LaTeXWriter(self) + docsettings = OptionParser( + defaults=self.env.settings, + components=(docwriter,)).get_default_values() + + self.init_document_data() + + for entry in self.document_data: + docname, targetname, title, author, docclass = entry[:5] + toctree_only = False + if len(entry) > 5: + toctree_only = entry[5] + destination = FileOutput( + destination_path=path.join(self.outdir, targetname), + encoding='utf-8') + self.info("processing " + targetname + "... ", nonl=1) + doctree = self.assemble_doctree(docname, toctree_only, + appendices=(docclass == 'manual') and appendices or []) + self.post_process_images(doctree) + self.info("writing... ", nonl=1) + doctree.settings = docsettings + doctree.settings.author = author + doctree.settings.title = title + doctree.settings.docname = docname + doctree.settings.docclass = docclass + docwriter.write(doctree, destination) + self.info("done") + + def assemble_doctree(self, indexfile, toctree_only, appendices): + self.docnames = set([indexfile] + appendices) + self.info(darkgreen(indexfile) + " ", nonl=1) + def process_tree(docname, tree): + tree = tree.deepcopy() + for toctreenode in tree.traverse(addnodes.toctree): + newnodes = [] + includefiles = map(str, toctreenode['includefiles']) + for includefile in includefiles: + try: + self.info(darkgreen(includefile) + " ", nonl=1) + subtree = process_tree(includefile, + self.env.get_doctree(includefile)) + self.docnames.add(includefile) + except Exception: + self.warn('%s: toctree contains ref to nonexisting file %r' % + (docname, includefile)) + else: + sof = addnodes.start_of_file(docname=includefile) + sof.children = subtree.children + newnodes.append(sof) + toctreenode.parent.replace(toctreenode, newnodes) + return tree + tree = self.env.get_doctree(indexfile) + tree['docname'] = indexfile + if toctree_only: + # extract toctree nodes from the tree and put them in a fresh document + new_tree = new_document('<latex output>') + new_sect = nodes.section() + new_sect += nodes.title(u'<Set title in conf.py>', u'<Set title in conf.py>') + new_tree += new_sect + for node in tree.traverse(addnodes.toctree): + new_sect += node + tree = new_tree + largetree = process_tree(indexfile, tree) + largetree.extend(appendices) + self.info() + self.info("resolving references...") + self.env.resolve_references(largetree, indexfile, self) + # resolve :ref:s to distant tex files -- we can't add a cross-reference, + # but append the document name + for pendingnode in largetree.traverse(addnodes.pending_xref): + docname = pendingnode['refdocname'] + sectname = pendingnode['refsectname'] + newnodes = [nodes.emphasis(sectname, sectname)] + for subdir, title in self.titles: + if docname.startswith(subdir): + newnodes.append(nodes.Text(_(' (in '), _(' (in '))) + newnodes.append(nodes.emphasis(title, title)) + newnodes.append(nodes.Text(')', ')')) + break + else: + pass + pendingnode.replace_self(newnodes) + return largetree + + def finish(self): + # copy image files + if self.images: + self.info(bold('copying images...'), nonl=1) + for src, dest in self.images.iteritems(): + self.info(' '+src, nonl=1) + shutil.copyfile(path.join(self.srcdir, src), + path.join(self.outdir, dest)) + self.info() + + # the logo is handled differently + if self.config.latex_logo: + logobase = path.basename(self.config.latex_logo) + shutil.copyfile(path.join(self.confdir, self.config.latex_logo), + path.join(self.outdir, logobase)) + + self.info(bold('copying TeX support files... '), nonl=True) + staticdirname = path.join(package_dir, 'texinputs') + for filename in os.listdir(staticdirname): + if not filename.startswith('.'): + shutil.copyfile(path.join(staticdirname, filename), + path.join(self.outdir, filename)) + self.info('done') diff --git a/sphinx/linkcheck.py b/sphinx/builders/linkcheck.py index a4e876e2..5fcda231 100644 --- a/sphinx/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - sphinx.linkcheck - ~~~~~~~~~~~~~~~~ + sphinx.builders.linkcheck + ~~~~~~~~~~~~~~~~~~~~~~~~~ The CheckExternalLinksBuilder class. @@ -15,7 +15,7 @@ from urllib2 import build_opener, HTTPError from docutils import nodes -from sphinx.builder import Builder +from sphinx.builders import Builder from sphinx.util.console import purple, red, darkgreen # create an opener that will simulate a browser user-agent diff --git a/sphinx/builders/qthelp.py b/sphinx/builders/qthelp.py new file mode 100644 index 00000000..855b340e --- /dev/null +++ b/sphinx/builders/qthelp.py @@ -0,0 +1,261 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.qthelp + ~~~~~~~~~~~~~~~~~~~~~~ + + Build input files for the Qt collection generator. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import os +import re +import cgi +from os import path + +from docutils import nodes + +from sphinx import addnodes +from sphinx.builders.html import StandaloneHTMLBuilder + +_idpattern = re.compile('(?P<title>.+) (\((?P<id>[\w\.]+)( (?P<descr>\w+))?\))$') + + +# Qt Help Collection Project (.qhcp). +# Is the input file for the help collection generator. +# It contains references to compressed help files which should be +# included in the collection. +# It may contain various other information for customizing Qt Assistant. +collection_template = '''\ +<?xml version="1.0" encoding="utf-8" ?> +<QHelpCollectionProject version="1.0"> + <docFiles> + <generate> + <file> + <input>%(outname)s.qhp</input> + <output>%(outname)s.qch</output> + </file> + </generate> + <register> + <file>%(outname)s.qch</file> + </register> + </docFiles> +</QHelpCollectionProject> +''' + +# Qt Help Project (.qhp) +# This is the input file for the help generator. +# It contains the table of contents, indices and references to the +# actual documentation files (*.html). +# In addition it defines a unique namespace for the documentation. +project_template = '''\ +<?xml version="1.0" encoding="UTF-8"?> +<QtHelpProject version="1.0"> + <namespace>%(outname)s.org.%(outname)s.%(nversion)s</namespace> + <virtualFolder>doc</virtualFolder> + <customFilter name="%(project)s %(version)s"> + <filterAttribute>%(outname)s</filterAttribute> + <filterAttribute>%(version)s</filterAttribute> + </customFilter> + <filterSection> + <filterAttribute>%(outname)s</filterAttribute> + <filterAttribute>%(version)s</filterAttribute> + <toc> + <section title="%(title)s" ref="%(masterdoc)s.html"> +%(sections)s + </section> + </toc> + <keywords> +%(keywords)s + </keywords> + <files> +%(files)s + </files> + </filterSection> +</QtHelpProject> +''' + +section_template = '<section title="%(title)s" ref="%(ref)s"/>' +file_template = ' '*12 + '<file>%(filename)s</file>' + + +class QtHelpBuilder(StandaloneHTMLBuilder): + """ + Builder that also outputs Qt help project, contents and index files. + """ + name = 'qthelp' + + # don't copy the reST source + copysource = False + supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', + 'image/jpeg'] + + # don't add links + add_permalinks = False + # don't add sidebar etc. + embedded = True + + def init(self): + StandaloneHTMLBuilder.init(self) + # the output files for HTML help must be .html only + self.out_suffix = '.html' + #self.config.html_style = 'traditional.css' + + def handle_finish(self): + self.build_qhcp(self.outdir, self.config.qthelp_basename) + self.build_qhp(self.outdir, self.config.qthelp_basename) + + def build_qhcp(self, outdir, outname): + self.info('writing collection project file...') + f = open(path.join(outdir, outname+'.qhcp'), 'w') + try: + f.write(collection_template % {'outname': outname}) + finally: + f.close() + + def build_qhp(self, outdir, outname): + self.info('writing project file...') + + # sections + tocdoc = self.env.get_and_resolve_doctree(self.config.master_doc, self, + prune_toctrees=False) + istoctree = lambda node: ( + isinstance(node, addnodes.compact_paragraph) + and node.has_key('toctree')) + sections = [] + for node in tocdoc.traverse(istoctree): + sections.extend(self.write_toc(node)) + + if self.config.html_use_modindex: + item = section_template % {'title': _('Global Module Index'), + 'ref': 'modindex.html'} + sections.append(' '*4*4 + item) + sections = '\n'.join(sections) + + # keywords + keywords = [] + index = self.env.create_index(self) + for (key, group) in index: + for title, (refs, subitems) in group: + keywords.extend(self.build_keywords(title, refs, subitems)) + keywords = '\n'.join(keywords) + + # files + if not outdir.endswith(os.sep): + outdir += os.sep + olen = len(outdir) + projectfiles = [] + for root, dirs, files in os.walk(outdir): + staticdir = (root == path.join(outdir, '_static')) + for fn in files: + if (staticdir and not fn.endswith('.js')) or fn.endswith('.html'): + filename = path.join(root, fn)[olen:] + #filename = filename.replace(os.sep, '\\') # XXX + projectfiles.append(file_template % {'filename': filename}) + projectfiles = '\n'.join(projectfiles) + + # write the project file + f = open(path.join(outdir, outname+'.qhp'), 'w') + try: + nversion = self.config.version.replace('.', '_') + nversion = nversion.replace(' ', '_') + f.write(project_template % {'outname': outname, + 'title': self.config.html_title, + 'version': self.config.version, + 'project': self.config.project, + 'nversion': nversion, + 'masterdoc': self.config.master_doc, + 'sections': sections, + 'keywords': keywords, + 'files': projectfiles}) + finally: + f.close() + + def isdocnode(self, node): + if not isinstance(node, nodes.list_item): + return False + if len(node.children) != 2: + return False + if not isinstance(node.children[0], addnodes.compact_paragraph): + return False + if not isinstance(node.children[0][0], nodes.reference): + return False + if not isinstance(node.children[1], nodes.bullet_list): + return False + return True + + def write_toc(self, node, indentlevel=4): + parts = [] + if self.isdocnode(node): + refnode = node.children[0][0] + link = refnode['refuri'] + title = cgi.escape(refnode.astext()).replace('"','"') + item = '<section title="%(title)s" ref="%(ref)s">' % { + 'title': title, + 'ref': link} + parts.append(' '*4*indentlevel + item) + for subnode in node.children[1]: + parts.extend(self.write_toc(subnode, indentlevel+1)) + parts.append(' '*4*indentlevel + '</section>') + elif isinstance(node, nodes.list_item): + for subnode in node: + parts.extend(self.write_toc(subnode, indentlevel)) + elif isinstance(node, nodes.reference): + link = node['refuri'] + title = cgi.escape(node.astext()).replace('"','"') + item = section_template % {'title': title, 'ref': link} + item = ' '*4*indentlevel + item.encode('ascii', 'xmlcharrefreplace') + parts.append(item.encode('ascii', 'xmlcharrefreplace')) + elif isinstance(node, nodes.bullet_list): + for subnode in node: + parts.extend(self.write_toc(subnode, indentlevel)) + elif isinstance(node, addnodes.compact_paragraph): + for subnode in node: + parts.extend(self.write_toc(subnode, indentlevel)) + + return parts + + def keyword_item(self, name, ref): + matchobj = _idpattern.match(name) + if matchobj: + groupdict = matchobj.groupdict() + shortname = groupdict['title'] + id = groupdict.get('id') +# descr = groupdict.get('descr') + if shortname.endswith('()'): + shortname = shortname[:-2] + id = '%s.%s' % (id, shortname) + else: + id = descr = None + + if id: + item = ' '*12 + '<keyword name="%s" id="%s" ref="%s"/>' % ( + name, id, ref) + else: + item = ' '*12 + '<keyword name="%s" ref="%s"/>' % (name, ref) + item.encode('ascii', 'xmlcharrefreplace') + return item + + def build_keywords(self, title, refs, subitems): + keywords = [] + + title = cgi.escape(title) +# if len(refs) == 0: # XXX +# write_param('See Also', title) + if len(refs) == 1: + keywords.append(self.keyword_item(title, refs[0])) + elif len(refs) > 1: + for i, ref in enumerate(refs): # XXX +# item = (' '*12 + +# '<keyword name="%s [%d]" ref="%s"/>' % ( +# title, i, ref)) +# item.encode('ascii', 'xmlcharrefreplace') +# keywords.append(item) + keywords.append(self.keyword_item(title, ref)) + + if subitems: + for subitem in subitems: + keywords.extend(self.build_keywords(subitem[0], subitem[1], [])) + + return keywords diff --git a/sphinx/builders/text.py b/sphinx/builders/text.py new file mode 100644 index 00000000..aaafedb4 --- /dev/null +++ b/sphinx/builders/text.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.text + ~~~~~~~~~~~~~~~~~~~~ + + Plain-text Sphinx builder. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import codecs +from os import path + +from docutils.io import StringOutput + +from sphinx.util import ensuredir, os_path +from sphinx.builders import Builder +from sphinx.writers.text import TextWriter + + +class TextBuilder(Builder): + name = 'text' + out_suffix = '.txt' + + def init(self): + pass + + def get_outdated_docs(self): + for docname in self.env.found_docs: + if docname not in self.env.all_docs: + yield docname + continue + targetname = self.env.doc2path(docname, self.outdir, self.out_suffix) + try: + targetmtime = path.getmtime(targetname) + except Exception: + targetmtime = 0 + try: + srcmtime = path.getmtime(self.env.doc2path(docname)) + if srcmtime > targetmtime: + yield docname + except EnvironmentError: + # source doesn't exist anymore + pass + + def get_target_uri(self, docname, typ=None): + return '' + + def prepare_writing(self, docnames): + self.writer = TextWriter(self) + + def write_doc(self, docname, doctree): + destination = StringOutput(encoding='utf-8') + self.writer.write(doctree, destination) + outfilename = path.join(self.outdir, os_path(docname) + self.out_suffix) + ensuredir(path.dirname(outfilename)) # normally different from self.outdir + try: + f = codecs.open(outfilename, 'w', 'utf-8') + try: + f.write(self.writer.output) + finally: + f.close() + except (IOError, OSError), err: + self.warn("Error writing file %s: %s" % (outfilename, err)) + + def finish(self): + pass diff --git a/sphinx/config.py b/sphinx/config.py index a9c7ae95..428c0bf4 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -6,12 +6,14 @@ Build configuration file handling. :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. - :license: BSD license. + :license: BSD, see LICENSE for details. """ import os from os import path +from sphinx.util import make_filename + class Config(object): """Configuration file abstraction.""" @@ -65,16 +67,22 @@ class Config(object): html_sidebars = ({}, False), html_additional_pages = ({}, False), html_use_modindex = (True, False), + html_add_permalinks = (True, False), html_use_index = (True, False), html_split_index = (False, False), html_copy_source = (True, False), + html_show_sourcelink = (True, False), html_use_opensearch = ('', False), html_file_suffix = (None, False), + html_link_suffix = (None, False), html_show_sphinx = (True, False), html_context = ({}, False), # HTML help only options - htmlhelp_basename = ('pydoc', False), + htmlhelp_basename = (lambda self: make_filename(self.project), False), + + # Qt help only options + qthelp_basename = (lambda self: make_filename(self.project), False), # LaTeX options latex_documents = ([], False), @@ -111,6 +119,12 @@ class Config(object): def init_values(self): config = self._raw_config + for valname, value in self.overrides.iteritems(): + if '.' in valname: + realvalname, key = valname.split('.', 1) + config.setdefault(realvalname, {})[key] = value + else: + config[valname] = value config.update(self.overrides) for name in config: if name in self.values: diff --git a/sphinx/directives/desc.py b/sphinx/directives/desc.py index fc6cb4f6..3ffe048b 100644 --- a/sphinx/directives/desc.py +++ b/sphinx/directives/desc.py @@ -58,6 +58,18 @@ def desc_index_text(desctype, module, name, add_modules): return _('%s() (%s.%s static method)') % (methname, module, clsname) else: return _('%s() (%s static method)') % (methname, clsname) + elif desctype == 'classmethod': + try: + clsname, methname = name.rsplit('.', 1) + except ValueError: + if module: + return '%s() (in module %s)' % (name, module) + else: + return '%s()' % name + if module: + return '%s() (%s.%s class method)' % (methname, module, clsname) + else: + return '%s() (%s class method)' % (methname, clsname) elif desctype == 'attribute': try: clsname, attrname = name.rsplit('.', 1) @@ -137,7 +149,8 @@ def handle_doc_fields(node, env): for child in node.children: if not isinstance(child, nodes.field_list): continue - params = None + params = [] + pfield = None param_nodes = {} param_types = {} new_list = nodes.field_list() @@ -152,11 +165,8 @@ def handle_doc_fields(node, env): children = fbody.children if typdesc == '%param': if not params: + # add the field that later gets all the parameters pfield = nodes.field() - pfield += nodes.field_name('', _('Parameters')) - pfield += nodes.field_body() - params = nodes.bullet_list() - pfield[1] += params new_list += pfield dlitem = nodes.list_item() dlpar = nodes.paragraph() @@ -165,7 +175,7 @@ def handle_doc_fields(node, env): dlpar += children param_nodes[obj] = dlpar dlitem += dlpar - params += dlitem + params.append(dlitem) elif typdesc == '%type': typenodes = fbody.children if _is_only_paragraph(fbody): @@ -198,6 +208,17 @@ def handle_doc_fields(node, env): typ = fnametext.capitalize() fname[0] = nodes.Text(typ) new_list += field + if params: + if len(params) == 1: + pfield += nodes.field_name('', _('Parameter')) + pfield += nodes.field_body() + pfield[1] += params[0][0] + else: + pfield += nodes.field_name('', _('Parameters')) + pfield += nodes.field_body() + pfield[1] += nodes.bullet_list() + pfield[1][0].extend(params) + for param, type in param_types.iteritems(): if param in param_nodes: param_nodes[param][1:1] = type @@ -209,8 +230,9 @@ def handle_doc_fields(node, env): py_sig_re = re.compile( r'''^ ([\w.]*\.)? # class name(s) (\w+) \s* # thing name - (?: \((.*)\) # optional arguments - (\s* -> \s* .*)? )? $ # optional return annotation + (?: \((.*)\) # optional: arguments + (?:\s* -> \s* (.*))? # return annotation + )? $ # and nothing more ''', re.VERBOSE) py_paramlist_re = re.compile(r'([\[\],])') # split at '[', ']' and ',' @@ -229,9 +251,6 @@ def parse_py_signature(signode, sig, desctype, module, env): raise ValueError classname, name, arglist, retann = m.groups() - if retann: - retann = u' \N{RIGHTWARDS ARROW} ' + retann.strip()[2:] - if env.currclass: add_module = False if classname and classname.startswith(env.currclass): @@ -251,6 +270,8 @@ def parse_py_signature(signode, sig, desctype, module, env): if desctype == 'staticmethod': signode += addnodes.desc_annotation('static ', 'static ') + elif desctype == 'classmethod': + signode += addnodes.desc_annotation('classmethod ', 'classmethod ') if classname: signode += addnodes.desc_addname(classname, classname) @@ -263,11 +284,11 @@ def parse_py_signature(signode, sig, desctype, module, env): signode += addnodes.desc_name(name, name) if not arglist: - if desctype in ('function', 'method', 'staticmethod'): + if desctype in ('function', 'method', 'staticmethod', 'classmethod'): # for callables, add an empty parameter list signode += addnodes.desc_parameterlist() if retann: - signode += addnodes.desc_type(retann, retann) + signode += addnodes.desc_returns(retann, retann) return fullname, classname signode += addnodes.desc_parameterlist() @@ -290,7 +311,7 @@ def parse_py_signature(signode, sig, desctype, module, env): if len(stack) != 1: raise ValueError if retann: - signode += addnodes.desc_type(retann, retann) + signode += addnodes.desc_returns(retann, retann) return fullname, classname @@ -426,7 +447,8 @@ def desc_directive(desctype, arguments, options, content, lineno, node.append(signode) try: if desctype in ('function', 'data', 'class', 'exception', - 'method', 'staticmethod', 'attribute'): + 'method', 'staticmethod', 'classmethod', + 'attribute'): name, clsname = parse_py_signature(signode, sig, desctype, module, env) elif desctype in ('cfunction', 'cmember', 'cmacro', 'ctype', 'cvar'): name = parse_c_signature(signode, sig, desctype) @@ -503,8 +525,8 @@ def desc_directive(desctype, arguments, options, content, lineno, if desctype in ('class', 'exception') and names: env.currclass = names[0] clsname_set = True - elif desctype in ('method', 'staticmethod', 'attribute') and \ - clsname and not env.currclass: + elif desctype in ('method', 'staticmethod', 'classmethod', + 'attribute') and clsname and not env.currclass: env.currclass = clsname.strip('.') clsname_set = True # needed for association of version{added,changed} directives @@ -529,6 +551,7 @@ desctypes = [ 'data', 'class', 'method', + 'classmethod', 'staticmethod', 'attribute', 'exception', diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py index f92683a3..f19c4f9b 100644 --- a/sphinx/directives/other.py +++ b/sphinx/directives/other.py @@ -8,14 +8,13 @@ """ import re -import posixpath from docutils import nodes from docutils.parsers.rst import directives from sphinx import addnodes from sphinx.locale import pairindextypes -from sphinx.util import patfilter, ws_re, caption_ref_re +from sphinx.util import patfilter, ws_re, caption_ref_re, docname_join from sphinx.util.compat import make_admonition @@ -25,11 +24,9 @@ def toctree_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): env = state.document.settings.env suffix = env.config.source_suffix - dirname = posixpath.dirname(env.docname) glob = 'glob' in options ret = [] - subnode = addnodes.toctree() includefiles = [] includetitles = {} all_docnames = env.found_docs.copy() @@ -50,14 +47,14 @@ def toctree_directive(name, arguments, options, content, lineno, if docname.endswith(suffix): docname = docname[:-len(suffix)] # absolutize filenames - docname = posixpath.normpath(posixpath.join(dirname, docname)) + docname = docname_join(env.docname, docname) if docname not in env.found_docs: ret.append(state.document.reporter.warning( 'toctree references unknown document %r' % docname, line=lineno)) else: includefiles.append(docname) else: - patname = posixpath.normpath(posixpath.join(dirname, entry)) + patname = docname_join(env.docname, entry) docnames = sorted(patfilter(all_docnames, patname)) for docname in docnames: all_docnames.remove(docname) # don't include it again @@ -66,15 +63,18 @@ def toctree_directive(name, arguments, options, content, lineno, ret.append(state.document.reporter.warning( 'toctree glob pattern %r didn\'t match any documents' % entry, line=lineno)) + subnode = addnodes.toctree() subnode['includefiles'] = includefiles subnode['includetitles'] = includetitles subnode['maxdepth'] = options.get('maxdepth', -1) subnode['glob'] = glob + subnode['hidden'] = 'hidden' in options ret.append(subnode) return ret toctree_directive.content = 1 -toctree_directive.options = {'maxdepth': int, 'glob': directives.flag} +toctree_directive.options = {'maxdepth': int, 'glob': directives.flag, + 'hidden': directives.flag} directives.register_directive('toctree', toctree_directive) diff --git a/sphinx/environment.py b/sphinx/environment.py index ab6b1f0b..0562ce66 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -5,7 +5,11 @@ Global creation environment. +<<<<<<< local + :copyright: 2007-2009 by Georg Brandl. +======= :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. +>>>>>>> other :license: BSD, see LICENSE for details. """ @@ -15,6 +19,7 @@ import time import heapq import types import imghdr +import string import difflib import cPickle as pickle from os import path @@ -42,7 +47,8 @@ from docutils.transforms import Transform from docutils.transforms.parts import ContentsFilter from sphinx import addnodes -from sphinx.util import get_matching_docs, SEP, ustrftime +from sphinx.util import get_matching_docs, SEP, ustrftime, docname_join, \ + FilenameUniqDict from sphinx.directives import additional_xref_types default_settings = { @@ -57,7 +63,7 @@ default_settings = { # This is increased every time an environment attribute is added # or changed to properly invalidate pickle files. -ENV_VERSION = 26 +ENV_VERSION = 27 default_substitutions = set([ @@ -279,7 +285,8 @@ class BuildEnvironment: # (type, string, target, aliasname) self.versionchanges = {} # version -> list of # (type, docname, lineno, module, descname, content) - self.images = {} # absolute path -> (docnames, unique filename) + self.images = FilenameUniqDict() # absolute path -> (docnames, unique filename) + self.dlfiles = FilenameUniqDict() # absolute path -> (docnames, unique filename) # These are set while parsing a file self.docname = None # current document name @@ -291,9 +298,12 @@ class BuildEnvironment: self.gloss_entries = set() # existing definition labels # Some magically present labels - self.labels['genindex'] = ('genindex', '', _('Index')) - self.labels['modindex'] = ('modindex', '', _('Module Index')) - self.labels['search'] = ('search', '', _('Search Page')) + def add_magic_label(name, description): + self.labels[name] = (name, '', description) + self.anonlabels[name] = (name, '') + add_magic_label('genindex', _('Index')) + add_magic_label('modindex', _('Module Index')) + add_magic_label('search', _('Search Page')) def set_warnfunc(self, func): self._warnfunc = func @@ -320,6 +330,8 @@ class BuildEnvironment: self.filemodules.pop(docname, None) self.indexentries.pop(docname, None) self.glob_toctrees.discard(docname) + self.images.purge_doc(docname) + self.dlfiles.purge_doc(docname) for subfn, fnset in self.files_to_rebuild.items(): fnset.discard(docname) @@ -343,10 +355,6 @@ class BuildEnvironment: for version, changes in self.versionchanges.items(): new = [change for change in changes if change[1] != docname] changes[:] = new - for fullpath, (docs, _) in self.images.items(): - docs.discard(docname) - if not docs: - del self.images[fullpath] def doc2path(self, docname, base=True, suffix=None): """ @@ -483,12 +491,6 @@ class BuildEnvironment: self.doc2path(config.master_doc)) self.app = None - - # remove all non-existing images from inventory - for imgsrc in self.images.keys(): - if not os.access(path.join(self.srcdir, imgsrc), os.R_OK): - del self.images[imgsrc] - if app: app.emit('env-updated', self) @@ -547,6 +549,7 @@ class BuildEnvironment: self.filter_messages(doctree) self.process_dependencies(docname, doctree) self.process_images(docname, doctree) + self.process_downloads(docname, doctree) self.process_metadata(docname, doctree) self.create_title_from(docname, doctree) self.note_labels_from(docname, doctree) @@ -611,11 +614,25 @@ class BuildEnvironment: dep = path.join(docdir, dep) self.dependencies.setdefault(docname, set()).add(dep) + def process_downloads(self, docname, doctree): + """ + Process downloadable file paths. + """ + docdir = path.dirname(self.doc2path(docname, base=None)) + for node in doctree.traverse(addnodes.download_reference): + filepath = path.normpath(path.join(docdir, node['reftarget'])) + self.dependencies.setdefault(docname, set()).add(filepath) + if not os.access(path.join(self.srcdir, filepath), os.R_OK): + self.warn(docname, 'Download file not readable: %s' % filepath, + getattr(node, 'line', None)) + continue + uniquename = self.dlfiles.add_file(docname, filepath) + node['filename'] = uniquename + def process_images(self, docname, doctree): """ Process and rewrite image URIs. """ - existing_names = set(v[1] for v in self.images.itervalues()) docdir = path.dirname(self.doc2path(docname, base=None)) for node in doctree.traverse(nodes.image): # Map the mimetype to the corresponding image. The writer may @@ -659,17 +676,8 @@ class BuildEnvironment: if not os.access(path.join(self.srcdir, imgpath), os.R_OK): self.warn(docname, 'Image file not readable: %s' % imgpath, node.line) - if imgpath in self.images: - self.images[imgpath][0].add(docname) continue - uniquename = path.basename(imgpath) - base, ext = path.splitext(uniquename) - i = 0 - while uniquename in existing_names: - i += 1 - uniquename = '%s%s%s' % (base, i, ext) - self.images[imgpath] = (set([docname]), uniquename) - existing_names.add(uniquename) + self.images.add_file(docname, imgpath) def process_metadata(self, docname, doctree): """ @@ -905,6 +913,8 @@ class BuildEnvironment: If *titles_only* is True, only toplevel document titles will be in the resulting tree. """ + if toctree.get('hidden', False): + return None def _walk_depth(node, depth, maxdepth, titleoverrides): """Utility: Cut a TOC at a specified depth.""" @@ -918,7 +928,7 @@ class BuildEnvironment: else: _walk_depth(subnode, depth+1, maxdepth, titleoverrides) - def _entries_from_toctree(toctreenode, separate=False): + def _entries_from_toctree(toctreenode, separate=False, subtree=False): """Return TOC entries for a toctree node.""" includefiles = map(str, toctreenode['includefiles']) @@ -948,7 +958,7 @@ class BuildEnvironment: # resolve all sub-toctrees for toctreenode in toc.traverse(addnodes.toctree): i = toctreenode.parent.index(toctreenode) + 1 - for item in _entries_from_toctree(toctreenode): + for item in _entries_from_toctree(toctreenode, subtree=True): toctreenode.parent.insert(i, item) i += 1 toctreenode.parent.remove(toctreenode) @@ -956,12 +966,19 @@ class BuildEnvironment: entries.append(toc) else: entries.extend(toc.children) + if not subtree and not separate: + ret = nodes.bullet_list() + ret += entries + return [ret] return entries maxdepth = maxdepth or toctree.get('maxdepth', -1) titleoverrides = toctree.get('includetitles', {}) - tocentries = _entries_from_toctree(toctree, separate=True) + # NOTE: previously, this was separate=True, but that leads to artificial + # separation when two or more toctree entries form a logical unit, so + # separating mode is no longer used -- it's kept here for history's sake + tocentries = _entries_from_toctree(toctree, separate=False) if not tocentries: return None @@ -1030,6 +1047,24 @@ class BuildEnvironment: if labelid: newnode['refuri'] += '#' + labelid newnode.append(innernode) + elif typ == 'doc': + # directly reference to document by source name; can be absolute + # or relative + docname = docname_join(fromdocname, target) + if docname not in self.all_docs: + newnode = doctree.reporter.system_message( + 2, 'unknown document: %s' % docname) + else: + if node['refcaption']: + # reference with explicit title + caption = node.astext() + else: + caption = self.titles[docname].astext() + innernode = nodes.emphasis(caption, caption) + newnode = nodes.reference('', '') + newnode['refuri'] = builder.get_relative_uri( + fromdocname, docname) + newnode.append(innernode) elif typ == 'keyword': # keywords are referenced by named labels docname, labelid, _ = self.labels.get(target, ('','','')) diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index ee45a312..cf287d2f 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -13,18 +13,17 @@ import re import sys -import types import inspect import linecache -from types import FunctionType, BuiltinMethodType, MethodType +from types import FunctionType, BuiltinFunctionType, MethodType, ClassType from docutils import nodes from docutils.parsers.rst import directives from docutils.statemachine import ViewList from sphinx.util import rpartition, nested_parse_with_titles -from sphinx.directives.desc import py_sig_re +clstypes = (type, ClassType) try: base_exception = BaseException except NameError: @@ -33,20 +32,32 @@ except NameError: _charset_re = re.compile(r'coding[:=]\s*([-\w.]+)') _module_charsets = {} +py_ext_sig_re = re.compile( + r'''^ ([\w.]+::)? # explicit module name + ([\w.]+\.)? # module and/or class name(s) + (\w+) \s* # thing name + (?: \((.*)\) # optional: arguments + (?:\s* -> \s* (.*))? # return annotation + )? $ # and nothing more + ''', re.VERBOSE) + class Options(object): pass -def is_static_method(obj): - """Check if the object given is a static method.""" - if isinstance(obj, (FunctionType, classmethod)): - return True - elif isinstance(obj, BuiltinMethodType): - return obj.__self__ is not None - elif isinstance(obj, MethodType): - return obj.im_self is not None - return False +def get_method_type(obj): + """ + Return the method type for an object: method, staticmethod or classmethod. + """ + if isinstance(obj, classmethod) or \ + (isinstance(obj, MethodType) and obj.im_self is not None): + return 'classmethod' + elif isinstance(obj, FunctionType) or \ + (isinstance(obj, BuiltinFunctionType) and obj.__self__ is not None): + return 'staticmethod' + else: + return 'method' class AutodocReporter(object): @@ -282,61 +293,71 @@ class RstGenerator(object): # first, parse the definition -- auto directives for classes and functions # can contain a signature which is then used instead of an autogenerated one try: - path, base, args, retann = py_sig_re.match(name).groups() + mod, path, base, args, retann = py_ext_sig_re.match(name).groups() except: self.warn('invalid signature for auto%s (%r)' % (what, name)) - return - # fullname is the fully qualified name, base the name after the last dot - fullname = (path or '') + base + return None, [], None, None + + # support explicit module and class name separation via :: + if mod is not None: + mod = mod[:-2] + parents = path and path.rstrip('.').split('.') or [] + else: + parents = [] if what == 'module': + if mod is not None: + self.warn('"::" in automodule name doesn\'t make sense') if args or retann: self.warn('ignoring signature arguments and return annotation ' - 'for automodule %s' % fullname) - return fullname, fullname, [], None, None + 'for automodule %s' % name) + return (path or '') + base, [], None, None - elif what in ('class', 'exception', 'function'): - if path: - mod = path.rstrip('.') - else: - mod = None - # if documenting a toplevel object without explicit module, it can - # be contained in another auto directive ... - if hasattr(self.env, 'autodoc_current_module'): + elif what in ('exception', 'function', 'class'): + if mod is None: + if path: + mod = path.rstrip('.') + else: + # if documenting a toplevel object without explicit module, it can + # be contained in another auto directive ... + if hasattr(self.env, 'autodoc_current_module'): + mod = self.env.autodoc_current_module + # ... or in the scope of a module directive + if not mod: + mod = self.env.currmodule + return mod, parents + [base], args, retann + + else: + if mod is None: + if path: + mod_cls = path.rstrip('.') + else: + mod_cls = None + # if documenting a class-level object without path, there must be a + # current class, either from a parent auto directive ... + if hasattr(self.env, 'autodoc_current_class'): + mod_cls = self.env.autodoc_current_class + # ... or from a class directive + if mod_cls is None: + mod_cls = self.env.currclass + # ... if still None, there's no way to know + if mod_cls is None: + return None, [], None, None + mod, cls = rpartition(mod_cls, '.') + parents = [cls] + # if the module name is still missing, get it like above + if not mod and hasattr(self.env, 'autodoc_current_module'): mod = self.env.autodoc_current_module - # ... or in the scope of a module directive if not mod: mod = self.env.currmodule - return fullname, mod, [base], args, retann - - else: - if path: - mod_cls = path.rstrip('.') - else: - mod_cls = None - # if documenting a class-level object without path, there must be a - # current class, either from a parent auto directive ... - if hasattr(self.env, 'autodoc_current_class'): - mod_cls = self.env.autodoc_current_class - # ... or from a class directive - if mod_cls is None: - mod_cls = self.env.currclass - # ... if still None, there's no way to know - if mod_cls is None: - return fullname, None, [], args, retann - mod, cls = rpartition(mod_cls, '.') - # if the module name is still missing, get it like above - if not mod and hasattr(self.env, 'autodoc_current_module'): - mod = self.env.autodoc_current_module - if not mod: - mod = self.env.currmodule - return fullname, mod, [cls, base], args, retann + return mod, parents + [base], args, retann def format_signature(self, what, name, obj, args, retann): """ Return the signature of the object, formatted for display. """ - if what not in ('class', 'method', 'function'): + if what not in ('class', 'method', 'staticmethod', 'classmethod', + 'function'): return '' err = None @@ -361,7 +382,8 @@ class RstGenerator(object): getargs = False if getargs: argspec = inspect.getargspec(obj) - if what in ('class', 'method') and argspec[0] and \ + if what in ('class', 'method', 'staticmethod', + 'classmethod') and argspec[0] and \ argspec[0][0] in ('cls', 'self'): del argspec[0][0] args = inspect.formatargspec(*argspec) @@ -375,24 +397,27 @@ class RstGenerator(object): args, retann = result if args is not None: - return '%s%s' % (args, retann or '') + return '%s%s' % (args, retann and (' -> %s' % retann) or '') elif err: # re-raise the error for perusal of the handler in generate() raise RuntimeError(err) else: return '' - def generate(self, what, name, members, add_content, indent=u'', check_module=False): + def generate(self, what, name, members, add_content, indent=u'', check_module=False, + no_docstring=False): """ Generate reST for the object in self.result. """ - fullname, mod, objpath, args, retann = self.resolve_name(what, name) + mod, objpath, args, retann = self.resolve_name(what, name) if not mod: # need a module to import self.warn('don\'t know which module to import for autodocumenting %r ' '(try placing a "module" or "currentmodule" directive in the ' - 'document, or giving an explicit module name)' % fullname) + 'document, or giving an explicit module name)' % name) return + # fully-qualified name + fullname = mod + (objpath and '.' + '.'.join(objpath) or '') # the name to put into the generated directive -- doesn't contain the module name_in_directive = '.'.join(objpath) or mod @@ -423,7 +448,7 @@ class RstGenerator(object): # format the object's signature, if any try: - sig = self.format_signature(what, name, todoc, args, retann) + sig = self.format_signature(what, fullname, todoc, args, retann) except Exception, err: self.warn('error while formatting signature for %s: %s' % (fullname, err)) @@ -435,8 +460,10 @@ class RstGenerator(object): self.result.append(u'', '') # now, create the directive header - directive = (what == 'method' and is_static_method(todoc)) \ - and 'staticmethod' or what + if what == 'method': + directive = get_method_type(todoc) + else: + directive = what self.result.append(indent + u'.. %s:: %s%s' % (directive, name_in_directive, sig), '<autodoc>') if what == 'module': @@ -477,8 +504,9 @@ class RstGenerator(object): sourcename = 'docstring of %s' % fullname # add content from docstrings - for i, line in enumerate(self.get_doc(what, fullname, todoc)): - self.result.append(indent + line, sourcename, i) + if not no_docstring: + for i, line in enumerate(self.get_doc(what, fullname, todoc)): + self.result.append(indent + line, sourcename, i) # add source content, if present if add_content: @@ -486,7 +514,8 @@ class RstGenerator(object): self.result.append(indent + line, src[0], src[1]) # document members? - if not members or what in ('function', 'method', 'attribute'): + if not members or what in ('function', 'method', 'staticmethod', + 'classmethod', 'data', 'attribute'): return # set current namespace for finding members @@ -525,14 +554,15 @@ class RstGenerator(object): all_members = sorted(todoc.__dict__.iteritems()) else: all_members = [(mname, getattr(todoc, mname)) for mname in members] + for (membername, member) in all_members: - # ignore members whose name starts with _ by default if _all and membername.startswith('_'): - continue - - # ignore undocumented members if :undoc-members: is not given - doc = getattr(member, '__doc__', None) - skip = not self.options.undoc_members and not doc + # ignore members whose name starts with _ by default + skip = True + else: + # ignore undocumented members if :undoc-members: is not given + doc = getattr(member, '__doc__', None) + skip = not self.options.undoc_members and not doc # give the user a chance to decide whether this member should be skipped if self.env.app: # let extensions preprocess docstrings @@ -543,13 +573,17 @@ class RstGenerator(object): if skip: continue + content = None if what == 'module': - if isinstance(member, (types.FunctionType, - types.BuiltinFunctionType)): + if isinstance(member, (FunctionType, BuiltinFunctionType)): memberwhat = 'function' - elif isinstance(member, types.ClassType) or \ - isinstance(member, type): - if issubclass(member, base_exception): + elif isinstance(member, clstypes): + if member.__name__ != membername: + # assume it's aliased + memberwhat = 'data' + content = ViewList([_('alias of :class:`%s`') % member.__name__], + source='') + elif issubclass(member, base_exception): memberwhat = 'exception' else: memberwhat = 'class' @@ -557,16 +591,27 @@ class RstGenerator(object): # XXX: todo -- attribute docs continue else: - if callable(member): + if isinstance(member, clstypes): + if member.__name__ != membername: + # assume it's aliased + memberwhat = 'attribute' + content = ViewList([_('alias of :class:`%s`') % member.__name__], + source='') + else: + memberwhat = 'class' + elif inspect.isroutine(member): memberwhat = 'method' elif isdescriptor(member): memberwhat = 'attribute' else: # XXX: todo -- attribute docs continue - full_membername = fullname + '.' + membername - self.generate(memberwhat, full_membername, ['__all__'], None, indent, - check_module=members_check_module) + # give explicitly separated module name, so that members of inner classes + # can be documented + full_membername = mod + '::' + '.'.join(objpath + [membername]) + self.generate(memberwhat, full_membername, ['__all__'], + add_content=content, no_docstring=bool(content), + indent=indent, check_module=members_check_module) self.env.autodoc_current_module = None self.env.autodoc_current_class = None @@ -641,6 +686,8 @@ def setup(app): 1, (1, 0, 1), **cls_options) app.add_directive('autoexception', autoclass_directive, 1, (1, 0, 1), **cls_options) + app.add_directive('autodata', auto_directive, 1, (1, 0, 1), + noindex=directives.flag) app.add_directive('autofunction', auto_directive, 1, (1, 0, 1), noindex=directives.flag) app.add_directive('automethod', auto_directive, 1, (1, 0, 1), diff --git a/sphinx/ext/coverage.py b/sphinx/ext/coverage.py index c26a1cfd..a3dc5889 100644 --- a/sphinx/ext/coverage.py +++ b/sphinx/ext/coverage.py @@ -16,7 +16,7 @@ import inspect import cPickle as pickle from os import path -from sphinx.builder import Builder +from sphinx.builders import Builder # utility diff --git a/sphinx/ext/doctest.py b/sphinx/ext/doctest.py index 3a44c3f7..d6697f98 100644 --- a/sphinx/ext/doctest.py +++ b/sphinx/ext/doctest.py @@ -22,7 +22,7 @@ doctest = __import__('doctest') from docutils import nodes from docutils.parsers.rst import directives -from sphinx.builder import Builder +from sphinx.builders import Builder from sphinx.util.console import bold blankline_re = re.compile(r'^\s*<BLANKLINE>', re.MULTILINE) @@ -99,9 +99,12 @@ class TestGroup(object): self.setup = [] self.tests = [] - def add_code(self, code): + def add_code(self, code, prepend=False): if code.type == 'testsetup': - self.setup.append(code) + if prepend: + self.setup.insert(0, code) + else: + self.setup.append(code) elif code.type == 'doctest': self.tests.append([code]) elif code.type == 'testcode': @@ -258,6 +261,10 @@ Doctest summary for code in add_to_all_groups: for group in groups.itervalues(): group.add_code(code) + if self.config.doctest_global_setup: + code = TestCode(self.config.doctest_global_setup, 'testsetup', lineno=0) + for group in groups.itervalues(): + group.add_code(code, prepend=True) if not groups: return @@ -335,3 +342,4 @@ def setup(app): # this config value adds to sys.path app.add_config_value('doctest_path', [], False) app.add_config_value('doctest_test_doctest_blocks', 'default', False) + app.add_config_value('doctest_global_setup', '', False) diff --git a/sphinx/ext/intersphinx.py b/sphinx/ext/intersphinx.py index 463f5437..47ebceb3 100644 --- a/sphinx/ext/intersphinx.py +++ b/sphinx/ext/intersphinx.py @@ -31,7 +31,7 @@ from os import path from docutils import nodes -from sphinx.builder import INVENTORY_FILENAME +from sphinx.builders.html import INVENTORY_FILENAME def fetch_inventory(app, uri, inv): diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index fe82b0bc..c818af30 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -30,6 +30,8 @@ try: from pygments.token import Generic, Comment, Number except ImportError: pygments = None + lexers = None + HtmlFormatter = LatexFormatter = None else: class SphinxStyle(Style): """ @@ -81,6 +83,11 @@ if sys.version_info < (2, 5): class PygmentsBridge(object): + # Set these attributes if you want to have different Pygments formatters + # than the default ones. + html_formatter = HtmlFormatter + latex_formatter = LatexFormatter + def __init__(self, dest='html', stylename='sphinx'): self.dest = dest if not pygments: @@ -89,14 +96,17 @@ class PygmentsBridge(object): style = SphinxStyle elif '.' in stylename: module, stylename = stylename.rsplit('.', 1) - style = getattr(__import__(module, None, None, ['']), stylename) + style = getattr(__import__(module, None, None, ['__name__']), stylename) else: style = get_style_by_name(stylename) - self.hfmter = {False: HtmlFormatter(style=style), - True: HtmlFormatter(style=style, linenos=True)} - self.lfmter = {False: LatexFormatter(style=style, commandprefix='PYG'), - True: LatexFormatter(style=style, linenos=True, - commandprefix='PYG')} + if dest == 'html': + self.fmter = {False: self.html_formatter(style=style), + True: self.html_formatter(style=style, linenos=True)} + else: + self.fmter = {False: self.latex_formatter(style=style, + commandprefix='PYG'), + True: self.latex_formatter(style=style, linenos=True, + commandprefix='PYG')} def unhighlighted(self, source): if self.dest == 'html': @@ -170,9 +180,9 @@ class PygmentsBridge(object): lexer.add_filter('raiseonerror') try: if self.dest == 'html': - return highlight(source, lexer, self.hfmter[bool(linenos)]) + return highlight(source, lexer, self.fmter[bool(linenos)]) else: - hlsource = highlight(source, lexer, self.lfmter[bool(linenos)]) + hlsource = highlight(source, lexer, self.fmter[bool(linenos)]) return hlsource.translate(tex_hl_escape_map) except ErrorToken: # this is most probably not the selected language, @@ -186,9 +196,9 @@ class PygmentsBridge(object): # no HTML styles needed return '' if self.dest == 'html': - return self.hfmter[0].get_style_defs() + return self.fmter[0].get_style_defs() else: - styledefs = self.lfmter[0].get_style_defs() + styledefs = self.fmter[0].get_style_defs() # workaround for Pygments < 0.12 if styledefs.startswith('\\newcommand\\at{@}'): styledefs += _LATEX_STYLES diff --git a/sphinx/htmlhelp.py b/sphinx/htmlhelp.py deleted file mode 100644 index 84ef31d9..00000000 --- a/sphinx/htmlhelp.py +++ /dev/null @@ -1,220 +0,0 @@ -# -*- coding: utf-8 -*- -""" - sphinx.htmlhelp - ~~~~~~~~~~~~~~~ - - Build HTML help support files. - Adapted from the original Doc/tools/prechm.py. - - :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import os -import cgi -from os import path - -from docutils import nodes - -from sphinx import addnodes - -# Project file (*.hhp) template. 'outname' is the file basename (like -# the pythlp in pythlp.hhp); 'version' is the doc version number (like -# the 2.2 in Python 2.2). -# The magical numbers in the long line under [WINDOWS] set most of the -# user-visible features (visible buttons, tabs, etc). -# About 0x10384e: This defines the buttons in the help viewer. The -# following defns are taken from htmlhelp.h. Not all possibilities -# actually work, and not all those that work are available from the Help -# Workshop GUI. In particular, the Zoom/Font button works and is not -# available from the GUI. The ones we're using are marked with 'x': -# -# 0x000002 Hide/Show x -# 0x000004 Back x -# 0x000008 Forward x -# 0x000010 Stop -# 0x000020 Refresh -# 0x000040 Home x -# 0x000080 Forward -# 0x000100 Back -# 0x000200 Notes -# 0x000400 Contents -# 0x000800 Locate x -# 0x001000 Options x -# 0x002000 Print x -# 0x004000 Index -# 0x008000 Search -# 0x010000 History -# 0x020000 Favorites -# 0x040000 Jump 1 -# 0x080000 Jump 2 -# 0x100000 Zoom/Font x -# 0x200000 TOC Next -# 0x400000 TOC Prev - -project_template = '''\ -[OPTIONS] -Binary TOC=Yes -Binary Index=No -Compiled file=%(outname)s.chm -Contents file=%(outname)s.hhc -Default Window=%(outname)s -Default topic=index.html -Display compile progress=No -Full text search stop list file=%(outname)s.stp -Full-text search=Yes -Index file=%(outname)s.hhk -Language=0x409 -Title=%(title)s - -[WINDOWS] -%(outname)s="%(title)s","%(outname)s.hhc","%(outname)s.hhk",\ -"index.html","index.html",,,,,0x63520,220,0x10384e,[0,0,1024,768],,,,,,,0 - -[FILES] -''' - -contents_header = '''\ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<HTML> -<HEAD> -<meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1"> -<!-- Sitemap 1.0 --> -</HEAD><BODY> -<OBJECT type="text/site properties"> - <param name="Window Styles" value="0x801227"> - <param name="ImageType" value="Folder"> -</OBJECT> -<UL> -''' - -contents_footer = '''\ -</UL></BODY></HTML> -''' - -object_sitemap = '''\ -<OBJECT type="text/sitemap"> - <param name="Name" value="%s"> - <param name="Local" value="%s"> -</OBJECT> -''' - -# List of words the full text search facility shouldn't index. This -# becomes file outname.stp. Note that this list must be pretty small! -# Different versions of the MS docs claim the file has a maximum size of -# 256 or 512 bytes (including \r\n at the end of each line). -# Note that "and", "or", "not" and "near" are operators in the search -# language, so no point indexing them even if we wanted to. -stopwords = """ -a and are as at -be but by -for -if in into is it -near no not -of on or -such -that the their then there these they this to -was will with -""".split() - - -def build_hhx(builder, outdir, outname): - builder.info('dumping stopword list...') - f = open(path.join(outdir, outname+'.stp'), 'w') - try: - for word in sorted(stopwords): - print >>f, word - finally: - f.close() - - builder.info('writing project file...') - f = open(path.join(outdir, outname+'.hhp'), 'w') - try: - f.write(project_template % {'outname': outname, - 'title': builder.config.html_title, - 'version': builder.config.version, - 'project': builder.config.project}) - if not outdir.endswith(os.sep): - outdir += os.sep - olen = len(outdir) - for root, dirs, files in os.walk(outdir): - staticdir = (root == path.join(outdir, '_static')) - for fn in files: - if (staticdir and not fn.endswith('.js')) or fn.endswith('.html'): - print >>f, path.join(root, fn)[olen:].replace(os.sep, '\\') - finally: - f.close() - - builder.info('writing TOC file...') - f = open(path.join(outdir, outname+'.hhc'), 'w') - try: - f.write(contents_header) - # special books - f.write('<LI> ' + object_sitemap % (builder.config.html_short_title, - 'index.html')) - if builder.config.html_use_modindex: - f.write('<LI> ' + object_sitemap % (_('Global Module Index'), - 'modindex.html')) - # the TOC - tocdoc = builder.env.get_and_resolve_doctree(builder.config.master_doc, builder, - prune_toctrees=False) - def write_toc(node, ullevel=0): - if isinstance(node, nodes.list_item): - f.write('<LI> ') - for subnode in node: - write_toc(subnode, ullevel) - elif isinstance(node, nodes.reference): - link = node['refuri'] - title = cgi.escape(node.astext()).replace('"','"') - item = object_sitemap % (title, link) - f.write(item.encode('ascii', 'xmlcharrefreplace')) - elif isinstance(node, nodes.bullet_list): - if ullevel != 0: - f.write('<UL>\n') - for subnode in node: - write_toc(subnode, ullevel+1) - if ullevel != 0: - f.write('</UL>\n') - elif isinstance(node, addnodes.compact_paragraph): - for subnode in node: - write_toc(subnode, ullevel) - istoctree = lambda node: isinstance(node, addnodes.compact_paragraph) and \ - node.has_key('toctree') - for node in tocdoc.traverse(istoctree): - write_toc(node) - f.write(contents_footer) - finally: - f.close() - - builder.info('writing index file...') - index = builder.env.create_index(builder) - f = open(path.join(outdir, outname+'.hhk'), 'w') - try: - f.write('<UL>\n') - def write_index(title, refs, subitems): - def write_param(name, value): - item = ' <param name="%s" value="%s">\n' % (name, value) - f.write(item.encode('ascii', 'xmlcharrefreplace')) - title = cgi.escape(title) - f.write('<LI> <OBJECT type="text/sitemap">\n') - write_param('Keyword', title) - if len(refs) == 0: - write_param('See Also', title) - elif len(refs) == 1: - write_param('Local', refs[0]) - else: - for i, ref in enumerate(refs): - write_param('Name', '[%d] %s' % (i, ref)) # XXX: better title? - write_param('Local', ref) - f.write('</OBJECT>\n') - if subitems: - f.write('<UL> ') - for subitem in subitems: - write_index(subitem[0], subitem[1], []) - f.write('</UL>') - for (key, group) in index: - for title, (refs, subitems) in group: - write_index(title, refs, subitems) - f.write('</UL>\n') - finally: - f.close() diff --git a/sphinx/jinja2glue.py b/sphinx/jinja2glue.py new file mode 100644 index 00000000..996df70b --- /dev/null +++ b/sphinx/jinja2glue.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +""" + sphinx.jinja2glue + ~~~~~~~~~~~~~~~~~ + + Glue code for the jinja2 templating engine. + + :copyright: 2008 by Sebastian Wiesner. + :license: BSD, see LICENSE for details. +""" + +import codecs +from os import path + +import jinja2 + +from sphinx.util import mtimes_of_files +from sphinx.application import TemplateBridge + + +class SphinxLoader(jinja2.BaseLoader): + """ + A jinja2 reimplementation of `sphinx._jinja.SphinxFileSystemLoader`. + """ + + def __init__(self, basepath, extpaths, encoding='utf-8'): + """ + Create a new loader for sphinx. + + *extpaths* is a list of directories, which provide additional templates + to sphinx. + + *encoding* is used to decode the templates into unicode strings. + Defaults to utf-8. + + If *basepath* is set, this path is used to load sphinx core templates. + If False, these templates are loaded from the sphinx package. + """ + self.core_loader = jinja2.FileSystemLoader(basepath) + self.all_loaders = jinja2.ChoiceLoader( + [jinja2.FileSystemLoader(extpath) for extpath in extpaths] + + [self.core_loader]) + + def get_source(self, environment, template): + # exclamation mark forces loading from core + if template.startswith('!'): + return self.core_loader.get_source(environment, template[1:]) + # check if the template is probably an absolute path + fs_path = template.replace('/', path.sep) + if path.isabs(fs_path): + if not path.exists(fs_path): + raise jinja2.TemplateNotFound(template) + f = codecs.open(fs_path, 'r', self.encoding) + try: + mtime = path.getmtime(path) + return (f.read(), fs_path, + lambda: mtime == path.getmtime(path)) + finally: + f.close() + # finally try to load from custom templates + return self.all_loaders.get_source(environment, template) + + +class BuiltinTemplates(TemplateBridge): + """ + Interfaces the rendering environment of jinja2 for use in sphinx. + """ + + def init(self, builder): + base_templates_path = path.join(path.dirname(__file__), 'templates') + ext_templates_path = [path.join(builder.confdir, dir) + for dir in builder.config.templates_path] + self.templates_path = [base_templates_path] + ext_templates_path + loader = SphinxLoader(base_templates_path, ext_templates_path) + use_i18n = builder.translator is not None + extensions = use_i18n and ['jinja2.ext.i18n'] or [] + self.environment = jinja2.Environment(loader=loader, + extensions=extensions) + if use_i18n: + self.environment.install_gettext_translations(builder.translator) + + def render(self, template, context): + return self.environment.get_template(template).render(context) + + def newest_template_mtime(self): + return max(mtimes_of_files(self.templates_path, '.html')) diff --git a/sphinx/locale/cs/LC_MESSAGES/sphinx.js b/sphinx/locale/cs/LC_MESSAGES/sphinx.js index 4b814e4f..0684899d 100644 --- a/sphinx/locale/cs/LC_MESSAGES/sphinx.js +++ b/sphinx/locale/cs/LC_MESSAGES/sphinx.js @@ -1 +1 @@ -Documentation.addTranslations({"locale": "cs", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"module, in ": "modul", "Preparing search...": "", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "", "Search finished, found %s page(s) matching the search query.": "", ", in ": "", "Permalink to this headline": "Trval\u00fd odkaz na tento nadpis", "Searching": "hledej", "Permalink to this definition": "Trval\u00fd odkaz na tuto definici", "Hide Search Matches": "", "Search Results": "V\u00fdsledky hled\u00e1n\u00ed"}});
\ No newline at end of file +Documentation.addTranslations({"locale": "cs", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"module, in ": "modul, v", "Preparing search...": "Připravuji hledání...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Nenalezli jsme žádný dokument. Ujistěte se prosím, že všechna slova jsou správně.", "Search finished, found %s page(s) matching the search query.": "Vyhledávání skončilo, nalezeno %s stran.", ", in ": ", v", "Permalink to this headline": "Trvalý odkaz na tento nadpis", "Searching": "Hledám", "Permalink to this definition": "Trvalý odkaz na tuto definici", "Hide Search Matches": "Skrýt výsledky hledání", "Search Results": "Výsledky hledání"}});
diff --git a/sphinx/locale/cs/LC_MESSAGES/sphinx.mo b/sphinx/locale/cs/LC_MESSAGES/sphinx.mo Binary files differindex c50de3db..fd97a57e 100644 --- a/sphinx/locale/cs/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/cs/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/cs/LC_MESSAGES/sphinx.po b/sphinx/locale/cs/LC_MESSAGES/sphinx.po index b6936022..0d11dded 100644 --- a/sphinx/locale/cs/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/cs/LC_MESSAGES/sphinx.po @@ -7,23 +7,25 @@ msgid "" msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2008-08-10 11:43+0000\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"POT-Creation-Date: 2008-11-27 18:39+0100\n" +"PO-Revision-Date: 2008-12-25 05:59+0100\n" "Last-Translator: Pavel Kosina <pavel.kosina@gmail.com>\n" "Language-Team: Pavel Kosina <pavel.kosina@gmail.com>\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " -"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" "Generated-By: Babel 0.9.4\n" +"X-Poedit-Language: Czech\n" +"X-Poedit-Country: CZECH REPUBLIC\n" #: sphinx/builder.py:408 #, python-format msgid "%b %d, %Y" msgstr "%d.%m.%Y" -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 +#: sphinx/builder.py:427 +#: sphinx/templates/defindex.html:21 msgid "General Index" msgstr "Rejstřík indexů" @@ -31,11 +33,13 @@ msgstr "Rejstřík indexů" msgid "index" msgstr "index" -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 +#: sphinx/builder.py:429 +#: sphinx/htmlhelp.py:156 +#: sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 #: sphinx/templates/modindex.html:13 msgid "Global Module Index" -msgstr "Rejstřík modulů" +msgstr "Celkový rejstřík modulů" #: sphinx/builder.py:429 msgid "modules" @@ -51,45 +55,51 @@ msgstr "předchozí" #: sphinx/builder.py:1054 msgid " (in " -msgstr "" +msgstr "(v" #: sphinx/builder.py:1129 msgid "Builtins" -msgstr "Vestavěné funkce" +msgstr "Vestavěné funkce " #: sphinx/builder.py:1131 msgid "Module level" msgstr "Úroveň modulů" -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:102 +#: sphinx/latexwriter.py:169 #, python-format msgid "%B %d, %Y" msgstr "%d.%m.%Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 +#: sphinx/environment.py:291 +#: sphinx/latexwriter.py:175 #: sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 -#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 -#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/genindex-split.html:5 +#: sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 +#: sphinx/templates/genindex.html:48 #: sphinx/templates/layout.html:130 msgid "Index" msgstr "Index" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 -#, fuzzy +#: sphinx/environment.py:292 +#: sphinx/latexwriter.py:174 msgid "Module Index" -msgstr "Rejstřík modulů" +msgstr "Rejstřík modulů " -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 -#, fuzzy +#: sphinx/environment.py:293 +#: sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Vyhledávací stránka" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 +#: sphinx/htmlwriter.py:79 +#: sphinx/static/doctools.js:145 msgid "Permalink to this definition" msgstr "Trvalý odkaz na tuto definici" -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 +#: sphinx/htmlwriter.py:399 +#: sphinx/static/doctools.js:139 msgid "Permalink to this headline" msgstr "Trvalý odkaz na tento nadpis" @@ -97,7 +107,8 @@ msgstr "Trvalý odkaz na tento nadpis" msgid "Release" msgstr "Vydání" -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 +#: sphinx/directives/desc.py:537 #, python-format msgid "environment variable; %s" msgstr "promměná prostředí, %s" @@ -121,7 +132,8 @@ msgstr "[obrázek]" msgid "%s() (built-in function)" msgstr "%s() (vestavěná funkce)" -#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:26 +#: sphinx/directives/desc.py:42 #: sphinx/directives/desc.py:54 #, python-format msgid "%s() (in module %s)" @@ -132,15 +144,16 @@ msgstr "%s() (v modulu %s)" msgid "%s (built-in variable)" msgstr "%s() (vestavěná proměnná)" -#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 +#: sphinx/directives/desc.py:30 +#: sphinx/directives/desc.py:66 #, python-format msgid "%s (in module %s)" msgstr "%s() (v modulu %s)" #: sphinx/directives/desc.py:33 -#, fuzzy, python-format +#, python-format msgid "%s (built-in class)" -msgstr "%s() (vestavěná proměnná)" +msgstr "%s () (vestavěná proměnná)" #: sphinx/directives/desc.py:34 #, python-format @@ -223,9 +236,9 @@ msgid "Parameters" msgstr "Parametry" #: sphinx/directives/desc.py:423 -#, fuzzy, python-format +#, python-format msgid "%scommand line option; %s" -msgstr "%sparametry příkazového řádku; %s" +msgstr "%s parametry příkazového řádku; %s" #: sphinx/directives/other.py:101 msgid "Platforms: " @@ -254,16 +267,16 @@ msgstr "Viz také" #: sphinx/ext/todo.py:31 msgid "Todo" -msgstr "" +msgstr "Todo" #: sphinx/ext/todo.py:75 #, python-format msgid "(The original entry is located in %s, line %d and can be found " -msgstr "" +msgstr "(Původní záznam je v %s, řádka %d a lze jej nalézt" #: sphinx/ext/todo.py:81 msgid "here" -msgstr "" +msgstr "zde" #: sphinx/locale/__init__.py:15 msgid "Attention" @@ -350,40 +363,37 @@ msgstr "vestavěná funkce" #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" -msgstr "" +msgstr "Skrýt výsledky vyhledávání" #: sphinx/static/searchtools.js:274 -#, fuzzy msgid "Searching" -msgstr "hledej" +msgstr "Hledám" #: sphinx/static/searchtools.js:279 msgid "Preparing search..." -msgstr "" +msgstr "Připravuji vyhledávání...." #: sphinx/static/searchtools.js:338 -#, fuzzy msgid "module, in " -msgstr "modul" +msgstr "modul, v" #: sphinx/static/searchtools.js:347 msgid ", in " -msgstr "" +msgstr ", v" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:447 +#: sphinx/templates/search.html:18 msgid "Search Results" msgstr "Výsledky hledání" #: sphinx/static/searchtools.js:449 -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 "" +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 "Nenalezli jsme žádný dokument. Ujistěte se prosím, že všechna slova jsou správně a že jste vybral dostatek kategorií." #: sphinx/static/searchtools.js:451 #, python-format msgid "Search finished, found %s page(s) matching the search query." -msgstr "" +msgstr "Vyhledávání skončilo, nalezeno %s stran." #: sphinx/templates/defindex.html:2 msgid "Overview" @@ -420,7 +430,8 @@ msgstr "Index – %(key)s" #: sphinx/templates/genindex-single.html:44 #: sphinx/templates/genindex-split.html:14 -#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54 +#: sphinx/templates/genindex-split.html:27 +#: sphinx/templates/genindex.html:54 msgid "Full index on one page" msgstr "Plný index na jedné stránce" @@ -464,7 +475,8 @@ msgstr "Tato stránka" msgid "Suggest Change" msgstr "Návrh změnu" -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:60 +#: sphinx/templates/layout.html:62 msgid "Show Source" msgstr "Ukázat zdroj" @@ -493,7 +505,8 @@ msgstr "Hledání uvnitř %(docstitle)s" msgid "About these documents" msgstr "O těchto dokumentech" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:131 +#: sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Hledání" @@ -515,16 +528,12 @@ msgstr "© Copyright %(copyright)s." #: sphinx/templates/layout.html:183 #, python-format msgid "Last updated on %(last_updated)s." -msgstr "Naposledy aktualizováno dne %(last_updated)s." +msgstr "Aktualizováno dne %(last_updated)s." #: sphinx/templates/layout.html:186 #, python-format -msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " -"%(sphinx_version)s." -msgstr "" -"Vytvořeno pomocí <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " -"%(sphinx_version)s." +msgid "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s." +msgstr "Vytvořeno pomocí <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s." #: sphinx/templates/modindex.html:15 msgid "Most popular modules:" @@ -544,27 +553,18 @@ msgid "Search %(docstitle)s" msgstr "Prohledat %(docstitle)s" #: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Poznámka:</strong> Stránka, kterou hledáte, " -"neexistuje.<br>Snažili jsme se najít nové umístění této stránky, ale " -"nepovedlo se." +msgid "<strong>Note:</strong> You requested an out-of-date URL from this server. We've tried to redirect you to the new location of this page, but it may not be the right one." +msgstr "<strong>Poznámka:</strong> Stránka, kterou hledáte, neexistuje.<br>Snažili jsme se najít nové umístění této stránky, ale nepovedlo se." #: sphinx/templates/search.html:7 -#, fuzzy 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 "" -"Toto je vyhledávací stránka. Zadejte klíčová slova do pole níže a " -"klikněte na \"hledej\". \n" -"Prohledávání funkcí hledá automaticky všechna slova. Stránky obsahující" -" slov méně, nebudou nalezeny." +"Toto je vyhledávací stránka. Zadejte klíčová slova a klikněte na \"hledej\". \n" +"Vyhledávání hledá automaticky všechna slova. Nebudou tedy nalezeny stránky, obsahující méně slov." #: sphinx/templates/search.html:14 msgid "search" diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.po b/sphinx/locale/de/LC_MESSAGES/sphinx.po index 5fdd4a96..2fac78d9 100644 --- a/sphinx/locale/de/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/de/LC_MESSAGES/sphinx.po @@ -7,93 +7,37 @@ msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2008-08-07 21:40+0200\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Horst Gutmann <zerok@zerokspot.com>\n" "Language-Team: de <LL@li.org>\n" "Plural-Forms: nplurals=2; plural=(n != 1)\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" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%d. %m. %Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "Allgemeiner Index" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "Index" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "Globaler Modulindex" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "Module" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "weiter" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "zurück" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "" - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "Builtins" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "Modulebene" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%d. %m. %Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "Stichwortverzeichnis" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "Modulindex" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Suche" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Permalink zu dieser Definition" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Permalink zu dieser Überschrift" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "Release" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "Umgebungsvariable; %s" @@ -103,14 +47,48 @@ msgstr "Umgebungsvariable; %s" msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Builtins" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Modulebene" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Plattform: %s" +msgid "%b %d, %Y" +msgstr "%d. %m. %Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[Bild]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Allgemeiner Index" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "Index" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Globaler Modulindex" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "Module" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "weiter" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "zurück" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "" #: sphinx/directives/desc.py:25 #, python-format @@ -214,11 +192,16 @@ msgstr "Rückgabe" msgid "Return type" msgstr "Rückgabetyp" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Parameter" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Parameter" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, python-format msgid "%scommand line option; %s" msgstr "%sKommandozeilenoption; %s" @@ -244,10 +227,15 @@ msgstr "Autor des Moduls: " msgid "Author: " msgstr "Autor: " -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Siehe auch" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "" @@ -344,6 +332,14 @@ msgstr "Statement" msgid "built-in function" msgstr "eingebaute Funktion" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Permalink zu dieser Überschrift" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Permalink zu dieser Definition" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Suchergebnisse ausblenden" @@ -364,11 +360,11 @@ msgstr "Modul, in " msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Suchergebnisse" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -376,7 +372,7 @@ msgstr "" "Es wurden keine Dokumente gefunden. Haben Sie alle Suchworte richtig " "geschrieben und genügend Kategorien ausgewählt?" -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "Suche beendet, %s Seite(n) mit Ergebnissen wurden gefunden." @@ -452,68 +448,61 @@ msgstr "Nächstes Thema" msgid "next chapter" msgstr "nächstes Kapitel" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Diese Seite" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Änderung vorschlagen" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Quelltext anzeigen" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Schnellsuche" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Stichwortsuche" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Los" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Gib einen Modul-, Klassen- oder Funktionsnamen an." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Suche in %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "Über diese Dokumentation" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Suche" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Copyright" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Zuletzt aktualisiert am %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -522,15 +511,7 @@ msgstr "" "Mit <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s " "erstellt." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "Beliebteste Module:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "Zeige nur Module, die auf diesen Plattformen verfügbar sind" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Veraltet" @@ -539,16 +520,6 @@ msgstr "Veraltet" msgid "Search %(docstitle)s" msgstr "Suche in %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Anmerkung:</strong> Du hast eine nicht länger gültige URL von " -"diesem Server angefragt. Wir haben versucht dich auf die neue Adresse " -"dieser Seite umzuleiten, aber dies muss nicht die richtige Seite sein." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -599,3 +570,42 @@ msgstr "C API-Änderungen" msgid "Other changes" msgstr "Andere Änderungen" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "Release" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Plattform: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[Bild]" + +#~ msgid "Suggest Change" +#~ msgstr "Änderung vorschlagen" + +#~ msgid "Keyword search" +#~ msgstr "Stichwortsuche" + +#~ msgid "Most popular modules:" +#~ msgstr "Beliebteste Module:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Zeige nur Module, die auf diesen Plattformen verfügbar sind" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Anmerkung:</strong> Du hast eine nicht" +#~ " länger gültige URL von diesem Server" +#~ " angefragt. Wir haben versucht dich " +#~ "auf die neue Adresse dieser Seite " +#~ "umzuleiten, aber dies muss nicht die " +#~ "richtige Seite sein." + diff --git a/sphinx/locale/es/LC_MESSAGES/sphinx.po b/sphinx/locale/es/LC_MESSAGES/sphinx.po index 288e0090..f50a34cc 100644 --- a/sphinx/locale/es/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/es/LC_MESSAGES/sphinx.po @@ -8,96 +8,37 @@ msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: guillem@torroja.dmt.upm.es\n" "POT-Creation-Date: 2008-09-11 23:58+0200\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Guillem Borrell <guillem@torroja.dmt.upm.es>\n" "Language-Team: es <LL@li.org>\n" "Plural-Forms: nplurals=2; plural=(n != 1)\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" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%d %b, %Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "Índice General" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "índice" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "Índice Global de Módulos" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "módulos" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "siguiente" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "anterior" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "" - -#: sphinx/builder.py:1129 -#, fuzzy -msgid "Builtins" -msgstr "Funciones de base" - -#: sphinx/builder.py:1131 -#, fuzzy -msgid "Module level" -msgstr "Módulos" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, fuzzy, python-format msgid "%B %d, %Y" msgstr "%d de %B de %Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "Índice" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "Índice de Módulos" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Página de Búsqueda" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Enlazar permanentemente con esta definición" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Enlazar permanentemente con este título" - -#: sphinx/latexwriter.py:172 -#, fuzzy -msgid "Release" -msgstr "Versión" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "variables de entorno; %s" @@ -107,14 +48,50 @@ msgstr "variables de entorno; %s" msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +#, fuzzy +msgid "Builtins" +msgstr "Funciones de base" + +#: sphinx/builders/changes.py:66 +#, fuzzy +msgid "Module level" +msgstr "Módulos" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Plataforma: %s" +msgid "%b %d, %Y" +msgstr "%d %b, %Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[imagen]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Índice General" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "índice" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Índice Global de Módulos" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "módulos" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "siguiente" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "anterior" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "" #: sphinx/directives/desc.py:25 #, fuzzy, python-format @@ -219,11 +196,16 @@ msgstr "Devuelve" msgid "Return type" msgstr "Tipo del argumento devuelto" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Parámetros" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Parámetros" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, fuzzy, python-format msgid "%scommand line option; %s" msgstr "%sOpciones en línea de comandos; %s" @@ -249,10 +231,15 @@ msgstr "Autor del módulo" msgid "Author: " msgstr "Autor:" -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Ver también" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "" @@ -350,6 +337,14 @@ msgstr "sentencia" msgid "built-in function" msgstr "función de base" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Enlazar permanentemente con este título" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Enlazar permanentemente con esta definición" + #: sphinx/static/doctools.js:174 #, fuzzy msgid "Hide Search Matches" @@ -372,11 +367,11 @@ msgstr "módulo" msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Resultados de la búsqueda" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -385,7 +380,7 @@ msgstr "" "todas las palabras correctamente y que ha seleccionado suficientes " "categorías" -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "" @@ -463,68 +458,61 @@ msgstr "Próximo tema" msgid "next chapter" msgstr "Próximo capítulo" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Esta página" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Sugerir una modificación" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Enseñar el código" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Búsqueda rápida" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Búsqueda por palabras clave" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Ir a" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Introducir en nombre de un módulo, clase o función" -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Buscar en %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "Sobre este documento" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Búsqueda" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Copyright" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\\\"%(path)s\\\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Actualizado por última vez en %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -533,15 +521,7 @@ msgstr "" "Creado con <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "Módulos más comunes:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "Mostrar sólo los módulos disponibles en estas plataformas" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Obsoleto" @@ -550,16 +530,6 @@ msgstr "Obsoleto" msgid "Search %(docstitle)s" msgstr "Buscar en %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Nota:</strong> Has solicitado una dirección desactualizada a este" -" servidor. Hemos intentado redirigirte a la nueva dirección de la misma " -"página pero puede no ser la correcta." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -609,3 +579,42 @@ msgstr "Cambios en la API C" msgid "Other changes" msgstr "Otros cambios" +#: sphinx/writers/latex.py:173 +#, fuzzy +msgid "Release" +msgstr "Versión" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Plataforma: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[imagen]" + +#~ msgid "Suggest Change" +#~ msgstr "Sugerir una modificación" + +#~ msgid "Keyword search" +#~ msgstr "Búsqueda por palabras clave" + +#~ msgid "Most popular modules:" +#~ msgstr "Módulos más comunes:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Mostrar sólo los módulos disponibles en estas plataformas" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Nota:</strong> Has solicitado una " +#~ "dirección desactualizada a este servidor. " +#~ "Hemos intentado redirigirte a la nueva" +#~ " dirección de la misma página pero" +#~ " puede no ser la correcta." + diff --git a/sphinx/locale/fr/LC_MESSAGES/sphinx.po b/sphinx/locale/fr/LC_MESSAGES/sphinx.po index 0d92cc35..c715e626 100644 --- a/sphinx/locale/fr/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/fr/LC_MESSAGES/sphinx.po @@ -9,93 +9,37 @@ msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: larlet@gmail.com\n" "POT-Creation-Date: 2008-08-08 12:39+0000\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Sébastien Douche <sdouche@gmail.com>\n" "Language-Team: French Translation Team <sphinx-dev@googlegroups.com>\n" "Plural-Forms: nplurals=2; plural=(n > 1)\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" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%d %b %Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "Index général" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "index" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "Index général des modules" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "modules" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "suivant" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "précédent" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "(dans" - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "Fonctions de base" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "Module" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%d %B %Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "Index" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "Index du module" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Page de recherche" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Lien permanent vers cette définition" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Lien permanent vers ce titre" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "Version" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "variable d'environnement; %s" @@ -105,14 +49,48 @@ msgstr "variable d'environnement; %s" msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Fonctions de base" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Module" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Plateforme : %s" +msgid "%b %d, %Y" +msgstr "%d %b %Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[image]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Index général" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "index" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Index général des modules" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "modules" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "suivant" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "précédent" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "(dans" #: sphinx/directives/desc.py:25 #, python-format @@ -216,11 +194,16 @@ msgstr "Retourne" msgid "Return type" msgstr "Type retourné" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Paramètres" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Paramètres" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, python-format msgid "%scommand line option; %s" msgstr "%soption de ligne de commande; %s" @@ -246,10 +229,15 @@ msgstr "Auteur du module : " msgid "Author: " msgstr "Auteur : " -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Voir aussi" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "A faire" @@ -346,6 +334,14 @@ msgstr "état" msgid "built-in function" msgstr "fonction de base" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Lien permanent vers ce titre" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Lien permanent vers cette définition" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Cacher les résultats de la recherche" @@ -366,11 +362,11 @@ msgstr "module, dans" msgid ", in " msgstr ", dans" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Résultats de la recherche" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -379,7 +375,7 @@ msgstr "" "des termes de recherche et que vous avez sélectionné suffisamment de " "catégories." -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "La recherche est terminée, %s page(s) correspond(ent) à la requête." @@ -455,68 +451,61 @@ msgstr "Sujet suivant" msgid "next chapter" msgstr "Chapitre suivant" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Cette page" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Suggérer une modification" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Montrer la source" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Recherche rapide" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Recherche par mot-clé" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Go" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Saisissez un nom de module, classe ou fonction." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Recherchez dans %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "À propos de ces documents" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Recherche" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Copyright" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Mis à jour le %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -525,15 +514,7 @@ msgstr "" "Créé avec <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "Modules les plus utilisés :" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "N'afficher que les modules disponibles sur ces plateformes" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Obsolète" @@ -542,16 +523,6 @@ msgstr "Obsolète" msgid "Search %(docstitle)s" msgstr "Rechercher %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Note :</strong> Vous tentez d'accéder à une ancienne URL de ce " -"serveur. Nous avons essayé de vous rediriger vers la nouvelle adresse de " -"cette page, mais ce n'est peut-être pas la bonne." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -604,3 +575,42 @@ msgstr "Modifications de l'API C" msgid "Other changes" msgstr "Autres modifications" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "Version" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Plateforme : %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[image]" + +#~ msgid "Suggest Change" +#~ msgstr "Suggérer une modification" + +#~ msgid "Keyword search" +#~ msgstr "Recherche par mot-clé" + +#~ msgid "Most popular modules:" +#~ msgstr "Modules les plus utilisés :" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "N'afficher que les modules disponibles sur ces plateformes" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Note :</strong> Vous tentez d'accéder" +#~ " à une ancienne URL de ce " +#~ "serveur. Nous avons essayé de vous " +#~ "rediriger vers la nouvelle adresse de" +#~ " cette page, mais ce n'est peut-être" +#~ " pas la bonne." + diff --git a/sphinx/locale/it/LC_MESSAGES/sphinx.js b/sphinx/locale/it/LC_MESSAGES/sphinx.js new file mode 100644 index 00000000..c2c8be7b --- /dev/null +++ b/sphinx/locale/it/LC_MESSAGES/sphinx.js @@ -0,0 +1 @@ +Documentation.addTranslations({"locale": "it", "plural_expr": "(n != 1)", "messages": {"module, in ": "modulo, in", "Preparing search...": "Preparazione della ricerca", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "La tua ricerca non ha trovato alcun risultato. Controlla la corettezzadei termini di ricerca e di avere selezionato un numero sufficiente di categorie", "Search finished, found %s page(s) matching the search query.": "Ricera terminata, trovate %s pagine corrispondenti alla ricerca.", ", in ": ", in ", "Permalink to this headline": "link permanente per questa inestazione", "Searching": "Ricerca in corso", "Permalink to this definition": "link permanente per questa definizione", "Hide Search Matches": "Nascondi i risultati della ricerca", "Search Results": "Risultati della ricerca"}});
\ No newline at end of file diff --git a/sphinx/locale/it/LC_MESSAGES/sphinx.mo b/sphinx/locale/it/LC_MESSAGES/sphinx.mo Binary files differnew file mode 100644 index 00000000..7818e876 --- /dev/null +++ b/sphinx/locale/it/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/it/LC_MESSAGES/sphinx.po b/sphinx/locale/it/LC_MESSAGES/sphinx.po new file mode 100644 index 00000000..4545f4a8 --- /dev/null +++ b/sphinx/locale/it/LC_MESSAGES/sphinx.po @@ -0,0 +1,612 @@ +# Italian translations for Sphinx. +# Copyright (C) 2008 ORGANIZATION +# This file is distributed under the same license as the Sphinx project. +# Sandro Dentella <sandro@e-den.it>, 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: Sphinx 0.5\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2008-11-27 18:39+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: it <LL@li.org>\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.3\n" + +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 +#, python-format +msgid "%B %d, %Y" +msgstr "%d %B %Y" + +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 +#: sphinx/templates/genindex-split.html:2 +#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 +msgid "Index" +msgstr "Indice" + +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 +msgid "Module Index" +msgstr "Indice dei Moduli" + +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 +msgid "Search Page" +msgstr "Cerca" + +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 +#, python-format +msgid "environment variable; %s" +msgstr "variabile dámbiente, %s" + +#: sphinx/roles.py:60 +#, python-format +msgid "Python Enhancement Proposals!PEP %s" +msgstr "Python Enhancement Proposals!PEP %s" + +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Builtin" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Modulo" + +#: sphinx/builders/html.py:115 +#, python-format +msgid "%b %d, %Y" +msgstr "%d/%b/%Y" + +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Indice generale" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "indice" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Indice dei moduli" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "moduli" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "successivo" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "precedente" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr " (in " + +#: sphinx/directives/desc.py:25 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (funzione built-in)" + +#: sphinx/directives/desc.py:26 sphinx/directives/desc.py:42 +#: sphinx/directives/desc.py:54 +#, python-format +msgid "%s() (in module %s)" +msgstr "%s() (nel modulo %s)" + +#: sphinx/directives/desc.py:29 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s (variabile built-in)" + +#: sphinx/directives/desc.py:30 sphinx/directives/desc.py:66 +#, python-format +msgid "%s (in module %s)" +msgstr "%s (nel modulo %s)" + +#: sphinx/directives/desc.py:33 +#, python-format +msgid "%s (built-in class)" +msgstr "%s (classe built-in)" + +#: sphinx/directives/desc.py:34 +#, python-format +msgid "%s (class in %s)" +msgstr "%s (classe in %s)" + +#: sphinx/directives/desc.py:46 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s() (%s.%s metodo)" + +#: sphinx/directives/desc.py:48 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (%s metodo)" + +#: sphinx/directives/desc.py:58 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s() (%s.%s metodo statico)" + +#: sphinx/directives/desc.py:60 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (%s metodo statico)" + +#: sphinx/directives/desc.py:70 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s (%s.%s attributo)" + +#: sphinx/directives/desc.py:72 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s (%s attributo)" + +#: sphinx/directives/desc.py:74 +#, python-format +msgid "%s (C function)" +msgstr "%s (functione C)" + +#: sphinx/directives/desc.py:76 +#, python-format +msgid "%s (C member)" +msgstr "%s (membro C )" + +#: sphinx/directives/desc.py:78 +#, python-format +msgid "%s (C macro)" +msgstr "%s (macro C)" + +#: sphinx/directives/desc.py:80 +#, python-format +msgid "%s (C type)" +msgstr "%s (tipo C)" + +#: sphinx/directives/desc.py:82 +#, python-format +msgid "%s (C variable)" +msgstr "%s (variabile C)" + +#: sphinx/directives/desc.py:100 +msgid "Raises" +msgstr "Solleva" + +#: sphinx/directives/desc.py:104 +msgid "Variable" +msgstr "Variabile" + +#: sphinx/directives/desc.py:107 +msgid "Returns" +msgstr "Ritorna" + +#: sphinx/directives/desc.py:116 +msgid "Return type" +msgstr "Tipo di ritorno" + +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Parametri" + +#: sphinx/directives/desc.py:205 +msgid "Parameters" +msgstr "Parametri" + +#: sphinx/directives/desc.py:450 +#, python-format +msgid "%scommand line option; %s" +msgstr "%sopzione di linea di comando; %s" + +#: sphinx/directives/other.py:101 +msgid "Platforms: " +msgstr "Piattaforme:" + +#: sphinx/directives/other.py:106 +#, python-format +msgid "%s (module)" +msgstr "%s (modulo)" + +#: sphinx/directives/other.py:146 +msgid "Section author: " +msgstr "Autore della sezione" + +#: sphinx/directives/other.py:148 +msgid "Module author: " +msgstr "Autore del modulo" + +#: sphinx/directives/other.py:150 +msgid "Author: " +msgstr "Autore: " + +#: sphinx/directives/other.py:249 +msgid "See also" +msgstr "Vedi anche" + +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + +#: sphinx/ext/todo.py:31 +msgid "Todo" +msgstr "Da fare" + +#: sphinx/ext/todo.py:75 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "(La riga originale si trova in %s, linea %d e può essere trovata " + +#: sphinx/ext/todo.py:81 +msgid "here" +msgstr "qui" + +#: sphinx/locale/__init__.py:15 +msgid "Attention" +msgstr "Attenzione" + +#: sphinx/locale/__init__.py:16 +msgid "Caution" +msgstr "Attenzione" + +#: sphinx/locale/__init__.py:17 +msgid "Danger" +msgstr "Pericolo" + +#: sphinx/locale/__init__.py:18 +msgid "Error" +msgstr "Errore" + +#: sphinx/locale/__init__.py:19 +msgid "Hint" +msgstr "Consiglio" + +#: sphinx/locale/__init__.py:20 +msgid "Important" +msgstr "Importante" + +#: sphinx/locale/__init__.py:21 +msgid "Note" +msgstr "Nota" + +#: sphinx/locale/__init__.py:22 +msgid "See Also" +msgstr "Vedi anche" + +#: sphinx/locale/__init__.py:23 +msgid "Tip" +msgstr "Suggerimento" + +#: sphinx/locale/__init__.py:24 +msgid "Warning" +msgstr "Avvertimento" + +#: sphinx/locale/__init__.py:28 +#, python-format +msgid "New in version %s" +msgstr "Nuovo nella versione %s" + +#: sphinx/locale/__init__.py:29 +#, python-format +msgid "Changed in version %s" +msgstr "Cambiato nella versione %s" + +#: sphinx/locale/__init__.py:30 +#, python-format +msgid "Deprecated since version %s" +msgstr "Deprecato dalla versione %s" + +#: sphinx/locale/__init__.py:34 +msgid "module" +msgstr "modulo" + +#: sphinx/locale/__init__.py:35 +msgid "keyword" +msgstr "keyword" + +#: sphinx/locale/__init__.py:36 +msgid "operator" +msgstr "operatore" + +#: sphinx/locale/__init__.py:37 +msgid "object" +msgstr "oggetto" + +#: sphinx/locale/__init__.py:38 +msgid "exception" +msgstr "eccezione" + +#: sphinx/locale/__init__.py:39 +msgid "statement" +msgstr "statement" + +#: sphinx/locale/__init__.py:40 +msgid "built-in function" +msgstr "funzione built-in" + +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "link permanente per questa inestazione" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "link permanente per questa definizione" + +#: sphinx/static/doctools.js:174 +msgid "Hide Search Matches" +msgstr "Nascondi i risultati della ricerca" + +#: sphinx/static/searchtools.js:274 +msgid "Searching" +msgstr "Ricerca in corso" + +#: sphinx/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "Preparazione della ricerca" + +#: sphinx/static/searchtools.js:338 +msgid "module, in " +msgstr "modulo, in" + +#: sphinx/static/searchtools.js:347 +msgid ", in " +msgstr ", in " + +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 +msgid "Search Results" +msgstr "Risultati della ricerca" + +#: sphinx/static/searchtools.js:455 +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 "" +"La tua ricerca non ha trovato alcun risultato. Controlla la corettezzadei" +" termini di ricerca e di avere selezionato un numero sufficiente di " +"categorie" + +#: sphinx/static/searchtools.js:457 +#, python-format +msgid "Search finished, found %s page(s) matching the search query." +msgstr "Ricera terminata, trovate %s pagine corrispondenti alla ricerca." + +#: sphinx/templates/defindex.html:2 +msgid "Overview" +msgstr "Sintesi" + +#: sphinx/templates/defindex.html:11 +msgid "Indices and tables:" +msgstr "Indici e tabelle:" + +#: sphinx/templates/defindex.html:14 +msgid "Complete Table of Contents" +msgstr "Tabella dei contenuti completa" + +#: sphinx/templates/defindex.html:15 +msgid "lists all sections and subsections" +msgstr "elenca l'insieme delle sezioni e sottosezioni" + +#: sphinx/templates/defindex.html:17 +msgid "search this documentation" +msgstr "cerca in questa documentazione" + +#: sphinx/templates/defindex.html:20 +msgid "quick access to all modules" +msgstr "accesso veloce ai moduli" + +#: sphinx/templates/defindex.html:22 +msgid "all functions, classes, terms" +msgstr "tutte le funzioni, classi e moduli" + +#: sphinx/templates/genindex-single.html:5 +#, python-format +msgid "Index – %(key)s" +msgstr "Indice – %(key)s" + +#: sphinx/templates/genindex-single.html:44 +#: sphinx/templates/genindex-split.html:14 +#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54 +msgid "Full index on one page" +msgstr "Indice completo in una pagina" + +#: sphinx/templates/genindex-split.html:7 +msgid "Index pages by letter" +msgstr "Indice delle pagine per lettera" + +#: sphinx/templates/genindex-split.html:15 +msgid "can be huge" +msgstr "può essere enorme" + +#: sphinx/templates/layout.html:9 +msgid "Navigation" +msgstr "Navigazione" + +#: sphinx/templates/layout.html:40 +msgid "Table Of Contents" +msgstr "Tablella dei contenuti" + +#: sphinx/templates/layout.html:46 +msgid "Previous topic" +msgstr "Argomento precedente" + +#: sphinx/templates/layout.html:47 +msgid "previous chapter" +msgstr "capitolo precedente" + +#: sphinx/templates/layout.html:50 +msgid "Next topic" +msgstr "Argomento successivo" + +#: sphinx/templates/layout.html:51 +msgid "next chapter" +msgstr "capitolo successivo" + +#: sphinx/templates/layout.html:56 +msgid "This Page" +msgstr "Questa pagina" + +#: sphinx/templates/layout.html:58 +msgid "Show Source" +msgstr "Mostra sorgente" + +#: sphinx/templates/layout.html:67 +msgid "Quick search" +msgstr "Ricerca veloce" + +#: sphinx/templates/layout.html:69 +msgid "Go" +msgstr "Vai" + +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." +msgstr "Inserisci un modulo, classe o nome di funzione" + +#: sphinx/templates/layout.html:106 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "Cerca in %(docstitle)s" + +#: sphinx/templates/layout.html:115 +msgid "About these documents" +msgstr "A proposito di questi documenti" + +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 +#: sphinx/templates/search.html:5 +msgid "Search" +msgstr "Cerca" + +#: sphinx/templates/layout.html:120 +msgid "Copyright" +msgstr "Copyright" + +#: sphinx/templates/layout.html:165 +#, python-format +msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." +msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." + +#: sphinx/templates/layout.html:167 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx/templates/layout.html:170 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Ultimo Aggiornamento on %(last_updated)s." + +#: sphinx/templates/layout.html:173 +#, python-format +msgid "" +"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"%(sphinx_version)s." +msgstr "" +"Creato con <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"%(sphinx_version)s." + +#: sphinx/templates/modindex.html:36 +msgid "Deprecated" +msgstr "Deprecato" + +#: sphinx/templates/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "Cerca %(docstitle)s" + +#: sphinx/templates/search.html:7 +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 "" +"Puoi effettuare una ricerca in questi documenti. Immetti le parole chiave" +" \n" +" della tua ricerca nel riquadro sottostante \"search\". Nota che la " +"funzione\n" +" di ricerca cerca automaticamente per tutte le parole. Le pagine\n" +" che contendono meno parole non compariranno nei risultati di ricerca." + +#: sphinx/templates/search.html:14 +msgid "search" +msgstr "cerca" + +#: sphinx/templates/search.html:20 +msgid "Your search did not match any results." +msgstr "La tua ricerca non ha ottenuto risultati" + +#: sphinx/templates/changes/frameset.html:5 +#: sphinx/templates/changes/versionchanges.html:12 +#, python-format +msgid "Changes in Version %(version)s — %(docstitle)s" +msgstr "Modifiche nella Versione %(version)s — %(docstitle)s" + +#: sphinx/templates/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +msgstr "%(filename)s — %(docstitle)s" + +#: sphinx/templates/changes/versionchanges.html:17 +#, python-format +msgid "Automatically generated list of changes in version %(version)s" +msgstr "Lista delle modifiche generata automaticamente nella versione %(version)s" + +#: sphinx/templates/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "Modifiche nela libreria" + +#: sphinx/templates/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "Modifche nelle API C" + +#: sphinx/templates/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "Altre modifiche" + +#: sphinx/writers/latex.py:173 +#, fuzzy +msgid "Release" +msgstr "Release" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Piattaforma: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[immagine]" + +#~ msgid "Suggest Change" +#~ msgstr "Suggerisci una modifica" + +#~ msgid "Keyword search" +#~ msgstr "Ricerca per parola chiave" + +#~ msgid "Most popular modules:" +#~ msgstr "Moduli più utilizzati" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Mostra solo i moduli disponibili su questa piattaforma" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Nota:</strong> Hai chiesto un URL " +#~ "non più valido. Abbiamo provato a " +#~ "ridirigerti verso il nuovo indirizzo, ma" +#~ " potrebbe non essere quello giusto" + diff --git a/sphinx/locale/ja/LC_MESSAGES/sphinx.po b/sphinx/locale/ja/LC_MESSAGES/sphinx.po index 3bec3ae3..a2c65446 100644 --- a/sphinx/locale/ja/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/ja/LC_MESSAGES/sphinx.po @@ -8,93 +8,37 @@ msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2008-09-11 23:58+0200\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Yasushi MASUDA <whosaysni@gmail.com>\n" "Language-Team: ja <LL@li.org>\n" "Plural-Forms: nplurals=1; plural=0\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" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%Y 年 %m 月 %d 日" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "総合索引" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "索引" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "モジュール総索引" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "モジュール" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "次へ" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "前へ" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "" - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "組み込み" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "モジュールレベル" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%Y 年 %m 月 %d 日" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "索引" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "モジュール索引" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "検索ページ" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "この定義へのパーマリンク" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "このヘッドラインへのパーマリンク" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "リリース" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "環境変数; %s" @@ -104,14 +48,48 @@ msgstr "環境変数; %s" msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "組み込み" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "モジュールレベル" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "プラットフォーム: %s" +msgid "%b %d, %Y" +msgstr "%Y 年 %m 月 %d 日" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[画像]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "総合索引" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "索引" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "モジュール総索引" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "モジュール" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "次へ" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "前へ" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "" #: sphinx/directives/desc.py:25 #, python-format @@ -215,11 +193,16 @@ msgstr "戻り値" msgid "Return type" msgstr "戻り値の型" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "パラメタ" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "パラメタ" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, fuzzy, python-format msgid "%scommand line option; %s" msgstr "%sコマンドラインオプション; %s" @@ -245,10 +228,15 @@ msgstr "モジュールの作者: " msgid "Author: " msgstr "作者: " -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "参考" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "" @@ -345,6 +333,14 @@ msgstr "文" msgid "built-in function" msgstr "組み込み関数" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "このヘッドラインへのパーマリンク" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "この定義へのパーマリンク" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "検索結果を隠す" @@ -366,17 +362,17 @@ msgstr "モジュール" msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "検索結果" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 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/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "検索が終了し、条件に一致するページが %s 個みつかりました。" @@ -452,68 +448,61 @@ msgstr "次のトピックへ" msgid "next chapter" msgstr "次の章へ" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "このページ" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "変更のサジェスト" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "ソースコードを表示" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "クイック検索" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "キーワード検索" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "検索" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "モジュール、クラス、または関数名を入力してください" -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "%(docstitle)s 内を検索" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "このドキュメントについて" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "検索" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "著作権" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "最終更新: %(last_updated)s" -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -522,15 +511,7 @@ msgstr "" "このドキュメントは <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s で生成しました。" -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "よく参照されているモジュール:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "このプラットフォームで利用可能なモジュールだけを表示する" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "撤廃" @@ -539,15 +520,6 @@ msgstr "撤廃" msgid "Search %(docstitle)s" msgstr "%(docstitle)s 内を検索" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>注意:</strong> あなたが表示しようとしているのは古い URL です。このページに対応する新しい URL " -"へのリダイレクトを試みますが、適切なリダイレクト先でないかもしれないので注意してください。" - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -593,3 +565,39 @@ msgstr "C API に関する変更" msgid "Other changes" msgstr "その多の変更" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "リリース" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "プラットフォーム: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[画像]" + +#~ msgid "Suggest Change" +#~ msgstr "変更のサジェスト" + +#~ msgid "Keyword search" +#~ msgstr "キーワード検索" + +#~ msgid "Most popular modules:" +#~ msgstr "よく参照されているモジュール:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "このプラットフォームで利用可能なモジュールだけを表示する" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>注意:</strong> あなたが表示しようとしているのは古い URL " +#~ "です。このページに対応する新しい URL " +#~ "へのリダイレクトを試みますが、適切なリダイレクト先でないかもしれないので注意してください。" + diff --git a/sphinx/locale/nl/LC_MESSAGES/sphinx.po b/sphinx/locale/nl/LC_MESSAGES/sphinx.po index 49b2d192..fe6a4556 100644 --- a/sphinx/locale/nl/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/nl/LC_MESSAGES/sphinx.po @@ -7,93 +7,37 @@ msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2008-09-11 23:58+0200\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: nl <LL@li.org>\n" "Plural-Forms: nplurals=2; plural=(n != 1)\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" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%d.%b.%Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "Algemene index" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "Index" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "Globale Module-index" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "modules" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "volgende" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "vorige" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "" - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "Builtins" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "Moduleniveau" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%d. %B %Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "Index" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "Module-index" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Zoekpagina" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Permanente link naar deze definitie" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Permanente link naar deze titel" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "Release" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "Omgevingsvariabele; %s" @@ -103,14 +47,48 @@ msgstr "Omgevingsvariabele; %s" msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Builtins" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Moduleniveau" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Platform: %s" +msgid "%b %d, %Y" +msgstr "%d.%b.%Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[afbeelding]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Algemene index" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "Index" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Globale Module-index" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "modules" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "volgende" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "vorige" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "" #: sphinx/directives/desc.py:25 #, python-format @@ -214,11 +192,16 @@ msgstr "Returns" msgid "Return type" msgstr "Return type" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Parameters" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Parameters" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, fuzzy, python-format msgid "%scommand line option; %s" msgstr "%scommandolijn optie; %s" @@ -244,10 +227,15 @@ msgstr "Auteur van deze module: " msgid "Author: " msgstr "Auteur: " -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Zie ook" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "" @@ -344,6 +332,14 @@ msgstr "statement" msgid "built-in function" msgstr "geïntegreerde functie" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Permanente link naar deze titel" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Permanente link naar deze definitie" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Zoekresultaten verbergen" @@ -365,11 +361,11 @@ msgstr "module" msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Zoekresultaten" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -377,7 +373,7 @@ msgstr "" "Uw zoekopdracht leverde geen resultaten op. Controleer of alle " "woordencorrect gespeld zijn en dat u genoeg categoriën hebt geselecteerd." -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "Zoeken voltooid, %s pagina(s) gevonden." @@ -453,68 +449,61 @@ msgstr "Volgend onderwerp" msgid "next chapter" msgstr "volgend hoofdstuk" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Deze Pagina" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Wijziging Voorstellen" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Broncode weergeven" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Snel zoeken" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Trefwoord opzoeken" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Go" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Geef de naam van een module, klasse of functie." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Zoeken in %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "Over deze documenten" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Zoeken" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Copyright" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Laatste aanpassing op %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -523,15 +512,7 @@ msgstr "" "Aangemaakt met <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "Populairste modules:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "Enkel modules weergeven die op deze platformen beschikbaar zijn" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Verouderd" @@ -540,16 +521,6 @@ msgstr "Verouderd" msgid "Search %(docstitle)s" msgstr "Zoeken %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Opgelet:</strong> U heeft een verouderde URL aangevraagd op deze " -"server. Wij hebben probeerd u door te verwijzen naar de nieuwe locatie " -"van deze pagina, maar dat is misschien niet gelukt." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -601,3 +572,42 @@ msgstr "Veranderingen in de C-API" msgid "Other changes" msgstr "Andere veranderingen" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "Release" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Platform: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[afbeelding]" + +#~ msgid "Suggest Change" +#~ msgstr "Wijziging Voorstellen" + +#~ msgid "Keyword search" +#~ msgstr "Trefwoord opzoeken" + +#~ msgid "Most popular modules:" +#~ msgstr "Populairste modules:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Enkel modules weergeven die op deze platformen beschikbaar zijn" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Opgelet:</strong> U heeft een " +#~ "verouderde URL aangevraagd op deze " +#~ "server. Wij hebben probeerd u door " +#~ "te verwijzen naar de nieuwe locatie " +#~ "van deze pagina, maar dat is " +#~ "misschien niet gelukt." + diff --git a/sphinx/locale/pl/LC_MESSAGES/sphinx.po b/sphinx/locale/pl/LC_MESSAGES/sphinx.po index 87f5c4cb..fdd14ca3 100644 --- a/sphinx/locale/pl/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/pl/LC_MESSAGES/sphinx.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2008-08-10 11:43+0000\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Michał Kandulski <Michal.Kandulski@poczta.onet.pl>\n" "Language-Team: \n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && " @@ -12,86 +12,30 @@ msgstr "" "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" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%b %d %Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "Indeks ogólny" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "indeks" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "Indeks modułów" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "moduły" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "dalej" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "wstecz" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "" - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "Wbudowane" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "Poziom modułu" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%B %d %Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "Indeks" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "Indeks modułów" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Wyszukiwanie" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Stały odnośnik do tej definicji" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Stały odnośnik do tego nagłówka" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "Wydanie" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "zmienna środowiskowa; %s" @@ -101,14 +45,48 @@ msgstr "zmienna środowiskowa; %s" msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Wbudowane" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Poziom modułu" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Platforma: %s" +msgid "%b %d, %Y" +msgstr "%b %d %Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[obrazek]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Indeks ogólny" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "indeks" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Indeks modułów" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "moduły" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "dalej" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "wstecz" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "" #: sphinx/directives/desc.py:25 #, python-format @@ -212,11 +190,16 @@ msgstr "Zwraca" msgid "Return type" msgstr "Typ zwracany" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Parametry" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Parametry" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, fuzzy, python-format msgid "%scommand line option; %s" msgstr "%sopcja linii komend; %s" @@ -242,10 +225,15 @@ msgstr "Autor modułu: " msgid "Author: " msgstr "Autor: " -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Zobacz także" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "" @@ -342,6 +330,14 @@ msgstr "instrukcja" msgid "built-in function" msgstr "funkcja wbudowana" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Stały odnośnik do tego nagłówka" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Stały odnośnik do tej definicji" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Ukryj wyniki wyszukiwania" @@ -363,11 +359,11 @@ msgstr "moduł" msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Wyniki wyszukiwania" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -375,7 +371,7 @@ msgstr "" "Nie znaleziono żadnych pasujących dokumentów. Upewnij się, że wszystkie " "słowa są poprawnie wpisane i że wybrałeś wystarczającąliczbę kategorii." -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "Przeszukiwanie zakończone, znaleziono %s pasujących stron." @@ -451,68 +447,61 @@ msgstr "Następny temat" msgid "next chapter" msgstr "następny rozdział" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Ta strona" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Zasugeruj zmianę" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Pokaż źródło" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Szybkie wyszukiwanie" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Szukanie wg słowa kluczowego" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Szukaj" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Wprowadź nazwę modułu, klasy lub funkcji." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Szukaj pośród %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "O tych dokumentach" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Szukaj" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Copyright" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Ostatnia modyfikacja %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -521,15 +510,7 @@ msgstr "" "Utworzone przy pomocy <a href=\"http://sphinx.pocoo.org/\">Sphinx</a>'a " "%(sphinx_version)s." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "Najbardziej popularne moduły:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "Pokaż moduły dostępne tylko na tych platformach" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Niezalecane" @@ -538,16 +519,6 @@ msgstr "Niezalecane" msgid "Search %(docstitle)s" msgstr "Przeszukaj %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Uwaga:</strong> Zażądano przedawnionego URL'a z tego serwera. " -"Nastąpiła próba przekierowania do nowej lokalizacji, ale może ona być " -"niewłaściwa." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -598,3 +569,40 @@ msgstr "Zmiany w C API" msgid "Other changes" msgstr "Inne zmiany" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "Wydanie" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Platforma: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[obrazek]" + +#~ msgid "Suggest Change" +#~ msgstr "Zasugeruj zmianę" + +#~ msgid "Keyword search" +#~ msgstr "Szukanie wg słowa kluczowego" + +#~ msgid "Most popular modules:" +#~ msgstr "Najbardziej popularne moduły:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Pokaż moduły dostępne tylko na tych platformach" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Uwaga:</strong> Zażądano przedawnionego " +#~ "URL'a z tego serwera. Nastąpiła próba" +#~ " przekierowania do nowej lokalizacji, ale" +#~ " może ona być niewłaściwa." + diff --git a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po index 021b70aa..d3144c25 100644 --- a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po @@ -8,93 +8,37 @@ msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: roger.demetrescu@gmail.com\n" "POT-Creation-Date: 2008-11-09 19:46+0100\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Roger Demetrescu <roger.demetrescu@gmail.com>\n" "Language-Team: pt_BR <roger.demetrescu@gmail.com>\n" "Plural-Forms: nplurals=2; plural=(n > 1)\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" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%d/%m/%Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "Índice Geral" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "índice" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "Índice Global de Módulos" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "módulos" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "próximo" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "anterior" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr " (em " - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "Internos" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "Módulo" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%d/%m/%Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "Índice" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "Índice do Módulo" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Página de Pesquisa" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Link permanente para esta definição" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Link permanente para este título" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "Versão" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "váriavel de ambiente; %s" @@ -104,14 +48,48 @@ msgstr "váriavel de ambiente; %s" msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Internos" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Módulo" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Plataforma: %s" +msgid "%b %d, %Y" +msgstr "%d/%m/%Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[imagem]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Índice Geral" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "índice" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Índice Global de Módulos" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "módulos" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "próximo" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "anterior" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr " (em " #: sphinx/directives/desc.py:25 #, python-format @@ -215,11 +193,16 @@ msgstr "Retorna" msgid "Return type" msgstr "Tipo de retorno" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Parâmetros" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Parâmetros" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, python-format msgid "%scommand line option; %s" msgstr "%sopção de linha de comando; %s" @@ -245,10 +228,15 @@ msgstr "Autor do módulo: " msgid "Author: " msgstr "Autor: " -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Veja também" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "Por fazer" @@ -345,6 +333,14 @@ msgstr "comando" msgid "built-in function" msgstr "função interna" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Link permanente para este título" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Link permanente para esta definição" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Esconder Resultados da Pesquisa" @@ -365,11 +361,11 @@ msgstr "módulo, em " msgid ", in " msgstr ", em " -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Resultados da Pesquisa" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -378,7 +374,7 @@ msgstr "" " todas as palavras foram digitadas corretamente e de que você tenha " "selecionado o mínimo de categorias." -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "" @@ -456,68 +452,61 @@ msgstr "Próximo tópico" msgid "next chapter" msgstr "próximo capítulo" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Esta Página" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Sugerir Alteração" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Exibir Fonte" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Pesquisa rápida" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Pesquisa de palavras-chave" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Ir" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Informe o nome de um módulo, classe ou função." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Pesquisar dentro de %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "Sobre estes documentos" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Pesquisar" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Copyright" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Copyright %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Última atualização em %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -526,15 +515,7 @@ msgstr "" "Criado com <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "Módulos mais populares:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "Exibir somente módulos disponíveis nestas plataformas" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Obsoleto" @@ -543,16 +524,6 @@ msgstr "Obsoleto" msgid "Search %(docstitle)s" msgstr "Pesquisar em %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Nota:</strong> Você requisitou uma URL desatualizada deste " -"servidor. Tentamos redirecioná-lo para um novo endereço desta página, " -"porém é possível que o mesmo não seja o correto." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -604,3 +575,41 @@ msgstr "Alterações na API C" msgid "Other changes" msgstr "Outras alterações" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "Versão" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Plataforma: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[imagem]" + +#~ msgid "Suggest Change" +#~ msgstr "Sugerir Alteração" + +#~ msgid "Keyword search" +#~ msgstr "Pesquisa de palavras-chave" + +#~ msgid "Most popular modules:" +#~ msgstr "Módulos mais populares:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Exibir somente módulos disponíveis nestas plataformas" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Nota:</strong> Você requisitou uma URL" +#~ " desatualizada deste servidor. Tentamos " +#~ "redirecioná-lo para um novo endereço " +#~ "desta página, porém é possível que " +#~ "o mesmo não seja o correto." + diff --git a/sphinx/locale/sl/LC_MESSAGES/sphinx.po b/sphinx/locale/sl/LC_MESSAGES/sphinx.po index 0c6bbab3..b08c75c9 100644 --- a/sphinx/locale/sl/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/sl/LC_MESSAGES/sphinx.po @@ -4,93 +4,37 @@ msgstr "" "Project-Id-Version: Sphinx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2008-09-11 23:58+0200\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Rok Garbas <rok.garbas@gmail.com>\n" "Language-Team: Rok Garbas <rok.garbas@gmail.com>\n" "Plural-Forms: nplurals=1; plural=0\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" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%d %b, %Y" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "Splošni abecedni seznam" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "abecedni seznam" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "Splošen Seznam Modulov" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "Moduli" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "naprej" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "nazaj" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "(v " - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "Vgrajeni deli" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "Nivo modula" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%d %B, %Y" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "Abecedni seznam" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "Seznam modulov" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "Iskalna stran" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "Povezava na to definicijo" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "Povezava na naslov" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "Izdaja" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "globalna spremenljivka; %s" @@ -100,14 +44,48 @@ msgstr "globalna spremenljivka; %s" msgid "Python Enhancement Proposals!PEP %s" msgstr "Python Enhancement Proposals!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "Vgrajeni deli" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "Nivo modula" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "Platforma: %s" +msgid "%b %d, %Y" +msgstr "%d %b, %Y" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[slika]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "Splošni abecedni seznam" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "abecedni seznam" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "Splošen Seznam Modulov" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "Moduli" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "naprej" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "nazaj" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "(v " #: sphinx/directives/desc.py:25 #, python-format @@ -211,11 +189,16 @@ msgstr "Vrne" msgid "Return type" msgstr "Vrne tip" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "Parametri" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "Parametri" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, python-format msgid "%scommand line option; %s" msgstr "%sopcija komandne linije; %s" @@ -241,10 +224,15 @@ msgstr "Avtor modula:" msgid "Author: " msgstr "Avtor:" -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "Poglej tudi" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "Naredi" @@ -341,6 +329,14 @@ msgstr "izjava" msgid "built-in function" msgstr "vgrajene funkcije" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "Povezava na naslov" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Povezava na to definicijo" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "Skrij Resultate Iskanja" @@ -361,11 +357,11 @@ msgstr "modul, v " msgid ", in " msgstr ", v " -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "Rezultati Iskanja" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 msgid "" "Your search did not match any documents. Please make sure that all words " "are spelled correctly and that you've selected enough categories." @@ -373,7 +369,7 @@ msgstr "" "Za vaše iskanje ni rezultatov. Prosimo preglejte ali so vse besede " "pravilno črkovane in ali ste izbrali dovolj kategorij." -#: sphinx/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "Iskanje končano, najdeno %s strani, ki ustrezajo iskalnemu nizu." @@ -449,68 +445,61 @@ msgstr "Naslednja tema" msgid "next chapter" msgstr "naslednje poglavje" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "Ta stran" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "Predlagaj spremembo" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "Prikaži izvorno kodo" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "Hitro iskanje" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "Iskanje po ključniih besedah" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "Potrdi" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "Vnesi ime mudla, razreda ali funkcije." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "Išči med %(docstitle)s" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "O teh dokumentih" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "Išči" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "Vse pravice pridržane" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "© <a href=\"%(path)s\">Vse pravice pridržane</a> %(copyright)s." -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "© Vse pravice pridržane %(copyright)s." -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "Zadnjič posodobljeno na %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " @@ -519,15 +508,7 @@ msgstr "" "Narejeno s <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "Najbolj popularni moduli:" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "Prikaži module na razpolago na platformah" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "Zastarelo" @@ -536,16 +517,6 @@ msgstr "Zastarelo" msgid "Search %(docstitle)s" msgstr "Išči %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" -"<strong>Opomba:</strong> Vaš zahtevek za URL s tega streznika je " -"zastaral. Poskušali smo vas preusmeriti na novo lokacijo, vendar utegne " -"biti napačna." - #: sphinx/templates/search.html:7 #, fuzzy msgid "" @@ -595,3 +566,40 @@ msgstr "C API spremembe" msgid "Other changes" msgstr "Ostale spremembe" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "Izdaja" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Platforma: %s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[slika]" + +#~ msgid "Suggest Change" +#~ msgstr "Predlagaj spremembo" + +#~ msgid "Keyword search" +#~ msgstr "Iskanje po ključniih besedah" + +#~ msgid "Most popular modules:" +#~ msgstr "Najbolj popularni moduli:" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "Prikaži module na razpolago na platformah" + +#~ msgid "" +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." +#~ msgstr "" +#~ "<strong>Opomba:</strong> Vaš zahtevek za URL" +#~ " s tega streznika je zastaral. " +#~ "Poskušali smo vas preusmeriti na novo" +#~ " lokacijo, vendar utegne biti napačna." + diff --git a/sphinx/locale/sphinx.pot b/sphinx/locale/sphinx.pot index ad78625f..bcaee360 100644 --- a/sphinx/locale/sphinx.pot +++ b/sphinx/locale/sphinx.pot @@ -6,111 +6,89 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Sphinx 0.5\n" +"Project-Id-Version: Sphinx 0.6\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2008-11-27 18:39+0100\n" +"POT-Creation-Date: 2008-12-28 23:40+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\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" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format -msgid "%b %d, %Y" -msgstr "" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "" - -#: sphinx/builder.py:427 -msgid "index" +msgid "%B %d, %Y" msgstr "" -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 +#: sphinx/templates/genindex-split.html:2 +#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 +#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 +msgid "Index" msgstr "" -#: sphinx/builder.py:429 -msgid "modules" +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 +msgid "Module Index" msgstr "" -#: sphinx/builder.py:466 -msgid "next" +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 +msgid "Search Page" msgstr "" -#: sphinx/builder.py:473 -msgid "previous" +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 +#, python-format +msgid "environment variable; %s" msgstr "" -#: sphinx/builder.py:1054 -msgid " (in " +#: sphinx/roles.py:60 +#, python-format +msgid "Python Enhancement Proposals!PEP %s" msgstr "" -#: sphinx/builder.py:1129 +#: sphinx/builders/changes.py:64 msgid "Builtins" msgstr "" -#: sphinx/builder.py:1131 +#: sphinx/builders/changes.py:66 msgid "Module level" msgstr "" -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/builders/html.py:115 #, python-format -msgid "%B %d, %Y" -msgstr "" - -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 -#: sphinx/templates/genindex-split.html:2 -#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 -#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 -msgid "Index" -msgstr "" - -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 -msgid "Module Index" -msgstr "" - -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 -msgid "Search Page" +msgid "%b %d, %Y" msgstr "" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" msgstr "" -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" +#: sphinx/builders/html.py:134 +msgid "index" msgstr "" -#: sphinx/latexwriter.py:172 -msgid "Release" +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" msgstr "" -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 -#, python-format -msgid "environment variable; %s" +#: sphinx/builders/html.py:136 +msgid "modules" msgstr "" -#: sphinx/roles.py:60 -#, python-format -msgid "Python Enhancement Proposals!PEP %s" +#: sphinx/builders/html.py:175 +msgid "next" msgstr "" -#: sphinx/textwriter.py:166 -#, python-format -msgid "Platform: %s" +#: sphinx/builders/html.py:182 +msgid "previous" msgstr "" -#: sphinx/textwriter.py:422 -msgid "[image]" +#: sphinx/builders/latex.py:155 +msgid " (in " msgstr "" #: sphinx/directives/desc.py:25 @@ -215,11 +193,15 @@ msgstr "" msgid "Return type" msgstr "" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +msgid "Parameter" +msgstr "" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, python-format msgid "%scommand line option; %s" msgstr "" @@ -245,10 +227,15 @@ msgstr "" msgid "Author: " msgstr "" -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "" @@ -345,6 +332,14 @@ msgstr "" msgid "built-in function" msgstr "" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "" @@ -365,17 +360,17 @@ msgstr "" msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 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/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "" @@ -451,83 +446,67 @@ msgstr "" msgid "next chapter" msgstr "" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +msgid "Enter search terms or a module, class or function name." msgstr "" -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "" -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "" -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "" -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "" @@ -536,13 +515,6 @@ msgstr "" msgid "Search %(docstitle)s" msgstr "" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" - #: sphinx/templates/search.html:7 msgid "" "From here you can search these documents. Enter your search\n" @@ -587,3 +559,16 @@ msgstr "" msgid "Other changes" msgstr "" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "" + diff --git a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po index 2b824a35..0e27e947 100644 --- a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po @@ -8,93 +8,37 @@ msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2008-11-09 19:46+0100\n" -"PO-Revision-Date: 2008-11-27 18:40+0100\n" +"PO-Revision-Date: 2008-12-28 23:40+0100\n" "Last-Translator: Fred Lin <gasolin@gmail.com>\n" "Language-Team: tw <LL@li.org>\n" "Plural-Forms: nplurals=1; plural=0\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" +"Generated-By: Babel 0.9.3\n" -#: sphinx/builder.py:408 -#, python-format -msgid "%b %d, %Y" -msgstr "%Y 年 %m 月 %d 日" - -#: sphinx/builder.py:427 sphinx/templates/defindex.html:21 -msgid "General Index" -msgstr "總索引" - -#: sphinx/builder.py:427 -msgid "index" -msgstr "索引" - -#: sphinx/builder.py:429 sphinx/htmlhelp.py:156 -#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2 -#: sphinx/templates/modindex.html:13 -msgid "Global Module Index" -msgstr "" - -#: sphinx/builder.py:429 -msgid "modules" -msgstr "模組" - -#: sphinx/builder.py:466 -msgid "next" -msgstr "下一頁" - -#: sphinx/builder.py:473 -msgid "previous" -msgstr "上一頁" - -#: sphinx/builder.py:1054 -msgid " (in " -msgstr "" - -#: sphinx/builder.py:1129 -msgid "Builtins" -msgstr "" - -#: sphinx/builder.py:1131 -msgid "Module level" -msgstr "" - -#: sphinx/environment.py:102 sphinx/latexwriter.py:169 +#: sphinx/environment.py:103 sphinx/writers/latex.py:170 #, python-format msgid "%B %d, %Y" msgstr "%Y 年 %m 月 %d 日" -#: sphinx/environment.py:291 sphinx/latexwriter.py:175 -#: sphinx/templates/genindex-single.html:2 +#: sphinx/environment.py:293 sphinx/templates/genindex-single.html:2 #: sphinx/templates/genindex-split.html:2 #: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2 #: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48 -#: sphinx/templates/layout.html:130 +#: sphinx/templates/layout.html:117 sphinx/writers/latex.py:176 msgid "Index" msgstr "索引" -#: sphinx/environment.py:292 sphinx/latexwriter.py:174 +#: sphinx/environment.py:294 sphinx/writers/latex.py:175 msgid "Module Index" msgstr "模組索引" -#: sphinx/environment.py:293 sphinx/templates/defindex.html:16 +#: sphinx/environment.py:295 sphinx/templates/defindex.html:16 msgid "Search Page" msgstr "搜尋頁面" -#: sphinx/htmlwriter.py:79 sphinx/static/doctools.js:145 -msgid "Permalink to this definition" -msgstr "" - -#: sphinx/htmlwriter.py:399 sphinx/static/doctools.js:139 -msgid "Permalink to this headline" -msgstr "" - -#: sphinx/latexwriter.py:172 -msgid "Release" -msgstr "釋出" - -#: sphinx/roles.py:53 sphinx/directives/desc.py:537 +#: sphinx/roles.py:53 sphinx/directives/desc.py:564 #, python-format msgid "environment variable; %s" msgstr "環境變數; %s" @@ -104,14 +48,48 @@ msgstr "環境變數; %s" msgid "Python Enhancement Proposals!PEP %s" msgstr "Python 建議文件!PEP %s" -#: sphinx/textwriter.py:166 +#: sphinx/builders/changes.py:64 +msgid "Builtins" +msgstr "" + +#: sphinx/builders/changes.py:66 +msgid "Module level" +msgstr "" + +#: sphinx/builders/html.py:115 #, python-format -msgid "Platform: %s" -msgstr "平台:%s" +msgid "%b %d, %Y" +msgstr "%Y 年 %m 月 %d 日" -#: sphinx/textwriter.py:422 -msgid "[image]" -msgstr "[圖片]" +#: sphinx/builders/html.py:134 sphinx/templates/defindex.html:21 +msgid "General Index" +msgstr "總索引" + +#: sphinx/builders/html.py:134 +msgid "index" +msgstr "索引" + +#: sphinx/builders/html.py:136 sphinx/builders/htmlhelp.py:180 +#: sphinx/builders/qthelp.py:129 sphinx/templates/defindex.html:19 +#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:13 +msgid "Global Module Index" +msgstr "" + +#: sphinx/builders/html.py:136 +msgid "modules" +msgstr "模組" + +#: sphinx/builders/html.py:175 +msgid "next" +msgstr "下一頁" + +#: sphinx/builders/html.py:182 +msgid "previous" +msgstr "上一頁" + +#: sphinx/builders/latex.py:155 +msgid " (in " +msgstr "" #: sphinx/directives/desc.py:25 #, python-format @@ -215,11 +193,16 @@ msgstr "返回" msgid "Return type" msgstr "返回類別" -#: sphinx/directives/desc.py:143 +#: sphinx/directives/desc.py:201 +#, fuzzy +msgid "Parameter" +msgstr "參數" + +#: sphinx/directives/desc.py:205 msgid "Parameters" msgstr "參數" -#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:450 #, python-format msgid "%scommand line option; %s" msgstr "%s命令列選項; %s" @@ -245,10 +228,15 @@ msgstr "模組作者:" msgid "Author: " msgstr "作者:" -#: sphinx/directives/other.py:246 +#: sphinx/directives/other.py:249 msgid "See also" msgstr "" +#: sphinx/ext/autodoc.py:576 sphinx/ext/autodoc.py:590 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + #: sphinx/ext/todo.py:31 msgid "Todo" msgstr "待辦" @@ -345,6 +333,14 @@ msgstr "" msgid "built-in function" msgstr "內建函式" +#: sphinx/static/doctools.js:139 sphinx/writers/html.py:415 +msgid "Permalink to this headline" +msgstr "" + +#: sphinx/static/doctools.js:145 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "" + #: sphinx/static/doctools.js:174 msgid "Hide Search Matches" msgstr "" @@ -365,17 +361,17 @@ msgstr "" msgid ", in " msgstr "" -#: sphinx/static/searchtools.js:447 sphinx/templates/search.html:18 +#: sphinx/static/searchtools.js:453 sphinx/templates/search.html:18 msgid "Search Results" msgstr "搜尋結果" -#: sphinx/static/searchtools.js:449 +#: sphinx/static/searchtools.js:455 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/static/searchtools.js:451 +#: sphinx/static/searchtools.js:457 #, python-format msgid "Search finished, found %s page(s) matching the search query." msgstr "" @@ -451,83 +447,68 @@ msgstr "下一個主題" msgid "next chapter" msgstr "下一章" -#: sphinx/templates/layout.html:55 +#: sphinx/templates/layout.html:56 msgid "This Page" msgstr "本頁" -#: sphinx/templates/layout.html:59 -msgid "Suggest Change" -msgstr "" - -#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62 +#: sphinx/templates/layout.html:58 msgid "Show Source" msgstr "顯示原始碼" -#: sphinx/templates/layout.html:71 +#: sphinx/templates/layout.html:67 msgid "Quick search" msgstr "快速搜尋" -#: sphinx/templates/layout.html:71 -msgid "Keyword search" -msgstr "關鍵字搜尋" - -#: sphinx/templates/layout.html:73 +#: sphinx/templates/layout.html:69 msgid "Go" msgstr "" -#: sphinx/templates/layout.html:78 -msgid "Enter a module, class or function name." +#: sphinx/templates/layout.html:73 +#, fuzzy +msgid "Enter search terms or a module, class or function name." msgstr "輸入一個模組、類別、或是函式名稱." -#: sphinx/templates/layout.html:119 +#: sphinx/templates/layout.html:106 #, python-format msgid "Search within %(docstitle)s" msgstr "在 %(docstitle)s 中搜尋" -#: sphinx/templates/layout.html:128 +#: sphinx/templates/layout.html:115 msgid "About these documents" msgstr "" -#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2 +#: sphinx/templates/layout.html:118 sphinx/templates/search.html:2 #: sphinx/templates/search.html:5 msgid "Search" msgstr "搜尋" -#: sphinx/templates/layout.html:133 +#: sphinx/templates/layout.html:120 msgid "Copyright" msgstr "版權所有" -#: sphinx/templates/layout.html:178 +#: sphinx/templates/layout.html:165 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." msgstr "" -#: sphinx/templates/layout.html:180 +#: sphinx/templates/layout.html:167 #, python-format msgid "© Copyright %(copyright)s." msgstr "" -#: sphinx/templates/layout.html:183 +#: sphinx/templates/layout.html:170 #, python-format msgid "Last updated on %(last_updated)s." msgstr "最後更新日期是 %(last_updated)s." -#: sphinx/templates/layout.html:186 +#: sphinx/templates/layout.html:173 #, python-format msgid "" "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -#: sphinx/templates/modindex.html:15 -msgid "Most popular modules:" -msgstr "" - -#: sphinx/templates/modindex.html:24 -msgid "Show modules only available on these platforms" -msgstr "" - -#: sphinx/templates/modindex.html:56 +#: sphinx/templates/modindex.html:36 msgid "Deprecated" msgstr "已移除" @@ -536,13 +517,6 @@ msgstr "已移除" msgid "Search %(docstitle)s" msgstr "搜尋 %(docstitle)s" -#: sphinx/templates/page.html:8 -msgid "" -"<strong>Note:</strong> You requested an out-of-date URL from this server." -" We've tried to redirect you to the new location of this page, but it may" -" not be the right one." -msgstr "" - #: sphinx/templates/search.html:7 msgid "" "From here you can search these documents. Enter your search\n" @@ -587,12 +561,36 @@ msgstr "C API 改變" msgid "Other changes" msgstr "其他改變:" +#: sphinx/writers/latex.py:173 +msgid "Release" +msgstr "釋出" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "平台:%s" + +#: sphinx/writers/text.py:427 +msgid "[image]" +msgstr "[圖片]" + +#~ msgid "Suggest Change" +#~ msgstr "" + +#~ msgid "Keyword search" +#~ msgstr "關鍵字搜尋" + +#~ msgid "Most popular modules:" +#~ msgstr "" + +#~ msgid "Show modules only available on these platforms" +#~ msgstr "" + #~ 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 less words won't appear in the result list." +#~ "<strong>Note:</strong> You requested an " +#~ "out-of-date URL from this server. " +#~ "We've tried to redirect you to the" +#~ " new location of this page, but " +#~ "it may not be the right one." #~ msgstr "" diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index 4ab26b86..7ed514ed 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -165,8 +165,8 @@ html_static_path = ['%(dot)sstatic'] # If true, the index is split into individual pages for each letter. #html_split_index = False -# If true, the reST sources are included in the HTML build as _sources/<name>. -#html_copy_source = True +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the @@ -257,7 +257,7 @@ PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d %(rbuilddir)s/doctrees $(PAPEROPT_$(PAPER)) \ $(SPHINXOPTS) %(rsrcdir)s -.PHONY: help clean html web pickle htmlhelp latex changes linkcheck +.PHONY: help clean html pickle json htmlhelp qthelp latex changes linkcheck help: \t@echo "Please use \\`make <target>' where <target> is one of" @@ -265,6 +265,7 @@ help: \t@echo " pickle to make pickle files" \t@echo " json to make JSON files" \t@echo " htmlhelp to make HTML files and a HTML help project" +\t@echo " qthelp to make HTML files and a qthelp project" \t@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" \t@echo " changes to make an overview over all changed/added/deprecated items" \t@echo " linkcheck to check all external links for integrity" @@ -284,8 +285,6 @@ pickle: \t@echo \t@echo "Build finished; now you can process the pickle files." -web: pickle - json: \tmkdir -p %(rbuilddir)s/json %(rbuilddir)s/doctrees \t$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) %(rbuilddir)s/json @@ -299,6 +298,16 @@ htmlhelp: \t@echo "Build finished; now you can run HTML Help Workshop with the" \\ \t ".hhp project file in %(rbuilddir)s/htmlhelp." +qthelp: +\tmkdir -p %(rbuilddir)s/qthelp %(rbuilddir)s/doctrees +\t$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) %(rbuilddir)s/qthelp +\t@echo +\t@echo "Build finished; now you can run "qcollectiongenerator" with the" \\ +\t ".qhcp project file in %(rbuilddir)s/qthelp, like this:" +\t@echo "# qcollectiongenerator %(rbuilddir)s/qthelp/Sphinx.qhcp" +\t@echo "To view the help file:" +\t@echo "# assistant -collectionFile %(rbuilddir)s/qthelp/%(project)s.qhc" + latex: \tmkdir -p %(rbuilddir)s/latex %(rbuilddir)s/doctrees \t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) %(rbuilddir)s/latex diff --git a/sphinx/roles.py b/sphinx/roles.py index 0b66c8e8..2bbdab94 100644 --- a/sphinx/roles.py +++ b/sphinx/roles.py @@ -96,6 +96,7 @@ innernodetypes = { 'term': nodes.emphasis, 'token': nodes.strong, 'envvar': nodes.strong, + 'download': nodes.strong, 'option': addnodes.literal_emphasis, } @@ -122,8 +123,10 @@ def xfileref_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): return [innernodetypes.get(typ, nodes.literal)( rawtext, text, classes=['xref'])], [] # we want a cross-reference, create the reference node - pnode = addnodes.pending_xref(rawtext, reftype=typ, refcaption=False, - modname=env.currmodule, classname=env.currclass) + nodeclass = (typ == 'download') and addnodes.download_reference or \ + addnodes.pending_xref + pnode = nodeclass(rawtext, reftype=typ, refcaption=False, + modname=env.currmodule, classname=env.currclass) # we may need the line number for warnings pnode.line = lineno # the link title may differ from the target, but by default they are the same @@ -235,6 +238,8 @@ specific_docroles = { 'token': xfileref_role, 'term': xfileref_role, 'option': xfileref_role, + 'doc': xfileref_role, + 'download': xfileref_role, 'menuselection': menusel_role, 'file': emph_literal_role, diff --git a/sphinx/templates/changes/versionchanges.html b/sphinx/templates/changes/versionchanges.html index 14d5efd3..09651bf1 100644 --- a/sphinx/templates/changes/versionchanges.html +++ b/sphinx/templates/changes/versionchanges.html @@ -1,4 +1,4 @@ -{% macro entries changes %} +{% macro entries(changes) %} <ul>{% for entry, docname, lineno in changes %} <li><a href="rst/{{ docname }}.html#L{{ lineno-10 }}" target="src">{{ entry }}</a></li> {% endfor %}</ul> diff --git a/sphinx/templates/layout.html b/sphinx/templates/layout.html index d9c9045d..e011f643 100644 --- a/sphinx/templates/layout.html +++ b/sphinx/templates/layout.html @@ -4,7 +4,7 @@ {%- endblock %} {%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} {%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} -{%- macro relbar %} +{%- macro relbar() %} <div class="related"> <h3>{{ _('Navigation') }}</h3> <ul> @@ -24,8 +24,8 @@ </ul> </div> {%- endmacro %} -{%- macro sidebar %} - {%- if builder != 'htmlhelp' %} +{%- macro sidebar() %} + {%- if not embedded %} <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> {%- block sidebarlogo %} @@ -51,58 +51,46 @@ <p class="topless"><a href="{{ next.link|e }}" title="{{ _('next chapter') }}">{{ next.title }}</a></p> {%- endif %} {%- endblock %} - {%- if sourcename %} + {%- block sidebarsourcelink %} + {%- if show_source and has_source and sourcename %} <h3>{{ _('This Page') }}</h3> <ul class="this-page-menu"> - {%- if builder == 'web' %} - <li><a href="#comments">Comments ({{ comments|length }} so far)</a></li> - <li><a href="{{ pathto('@edit/' + sourcename)|e }}">{{ _('Suggest Change') }}</a></li> - <li><a href="{{ pathto('@source/' + sourcename)|e }}">{{ _('Show Source') }}</a></li> - {%- elif builder == 'html' %} - <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}">{{ _('Show Source') }}</a></li> - {%- endif %} + <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow">{{ _('Show Source') }}</a></li> </ul> {%- endif %} + {%- endblock %} {%- if customsidebar %} - {{ rendertemplate(customsidebar) }} + {% include customsidebar %} {%- endif %} {%- block sidebarsearch %} {%- if pagename != "search" %} - <h3>{% if builder == 'web' %}{{ _('Keyword search')}}{% else %}{{ _('Quick search') }}{% endif %}</h3> + <h3>{{ _('Quick search') }}</h3> <form class="search" action="{{ pathto('search') }}" method="get"> <input type="text" name="q" size="18" /> <input type="submit" value="{{ _('Go') }}" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> - {%- if builder == 'web' %} - <p style="font-size: 90%">{{ _('Enter a module, class or function name.') }}</p> - {%- endif %} + <p style="font-size: 90%">{{ _('Enter search terms or a module, class or function name.') }}</p> {%- endif %} {%- endblock %} </div> </div> {%- endif %} -{%- endmacro -%} +{%- endmacro %} <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> {{ metatags }} - {%- if builder != 'htmlhelp' %} - {%- set titlesuffix = " — " + docstitle|e %} + {%- if not embedded %} + {%- set titlesuffix = " — "|safe + docstitle|e %} + {%- else %} + {%- set titlesuffix = "" %} {%- endif %} <title>{{ title|striptags }}{{ titlesuffix }}</title> - {%- if builder == 'web' %} - <link rel="stylesheet" href="{{ pathto('index') }}?do=stylesheet{% - if in_admin_panel %}&admin=yes{% endif %}" type="text/css" /> - {%- for link, type, title in page_links %} - <link rel="alternate" type="{{ type|e(true) }}" title="{{ title|e(true) }}" href="{{ link|e(true) }}" /> - {%- endfor %} - {%- else %} <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /> <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> - {%- endif %} - {%- if builder != 'htmlhelp' %} + {%- if not embedded %} <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '{{ pathto("", 1) }}', @@ -155,13 +143,13 @@ {%- block document %} <div class="document"> <div class="documentwrapper"> - {%- if builder != 'htmlhelp' %} + {%- if not embedded %} <div class="bodywrapper"> {%- endif %} <div class="body"> {% block body %} {% endblock %} </div> - {%- if builder != 'htmlhelp' %} + {%- if not embedded %} </div> {%- endif %} </div> diff --git a/sphinx/templates/modindex.html b/sphinx/templates/modindex.html index d6b505da..6e33e55c 100644 --- a/sphinx/templates/modindex.html +++ b/sphinx/templates/modindex.html @@ -2,7 +2,7 @@ {% set title = _('Global Module Index') %} {% block extrahead %} {{ super() }} -{% if builder != 'htmlhelp' and collapse_modindex %} +{% if not embedded and collapse_modindex %} <script type="text/javascript"> DOCUMENTATION_OPTIONS.COLLAPSE_MODINDEX = true; </script> @@ -11,26 +11,6 @@ {% block body %} <h1 id="global-module-index">{{ _('Global Module Index') }}</h1> -{% if builder == 'web' and freqentries %} - <p>{{ _('Most popular modules:') }}</p> - <div class="modulecloud"> - {%- for module in freqentries %} - <a href="../q/{{ module.name|e }}/" style="font-size: {{ module.size }}%">{{ module.name|e }}</a> - {%- endfor %} - </div> -{% endif %} -{% if builder == 'web' %} - <form class="pfform" action="" method="get"> - {{ _('Show modules only available on these platforms') }}:<br> - {% for pl in platforms -%} - <input type="checkbox" name="pf" value="{{ pl }}" id="pl-{{ pl }}" - {%- if pl in showpf %} checked="checked"{% endif %}> - <label for="pl-{{ pl }}">{{ pl }}</label> - {% endfor %} - <input type="hidden" name="newpf" value="true"> - <input type="submit" value="Apply"> - </form> -{% endif %} {%- for letter in letters %} <a href="#cap-{{ letter }}"><strong>{{ letter }}</strong></a> {% if not loop.last %}| {% endif %} @@ -52,7 +32,7 @@ {% if fname %}<a href="{{ fname }}">{% endif -%} <tt class="xref">{{ modname|e }}</tt> {%- if fname %}</a>{% endif %} - {%- if pform[0] %} <em>({{ pform|join(', ') }})</em>{% endif -%} + {%- if pform and pform[0] %} <em>({{ pform|join(', ') }})</em>{% endif -%} </td><td>{% if dep %}<strong>{{ _('Deprecated')}}:</strong>{% endif %} <em>{{ synops|e }}</em></td></tr> {%- endif -%} diff --git a/sphinx/templates/page.html b/sphinx/templates/page.html index 4de23b13..17a93016 100644 --- a/sphinx/templates/page.html +++ b/sphinx/templates/page.html @@ -1,12 +1,4 @@ {% extends "layout.html" %} -{% set page_links = [ - (pathto('@rss/' + sourcename), 'application/rss+xml', 'Page Comments'), -] %} {% block body %} - {% if oldurl %} - <div class="docwarning"> - {% trans %}<strong>Note:</strong> You requested an out-of-date URL from this server. We've tried to redirect you to the new location of this page, but it may not be the right one.{% endtrans %} - </div> - {% endif %} {{ body }} {% endblock %} diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index e5ed4d79..bb247664 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -451,6 +451,35 @@ \fi }{\end{fulllineitems}} +% class method ---------------------------------------------------------- +% \begin{classmethoddesc}[classname]{methodname}{args} +\newcommand{\classmethodline}[3][\@undefined]{ + \classmethodlineni{#2}{#3} + \ifx\@undefined#1\relax + \index{#2@{\py@idxcode{#2()}} (\py@thisclass\ class method)} + \else + \index{#2@{\py@idxcode{#2()}} (#1 class method)} + \fi +} +\newenvironment{classmethoddesc}[3][\@undefined]{ + \begin{fulllineitems} + \ifx\@undefined#1\relax + \classmethodline{#2}{#3} + \else + \def\py@thisclass{#1} + \classmethodline{#2}{#3} + \fi +}{\end{fulllineitems}} + +% similar to {classmethoddesc}, but doesn't add to the index +% (never actually uses the optional argument) +\newcommand{\classmethodlineni}[3][\py@classbadkey]{% + \py@sigline{class \bfcode{#2}}{#3}} +\newenvironment{classmethoddescni}[3][\py@classbadkey]{ + \begin{fulllineitems} + \classmethodlineni{#2}{#3} +}{\end{fulllineitems}} + % object data attribute -------------------------------------------------- % \begin{memberdesc}[classname]{membername} \newcommand{\memberline}[2][\py@classbadkey]{% diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index e4273106..f04f3a31 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -15,6 +15,7 @@ import sys import time import fnmatch import tempfile +import posixpath import traceback from os import path @@ -48,6 +49,11 @@ def relative_uri(base, to): return ('..' + SEP) * (len(b2)-1) + SEP.join(t2) +def docname_join(basedocname, docname): + return posixpath.normpath( + posixpath.join('/' + basedocname, '..', docname))[1:] + + def ensuredir(path): """Ensure that a path exists.""" try: @@ -282,3 +288,39 @@ def nested_parse_with_titles(state, content, node): def ustrftime(format, *args): # strftime for unicode strings return time.strftime(unicode(format).encode('utf-8'), *args).decode('utf-8') + + +class FilenameUniqDict(dict): + """ + A dictionary that automatically generates unique names for its keys, + interpreted as filenames, and keeps track of a set of docnames they + appear in. Used for images and downloadable files in the environment. + """ + def __init__(self): + self._existing = set() + + def add_file(self, docname, newfile): + if newfile in self: + self[newfile][0].add(docname) + return + uniquename = path.basename(newfile) + base, ext = path.splitext(uniquename) + i = 0 + while uniquename in self._existing: + i += 1 + uniquename = '%s%s%s' % (base, i, ext) + self[newfile] = (set([docname]), uniquename) + self._existing.add(uniquename) + return uniquename + + def purge_doc(self, docname): + for filename, (docs, _) in self.items(): + docs.discard(docname) + if not docs: + del self[filename] + + def __getstate__(self): + return self._existing + + def __setstate__(self, state): + self._existing = state diff --git a/sphinx/writers/__init__.py b/sphinx/writers/__init__.py new file mode 100644 index 00000000..7bb8cad9 --- /dev/null +++ b/sphinx/writers/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +""" + sphinx.writers + ~~~~~~~~~~~~~~ + + Custom docutils writers. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" diff --git a/sphinx/htmlwriter.py b/sphinx/writers/html.py index f983aa76..e34b8fa9 100644 --- a/sphinx/htmlwriter.py +++ b/sphinx/writers/html.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - sphinx.htmlwriter - ~~~~~~~~~~~~~~~~~ + sphinx.writers.html + ~~~~~~~~~~~~~~~~~~~ docutils writers handling Sphinx' custom nodes. @@ -58,6 +58,7 @@ class HTMLTranslator(BaseTranslator): self.highlightlang = builder.config.highlight_language self.highlightlinenothreshold = sys.maxint self.protect_literal_text = 0 + self.add_permalinks = builder.config.html_add_permalinks def visit_desc(self, node): self.body.append(self.starttag(node, 'dl', CLASS=node['desctype'])) @@ -73,7 +74,7 @@ class HTMLTranslator(BaseTranslator): if node.parent['desctype'] in ('class', 'exception'): self.body.append('%s ' % node.parent['desctype']) def depart_desc_signature(self, node): - if node['ids'] and self.builder.add_definition_links: + if node['ids'] and self.add_permalinks and self.builder.add_permalinks: self.body.append(u'<a class="headerlink" href="#%s" ' % node['ids'][0] + u'title="%s">\u00B6</a>' % _('Permalink to this definition')) @@ -89,6 +90,11 @@ class HTMLTranslator(BaseTranslator): def depart_desc_type(self, node): pass + def visit_desc_returns(self, node): + self.body.append(' → ') + def depart_desc_returns(self, node): + pass + def visit_desc_name(self, node): self.body.append(self.starttag(node, 'tt', '', CLASS='descname')) def depart_desc_name(self, node): @@ -253,6 +259,16 @@ class HTMLTranslator(BaseTranslator): def depart_highlightlang(self, node): pass + def visit_download_reference(self, node): + if node.hasattr('filename'): + self.body.append('<a href="%s">' % posixpath.join( + self.builder.dlpath, node['filename'])) + self.context.append('</a>') + else: + self.context.append('') + def depart_download_reference(self, node): + self.body.append(self.context.pop()) + # overwritten def visit_image(self, node): olduri = node['uri'] @@ -388,7 +404,7 @@ class HTMLTranslator(BaseTranslator): def depart_title(self, node): close_tag = self.context[-1] - if self.builder.add_header_links and \ + if self.add_permalinks and self.builder.add_permalinks and \ (close_tag.startswith('</h') or close_tag.startswith('</a></h')) and \ node.parent.hasattr('ids') and node.parent['ids']: diff --git a/sphinx/latexwriter.py b/sphinx/writers/latex.py index bfc9165a..c16a4271 100644 --- a/sphinx/latexwriter.py +++ b/sphinx/writers/latex.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - sphinx.latexwriter - ~~~~~~~~~~~~~~~~~~ + sphinx.writers.latex + ~~~~~~~~~~~~~~~~~~~~ Custom docutils writer for LaTeX. @@ -91,7 +91,7 @@ class LaTeXWriter(writers.Writer): class ExtBabel(Babel): def get_shorthandoff(self): shortlang = self.language.split('_')[0] - if shortlang in ('de', 'sl', 'pt', 'es', 'nl', 'pl'): + if shortlang in ('de', 'sl', 'pt', 'es', 'nl', 'pl', 'it'): return '\\shorthandoff{"}' return '' @@ -112,7 +112,8 @@ class Table(object): class Desc(object): def __init__(self, node): self.env = LaTeXTranslator.desc_map.get(node['desctype'], 'describe') - self.type = self.cls = self.name = self.params = self.annotation = '' + self.type = self.cls = self.name = self.params = \ + self.annotation = self.returns = '' self.count = 0 @@ -237,6 +238,8 @@ class LaTeXTranslator(nodes.NodeVisitor): # ... and all others are the appendices self.body.append('\n\\appendix\n') self.first_document = -1 + if 'docname' in node: + self.body.append('\\hypertarget{--doc-%s}{}' % node['docname']) # "- 1" because the level is increased before the title is visited self.sectionlevel = self.top_sectionlevel - 1 def depart_document(self, node): @@ -259,6 +262,8 @@ class LaTeXTranslator(nodes.NodeVisitor): self.body.append('\n\\resetcurrentobjects\n') # and also, new footnotes self.footnotestack.append(self.collect_footnotes(node)) + # also add a document target + self.body.append('\\hypertarget{--doc-%s}{}' % node['docname']) def collect_footnotes(self, node): fnotes = {} @@ -394,6 +399,7 @@ class LaTeXTranslator(nodes.NodeVisitor): 'function' : 'funcdesc', 'class': 'classdesc', 'method': 'methoddesc', + 'classmethod': 'classmethoddesc', 'staticmethod': 'staticmethoddesc', 'exception': 'excdesc', 'data': 'datadesc', @@ -436,7 +442,7 @@ class LaTeXTranslator(nodes.NodeVisitor): t2 = "{%s}{%s}" % (d.name, d.params) elif d.env in ('datadesc', 'excdesc', 'csimplemacrodesc'): t2 = "{%s}" % (d.name) - elif d.env in ('methoddesc', 'staticmethoddesc'): + elif d.env in ('methoddesc', 'classmethoddesc', 'staticmethoddesc'): if d.cls: t2 = "[%s]{%s}{%s}" % (d.cls, d.name, d.params) else: @@ -477,6 +483,14 @@ class LaTeXTranslator(nodes.NodeVisitor): self.descstack[-1].type = self.encode(node.astext().strip()) raise nodes.SkipNode + def visit_desc_returns(self, node): + d = self.descstack[-1] + if d.env == 'describe': + d.name += ' $\\rightarrow$ ' + self.encode(node.astext()) + else: + self.descstack[-1].returns = self.encode(node.astext().strip()) + raise nodes.SkipNode + def visit_desc_name(self, node): d = self.descstack[-1] if d.env == 'describe': @@ -923,6 +937,11 @@ class LaTeXTranslator(nodes.NodeVisitor): elif uri.startswith('#'): self.body.append('\\hyperlink{%s}{' % uri[1:]) self.context.append('}') + elif uri.startswith('%'): + hashindex = uri.find('#') + targetname = (hashindex == -1) and '--doc-' + uri[1:] or uri[hashindex+1:] + self.body.append('\\hyperlink{%s}{' % targetname) + self.context.append('}') elif uri.startswith('@token'): if self.in_production_list: self.body.append('\\token{') @@ -935,6 +954,11 @@ class LaTeXTranslator(nodes.NodeVisitor): def depart_reference(self, node): self.body.append(self.context.pop()) + def visit_download_reference(self, node): + pass + def depart_download_reference(self, node): + pass + def visit_pending_xref(self, node): pass def depart_pending_xref(self, node): diff --git a/sphinx/textwriter.py b/sphinx/writers/text.py index 383af782..5c8500fb 100644 --- a/sphinx/textwriter.py +++ b/sphinx/writers/text.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - sphinx.textwriter - ~~~~~~~~~~~~~~~~~ + sphinx.writers.text + ~~~~~~~~~~~~~~~~~~~ Custom docutils writer for plain text. @@ -195,6 +195,11 @@ class TextTranslator(nodes.NodeVisitor): def depart_desc_type(self, node): pass + def visit_desc_returns(self, node): + self.add_text(' -> ') + def depart_desc_returns(self, node): + pass + def visit_desc_parameterlist(self, node): self.add_text('(') self.first_param = 1 @@ -609,6 +614,11 @@ class TextTranslator(nodes.NodeVisitor): def depart_reference(self, node): pass + def visit_download_reference(self, node): + pass + def depart_download_reference(self, node): + pass + def visit_emphasis(self, node): self.add_text('*') def depart_emphasis(self, node): diff --git a/tests/root/includes.txt b/tests/root/includes.txt index ad507fc6..d2964d3f 100644 --- a/tests/root/includes.txt +++ b/tests/root/includes.txt @@ -14,3 +14,11 @@ Test file and literal inclusion :encoding: latin-1 .. include:: wrongenc.inc :encoding: latin-1 + + +Testing downloadable files +========================== + +Download :download:`img.png` here. +Download :download:`this <subdir/img.png>` there. +Don't download :download:`this <nonexisting.png>`. diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index 752c0725..837b5695 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -24,6 +24,7 @@ def setup_module(): app.builder.env.app = app app.connect('autodoc-process-docstring', process_docstring) app.connect('autodoc-process-signature', process_signature) + app.connect('autodoc-skip-member', skip_member) options = Struct( inherited_members = False, @@ -71,44 +72,51 @@ def process_signature(app, what, name, obj, options, args, retann): return '42', None +def skip_member(app, what, name, obj, skip, options): + if name.startswith('_'): + return True + if name == 'skipmeth': + return True + + def test_resolve_name(): # for modules assert gen.resolve_name('module', 'test_autodoc') == \ - ('test_autodoc', 'test_autodoc', [], None, None) + ('test_autodoc', [], None, None) assert gen.resolve_name('module', 'test.test_autodoc') == \ - ('test.test_autodoc', 'test.test_autodoc', [], None, None) + ('test.test_autodoc', [], None, None) assert gen.resolve_name('module', 'test(arg)') == \ - ('test', 'test', [], None, None) + ('test', [], None, None) assert 'ignoring signature arguments' in gen.warnings[0] del gen.warnings[:] # for functions/classes assert gen.resolve_name('function', 'util.raises') == \ - ('util.raises', 'util', ['raises'], None, None) + ('util', ['raises'], None, None) assert gen.resolve_name('function', 'util.raises(exc) -> None') == \ - ('util.raises', 'util', ['raises'], 'exc', ' -> None') + ('util', ['raises'], 'exc', 'None') gen.env.autodoc_current_module = 'util' assert gen.resolve_name('function', 'raises') == \ - ('raises', 'util', ['raises'], None, None) + ('util', ['raises'], None, None) gen.env.autodoc_current_module = None gen.env.currmodule = 'util' assert gen.resolve_name('function', 'raises') == \ - ('raises', 'util', ['raises'], None, None) + ('util', ['raises'], None, None) assert gen.resolve_name('class', 'TestApp') == \ - ('TestApp', 'util', ['TestApp'], None, None) + ('util', ['TestApp'], None, None) # for members gen.env.currmodule = 'foo' assert gen.resolve_name('method', 'util.TestApp.cleanup') == \ - ('util.TestApp.cleanup', 'util', ['TestApp', 'cleanup'], None, None) + ('util', ['TestApp', 'cleanup'], None, None) gen.env.currmodule = 'util' gen.env.currclass = 'Foo' gen.env.autodoc_current_class = 'TestApp' assert gen.resolve_name('method', 'cleanup') == \ - ('cleanup', 'util', ['TestApp', 'cleanup'], None, None) + ('util', ['TestApp', 'cleanup'], None, None) assert gen.resolve_name('method', 'TestApp.cleanup') == \ - ('TestApp.cleanup', 'util', ['TestApp', 'cleanup'], None, None) + ('util', ['TestApp', 'cleanup'], None, None) # and clean up gen.env.currmodule = None @@ -126,7 +134,7 @@ def test_format_signature(): assert gen.format_signature('function', 'f', f, None, None) == '(a, b, c=1, **d)' assert gen.format_signature('function', 'f', f, 'a, b, c, d', None) == \ '(a, b, c, d)' - assert gen.format_signature('function', 'f', f, None, ' -> None') == \ + assert gen.format_signature('function', 'f', f, None, 'None') == \ '(a, b, c=1, **d) -> None' # test for classes @@ -144,7 +152,7 @@ def test_format_signature(): pass for C in (F, G): assert gen.format_signature('class', 'C', C, None, None) == '(a, b=None)' - assert gen.format_signature('class', 'C', D, 'a, b', ' -> X') == '(a, b) -> X' + assert gen.format_signature('class', 'C', D, 'a, b', 'X') == '(a, b) -> X' # test for methods class H: @@ -313,17 +321,17 @@ def test_generate(): assert_works('exception', 'test_autodoc.CustomEx', [], None) # test diverse inclusion settings for members - should = [('class', 'Class')] + should = [('class', 'test_autodoc.Class')] assert_processes(should, 'class', 'Class', [], None) - should.extend([('method', 'Class.meth')]) + should.extend([('method', 'test_autodoc.Class.meth')]) assert_processes(should, 'class', 'Class', ['meth'], None) - should.extend([('attribute', 'Class.prop')]) + should.extend([('attribute', 'test_autodoc.Class.prop')]) assert_processes(should, 'class', 'Class', ['__all__'], None) options.undoc_members = True - should.append(('method', 'Class.undocmeth')) + should.append(('method', 'test_autodoc.Class.undocmeth')) assert_processes(should, 'class', 'Class', ['__all__'], None) options.inherited_members = True - should.append(('method', 'Class.inheritedmeth')) + should.append(('method', 'test_autodoc.Class.inheritedmeth')) assert_processes(should, 'class', 'Class', ['__all__'], None) # test module flags @@ -355,6 +363,12 @@ def test_generate(): assert_result_contains('.. class:: CustomDict', 'class', 'CustomDict', ['__all__'], None) + # test inner class handling + assert_processes([('class', 'test_autodoc.Outer'), + ('class', 'test_autodoc.Outer.Inner'), + ('method', 'test_autodoc.Outer.Inner.meth')], + 'class', 'Outer', ['__all__'], None) + # --- generate fodder ------------ @@ -380,6 +394,10 @@ class Class(Base): def undocmeth(self): pass + def skipmeth(self): + """Method that should be skipped.""" + pass + @property def prop(self): """Property.""" @@ -392,3 +410,15 @@ def function(foo, *args, **kwds): Return spam. """ pass + + +class Outer(object): + """Foo""" + + class Inner(object): + """Foo""" + + def meth(self): + """Foo""" + + factory = dict diff --git a/tests/test_build.py b/tests/test_build.py index aed56a8c..d8fbc056 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -19,8 +19,9 @@ from subprocess import Popen, PIPE from util import * from etree13 import ElementTree as ET -from sphinx.builder import StandaloneHTMLBuilder, LaTeXBuilder -from sphinx.latexwriter import LaTeXTranslator +from sphinx.builders.html import StandaloneHTMLBuilder +from sphinx.builders.latex import LaTeXBuilder +from sphinx.writers.latex import LaTeXTranslator html_warnfile = StringIO() @@ -31,6 +32,7 @@ WARNING: %(root)s/images.txt:9: Image file not readable: foo.png WARNING: %(root)s/images.txt:23: Nonlocal image URI found: http://www.python.org/logo.png WARNING: %(root)s/includes.txt:: (WARNING/2) Encoding 'utf-8' used for reading included \ file u'wrongenc.inc' seems to be wrong, try giving an :encoding: option +WARNING: %(root)s/includes.txt:34: Download file not readable: nonexisting.png """ HTML_WARNINGS = ENV_WARNINGS + """\ @@ -57,6 +59,8 @@ HTML_XPATH = { 'includes.html': { ".//pre/span[@class='s']": u'üöä', ".//pre": u'Max Strauß', + ".//a[@href='_downloads/img.png']": '', + ".//a[@href='_downloads/img1.png']": '', }, 'autodoc.html': { ".//dt[@id='test_autodoc.Class']": '', diff --git a/tests/test_config.py b/tests/test_config.py index bc5ab8a0..6343a364 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -15,7 +15,8 @@ from util import * from sphinx.application import ExtensionError -@with_app(confoverrides={'master_doc': 'master', 'nonexisting_value': 'True'}) +@with_app(confoverrides={'master_doc': 'master', 'nonexisting_value': 'True', + 'latex_elements.docclass': 'scrartcl'}) def test_core_config(app): cfg = app.config @@ -26,6 +27,7 @@ def test_core_config(app): # overrides assert cfg.master_doc == 'master' + assert cfg.latex_elements['docclass'] == 'scrartcl' # simple default values assert 'exclude_dirs' not in cfg.__dict__ diff --git a/tests/test_env.py b/tests/test_env.py index 390c6999..685311e6 100644 --- a/tests/test_env.py +++ b/tests/test_env.py @@ -12,7 +12,8 @@ from util import * from sphinx.environment import BuildEnvironment -from sphinx.builder import StandaloneHTMLBuilder, LaTeXBuilder +from sphinx.builders.html import StandaloneHTMLBuilder +from sphinx.builders.latex import LaTeXBuilder app = env = None warnings = [] @@ -76,11 +77,13 @@ def test_second_update(): (root / 'new.txt').write_text('New file\n========\n') it = env.update(app.config, app.srcdir, app.doctreedir, app) msg = it.next() - assert '1 added, 1 changed, 1 removed' in msg + assert '1 added, 2 changed, 1 removed' in msg docnames = set() for docname in it: docnames.add(docname) - assert docnames == set(['contents', 'new']) + # "includes" is in there because it contains a reference to a nonexisting + # downloadable file, which is given another chance to exist + assert docnames == set(['contents', 'new', 'includes']) assert 'images' not in env.all_docs assert 'images' not in env.found_docs diff --git a/tests/test_highlighting.py b/tests/test_highlighting.py new file mode 100644 index 00000000..198f7a0a --- /dev/null +++ b/tests/test_highlighting.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +""" + test_highlighting + ~~~~~~~~~~~~~~~~~ + + Test the Pygments highlighting bridge. + + :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from util import * + +from pygments.lexer import RegexLexer +from pygments.token import Text, Name +from pygments.formatters.html import HtmlFormatter + +from sphinx.highlighting import PygmentsBridge + + +class MyLexer(RegexLexer): + name = 'testlexer' + + tokens = { + 'root': [ + ('a', Name), + ('b', Text), + ], + } + +class ComplainOnUnhighlighted(PygmentsBridge): + + def unhighlighted(self, source): + raise AssertionError("should highlight %r" % source) + +class MyFormatter(HtmlFormatter): + def format(self, tokensource, outfile): + outfile.write('test') + + +@with_app() +def test_add_lexer(app): + app.add_lexer('test', MyLexer()) + + bridge = PygmentsBridge('html') + ret = bridge.highlight_block('ab', 'test') + assert '<span class="n">a</span>b' in ret + +def test_detect_interactive(): + bridge = ComplainOnUnhighlighted('html') + blocks = [ + """ + >>> testing() + True + """, + ] + for block in blocks: + ret = bridge.highlight_block(block.lstrip(), 'python') + assert ret.startswith("<div class=\"highlight\">") + +def test_set_formatter(): + PygmentsBridge.html_formatter = MyFormatter + try: + bridge = PygmentsBridge('html') + ret = bridge.highlight_block('foo', 'python') + assert ret == 'test' + finally: + PygmentsBridge.html_formatter = HtmlFormatter diff --git a/tests/test_markup.py b/tests/test_markup.py index 5fd70f05..14af3555 100644 --- a/tests/test_markup.py +++ b/tests/test_markup.py @@ -17,8 +17,8 @@ from docutils import frontend, utils, nodes from docutils.parsers import rst from sphinx import addnodes -from sphinx.htmlwriter import HTMLWriter, SmartyPantsHTMLTranslator -from sphinx.latexwriter import LaTeXWriter, LaTeXTranslator +from sphinx.writers.html import HTMLWriter, SmartyPantsHTMLTranslator +from sphinx.writers.latex import LaTeXWriter, LaTeXTranslator def setup_module(): global app, settings, parser diff --git a/tests/util.py b/tests/util.py index 2cd2c031..03363af9 100644 --- a/tests/util.py +++ b/tests/util.py @@ -19,7 +19,7 @@ except ImportError: # functools is new in 2.4 wraps = lambda f: (lambda w: w) -from sphinx import application, builder +from sphinx import application from path import path |
