diff --git a/CHANGES b/CHANGES index 2b66530c3..9312382b2 100644 --- a/CHANGES +++ b/CHANGES @@ -54,6 +54,13 @@ Release 1.0 (in development) Release 0.6.4 (in development) ============================== +* #299: Fix the mangling of quotes in some literal blocks. + +* #292: Fix path to the search index for the ``dirhtml`` builder. + +* Fix a Jython compatibility issue: make the dependence on the + ``parser`` module optional. + * #238: In autodoc, catch all errors that occur on module import, not just ``ImportError``. diff --git a/EXAMPLES b/EXAMPLES index 9d97c8156..dd203d463 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -46,10 +46,12 @@ included, please mail to `the Google group * ObjectListView: http://objectlistview.sourceforge.net/python * Open ERP: http://doc.openerp.com/ * OpenEXR: http://excamera.com/articles/26/doc/index.html +* OpenGDA: http://www.opengda.org/gdadoc/html/ * OpenLayers: http://docs.openlayers.org/ * openWNS: http://docs.openwns.org/ * Paste: http://pythonpaste.org/script/ * Paver: http://www.blueskyonmars.com/projects/paver/ +* Peach^3: http://peach3.nl/doc/latest/userdoc/ * Py on Windows: http://timgolden.me.uk/python-on-windows/ * Pyccuracy: http://www.pyccuracy.org/ * PyCuda: http://documen.tician.de/pycuda/ @@ -62,6 +64,7 @@ included, please mail to `the Google group * PyPubSub: http://pubsub.sourceforge.net/ * pyrticle: http://documen.tician.de/pyrticle/ * Pysparse: http://pysparse.sourceforge.net/ +* PyTango: http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html * Python: http://docs.python.org/ * python-apt: http://people.debian.org/~jak/python-apt-doc/ * PyUblas: http://documen.tician.de/pyublas/ diff --git a/doc/ext/autosummary.rst b/doc/ext/autosummary.rst index f270a67b6..5a206dd50 100644 --- a/doc/ext/autosummary.rst +++ b/doc/ext/autosummary.rst @@ -214,7 +214,7 @@ The following variables available in the templates: List containing names of "public" methods in the class. Only available for classes. -.. data:: methods +.. data:: attributes List containing names of "public" attributes in the class. Only available for classes. diff --git a/doc/templating.rst b/doc/templating.rst index 80c290ca3..21b9a42ec 100644 --- a/doc/templating.rst +++ b/doc/templating.rst @@ -74,8 +74,8 @@ render the block's content in the extended template -- unless you don't want that content to show up. -Working the the builtin templates ---------------------------------- +Working with the builtin templates +---------------------------------- The builtin **basic** theme supplies the templates that all builtin Sphinx themes are based on. It has the following elements you can override or use: diff --git a/sphinx/application.py b/sphinx/application.py index 55998058e..ae1a4546d 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -30,7 +30,7 @@ from sphinx.domains import ObjType, all_domains from sphinx.domains.std import GenericObject, Target, StandardDomain from sphinx.builders import BUILTIN_BUILDERS from sphinx.environment import BuildEnvironment, SphinxStandaloneReader -from sphinx.util import pycompat # imported for side-effects +from sphinx.util import ENOENT, pycompat # pycompat imported for side-effects from sphinx.util.tags import Tags from sphinx.util.console import bold @@ -153,7 +153,7 @@ class Sphinx(object): self.env.domains[domain] = all_domains[domain](self.env) self.info('done') except Exception, err: - if type(err) is IOError and err.errno == 2: + if type(err) is IOError and err.errno == ENOENT: self.info('not yet created') else: self.info('failed: %s' % err) diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py index 449d9524a..e804cb1e2 100644 --- a/sphinx/ext/graphviz.py +++ b/sphinx/ext/graphviz.py @@ -22,7 +22,7 @@ except ImportError: from docutils import nodes from sphinx.errors import SphinxError -from sphinx.util import ensuredir +from sphinx.util import ensuredir, ENOENT from sphinx.util.compat import Directive @@ -111,7 +111,7 @@ def render_dot(self, code, options, format, prefix='graphviz'): try: p = Popen(dot_args, stdout=PIPE, stdin=PIPE, stderr=PIPE) except OSError, err: - if err.errno != 2: # No such file or directory + if err.errno != ENOENT: # No such file or directory raise self.builder.warn('dot command %r cannot be run (needed for graphviz ' 'output), check the graphviz_dot setting' % diff --git a/sphinx/ext/pngmath.py b/sphinx/ext/pngmath.py index 02f46e3d3..a3df27e43 100644 --- a/sphinx/ext/pngmath.py +++ b/sphinx/ext/pngmath.py @@ -23,7 +23,7 @@ except ImportError: from docutils import nodes from sphinx.errors import SphinxError -from sphinx.util import ensuredir +from sphinx.util import ensuredir, ENOENT from sphinx.util.png import read_png_depth, write_png_depth from sphinx.ext.mathbase import setup_math as mathbase_setup, wrap_displaymath @@ -119,7 +119,7 @@ def render_math(self, math): try: p = Popen(ltx_args, stdout=PIPE, stderr=PIPE) except OSError, err: - if err.errno != 2: # No such file or directory + if err.errno != ENOENT: # No such file or directory raise self.builder.warn('LaTeX command %r cannot be run (needed for math ' 'display), check the pngmath_latex setting' % @@ -147,7 +147,7 @@ def render_math(self, math): try: p = Popen(dvipng_args, stdout=PIPE, stderr=PIPE) except OSError, err: - if err.errno != 2: # No such file or directory + if err.errno != ENOENT: # No such file or directory raise self.builder.warn('dvipng command %r cannot be run (needed for math ' 'display), check the pngmath_dvipng setting' % diff --git a/sphinx/themes/basic/search.html b/sphinx/themes/basic/search.html index 224d87b86..96c406527 100644 --- a/sphinx/themes/basic/search.html +++ b/sphinx/themes/basic/search.html @@ -41,5 +41,5 @@ {% endblock %} {% block footer %} {{ super() }} - + {% endblock %} diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index b439a7e74..bede51fad 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -28,6 +28,9 @@ from docutils import nodes import sphinx +# Errnos that we need. +EEXIST = getattr(errno, 'EEXIST', 0) +ENOENT = getattr(errno, 'ENOENT', 0) # Generally useful regular expressions. ws_re = re.compile(r'\s+') @@ -72,7 +75,7 @@ def ensuredir(path): os.makedirs(path) except OSError, err: # 0 for Jython/Win32 - if err.errno not in [0, getattr(errno, 'EEXIST', 0)]: + if err.errno not in [0, EEXIST]: raise diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py index 737710f51..d2df06cf3 100644 --- a/sphinx/writers/html.py +++ b/sphinx/writers/html.py @@ -490,6 +490,13 @@ class SmartyPantsHTMLTranslator(HTMLTranslator): finally: self.no_smarty -= 1 + def visit_literal_block(self, node): + self.no_smarty += 1 + try: + HTMLTranslator.visit_literal_block(self, node) + finally: + self.no_smarty -= 1 + def visit_literal_emphasis(self, node): self.no_smarty += 1 self.visit_emphasis(node) diff --git a/tests/root/includes.txt b/tests/root/includes.txt index da36503b3..d6da137f0 100644 --- a/tests/root/includes.txt +++ b/tests/root/includes.txt @@ -56,3 +56,11 @@ Test if dedenting before parsing works. .. cssclass:: inc-pyobj-dedent .. literalinclude:: literal.inc :pyobject: Bar.baz + +Docutils include with "literal" +=============================== + +While not recommended, it should work (and leave quotes alone). + +.. include:: quotes.inc + :literal: diff --git a/tests/root/quotes.inc b/tests/root/quotes.inc new file mode 100644 index 000000000..276cc56ba --- /dev/null +++ b/tests/root/quotes.inc @@ -0,0 +1 @@ +Testing "quotes" in literal 'included' text. diff --git a/tests/test_build_html.py b/tests/test_build_html.py index dd89ff2e0..7079971c4 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -60,6 +60,8 @@ HTML_XPATH = { ".//pre": u'Max Strauß', ".//a[@href='_downloads/img.png']": '', ".//a[@href='_downloads/img1.png']": '', + ".//pre": u'"quotes"', + ".//pre": u"'included'", }, 'autodoc.html': { ".//dt[@id='test_autodoc.Class']": '',