From 8c7e288129ab1d591efbe6de20ac02548335d83d Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 5 Jun 2010 18:27:43 +0200 Subject: [PATCH 01/29] #440: Remove usage of a Python >= 2.5 API in the ``literalinclude`` directive. CodecInfo is not a namedtuple, so accessing attributes on 2.4 fails. --- CHANGES | 3 +++ sphinx/directives/code.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2adf4a3fa..1ec8f8e75 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ Release 0.6.7 (in development) ============================== +* #440: Remove usage of a Python >= 2.5 API in the ``literalinclude`` + directive. + Release 0.6.6 (May 25, 2010) ============================ diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py index b4375a98c..50ebcfde4 100644 --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -118,7 +118,7 @@ class LiteralInclude(Directive): codec_info = codecs.lookup(encoding) try: f = codecs.StreamReaderWriter(open(fn, 'U'), - codec_info.streamreader, codec_info.streamwriter, 'strict') + codec_info[2], codec_info[3], 'strict') lines = f.readlines() f.close() except (IOError, OSError): From b50e09e33e1d387255bcc1b97aa08c560f8691a7 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 5 Jun 2010 18:30:43 +0200 Subject: [PATCH 02/29] Fix a bug that prevented some references being generated in the LaTeX builder. --- CHANGES | 3 +++ sphinx/writers/latex.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 1ec8f8e75..7aba6d5dc 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,9 @@ Release 0.6.7 (in development) * #440: Remove usage of a Python >= 2.5 API in the ``literalinclude`` directive. +* Fix a bug that prevented some references being generated in the + LaTeX builder. + Release 0.6.6 (May 25, 2010) ============================ diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 438820570..d8818f017 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -1043,6 +1043,8 @@ class LaTeXTranslator(nodes.NodeVisitor): def visit_reference(self, node): uri = node.get('refuri', '') + if not uri and node.get('refid'): + uri = '%' + self.curfilestack[-1] + '#' + node['refid'] if self.in_title or not uri: self.context.append('') elif uri.startswith('mailto:') or uri.startswith('http:') or \ From 8d6aa310fe22817040304a91340ed20f5c18aa05 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 5 Jun 2010 18:31:37 +0200 Subject: [PATCH 03/29] Explain absolute paths in toctree. --- doc/concepts.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/concepts.rst b/doc/concepts.rst index d9979d3fc..93593f7dc 100644 --- a/doc/concepts.rst +++ b/doc/concepts.rst @@ -34,9 +34,10 @@ tables of contents. The ``toctree`` directive is the central element. This directive inserts a "TOC tree" at the current location, using the individual TOCs (including "sub-TOC trees") of the documents given in the - directive body (whose path is relative to the document the directive occurs - in). A numeric ``maxdepth`` option may be given to indicate the depth of the - tree; by default, all levels are included. [#]_ + directive body. Relative document names (not beginning with a slash) are + relative to the document the directive occurs in, absolute names are relative + to the source directory. A numeric ``maxdepth`` option may be given to + indicate the depth of the tree; by default, all levels are included. [#]_ Consider this example (taken from the Python docs' library reference index):: From 2a8b6f44c77ab48f390c84c4f0fbf1cd48c1ef52 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 5 Jun 2010 18:33:04 +0200 Subject: [PATCH 04/29] #428: Add some missing CSS styles for standard docutils classes. --- CHANGES | 2 ++ sphinx/themes/basic/static/basic.css | 46 ++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/CHANGES b/CHANGES index 7aba6d5dc..0a034651e 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,8 @@ Release 0.6.7 (in development) * Fix a bug that prevented some references being generated in the LaTeX builder. +* #428: Add some missing CSS styles for standard docutils classes. + Release 0.6.6 (May 25, 2010) ============================ diff --git a/sphinx/themes/basic/static/basic.css b/sphinx/themes/basic/static/basic.css index a04d6545b..9380118ef 100644 --- a/sphinx/themes/basic/static/basic.css +++ b/sphinx/themes/basic/static/basic.css @@ -189,6 +189,19 @@ p.rubric { font-weight: bold; } +.align-left { + text-align: left; +} + +.align-center { + clear: both; + text-align: center; +} + +.align-right { + text-align: right; +} + /* -- sidebars -------------------------------------------------------------- */ div.sidebar { @@ -272,8 +285,37 @@ th { padding-right: 5px; } +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + /* -- other body styles ----------------------------------------------------- */ +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + dl { margin-bottom: 15px; } @@ -344,6 +386,10 @@ dl.glossary dt { margin-left: 1.5em; } +.classifier { + font-style: oblique; +} + /* -- code displays --------------------------------------------------------- */ pre { From 6ab7cd4ab75440a70c4e3c0d79cd971c05a7b454 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 5 Jun 2010 18:37:16 +0200 Subject: [PATCH 05/29] #432: Fix UnicodeErrors while building LaTeX in translated locale; do not swallow UnicodeError as a warning. --- CHANGES | 2 ++ sphinx/builders/latex.py | 8 +------- sphinx/writers/latex.py | 22 +++++++++++----------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/CHANGES b/CHANGES index 0a034651e..16a1f0f1e 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,8 @@ Release 0.6.7 (in development) * #428: Add some missing CSS styles for standard docutils classes. +* #432: Fix UnicodeErrors while building LaTeX in translated locale. + Release 0.6.6 (May 25, 2010) ============================ diff --git a/sphinx/builders/latex.py b/sphinx/builders/latex.py index 751bf28cd..0db30d553 100644 --- a/sphinx/builders/latex.py +++ b/sphinx/builders/latex.py @@ -102,13 +102,7 @@ class LaTeXBuilder(Builder): doctree.settings.title = title doctree.settings.docname = docname doctree.settings.docclass = docclass - try: - docwriter.write(doctree, destination) - except UnicodeError: - self.warn("a Unicode error occurred when writing the output. " - "Please make sure all config values that contain " - "non-ASCII content are Unicode strings.") - return + docwriter.write(doctree, destination) self.info("done") def assemble_doctree(self, indexfile, toctree_only, appendices): diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index d8818f017..ca79ce819 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -262,7 +262,7 @@ class LaTeXTranslator(nodes.NodeVisitor): self.first_document = 0 elif self.first_document == 0: # ... and all others are the appendices - self.body.append('\n\\appendix\n') + self.body.append(u'\n\\appendix\n') self.first_document = -1 if node.has_key('docname'): self.body.append('\\hypertarget{--doc-%s}{}' % @@ -275,14 +275,14 @@ class LaTeXTranslator(nodes.NodeVisitor): for bi in self.bibitems: if len(widest_label) < len(bi[0]): widest_label = bi[0] - self.body.append('\n\\begin{thebibliography}{%s}\n' % widest_label) + self.body.append(u'\n\\begin{thebibliography}{%s}\n' % widest_label) for bi in self.bibitems: # cite_key: underscores must not be escaped cite_key = bi[0].replace(r"\_", "_") - self.body.append('\\bibitem[%s]{%s}{\hypertarget{%s}{} %s}\n' % + self.body.append(u'\\bibitem[%s]{%s}{\hypertarget{%s}{} %s}\n' % (bi[0], cite_key, self.idescape(cite_key.lower()), bi[1])) - self.body.append('\\end{thebibliography}\n') + self.body.append(u'\\end{thebibliography}\n') self.bibitems = [] def visit_start_of_file(self, node): @@ -578,7 +578,7 @@ class LaTeXTranslator(nodes.NodeVisitor): pass def visit_seealso(self, node): - self.body.append("\n\n\\strong{%s:}\n\n" % admonitionlabels['seealso']) + self.body.append(u'\n\n\\strong{%s:}\n\n' % admonitionlabels['seealso']) def depart_seealso(self, node): self.body.append("\n\n") @@ -624,8 +624,8 @@ class LaTeXTranslator(nodes.NodeVisitor): self.table.longtable = True self.body = self._body if not self.table.longtable and self.table.caption is not None: - self.body.append('\n\\begin{threeparttable}\n' - '\\caption{%s}\n' % self.table.caption) + self.body.append(u'\n\\begin{threeparttable}\n' + u'\\caption{%s}\n' % self.table.caption) if self.table.longtable: self.body.append('\n\\begin{longtable}') elif self.table.has_verbatim: @@ -645,7 +645,7 @@ class LaTeXTranslator(nodes.NodeVisitor): else: self.body.append('{|' + ('L|' * self.table.colcount) + '}\n') if self.table.longtable and self.table.caption is not None: - self.body.append('\\caption{%s} \\\\\n' % self.table.caption) + self.body.append(u'\\caption{%s} \\\\\n' % self.table.caption) if self.table.longtable: self.body.append('\\hline\n') @@ -655,7 +655,7 @@ class LaTeXTranslator(nodes.NodeVisitor): % _('continued from previous page')) self.body.append('\n\\hline\n') self.body.append('\\endhead\n\n') - self.body.append(r'\hline \multicolumn{%s}{|r|}{{%s}} \\ \hline' + self.body.append(ur'\hline \multicolumn{%s}{|r|}{{%s}} \\ \hline' % (self.table.colcount, _('Continued on next page'))) self.body.append('\n\\endfoot\n\n') @@ -950,7 +950,7 @@ class LaTeXTranslator(nodes.NodeVisitor): def _make_visit_admonition(name): def visit_admonition(self, node): - self.body.append('\n\\begin{notice}{%s}{%s:}' % + self.body.append(u'\n\\begin{notice}{%s}{%s:}' % (name, admonitionlabels[name])) return visit_admonition def _depart_named_admonition(self, node): @@ -1305,7 +1305,7 @@ class LaTeXTranslator(nodes.NodeVisitor): def visit_inline(self, node): classes = node.get('classes', []) - self.body.append(r'\DUspan{%s}{' %','.join(classes)) + self.body.append(r'\DUspan{%s}{' % ','.join(classes)) def depart_inline(self, node): self.body.append('}') From 4f0be2bae1a8181bd0b9696027165f9cdb8510ea Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 26 May 2010 00:08:11 +0200 Subject: [PATCH 06/29] Be more precise. --- sphinx/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/__init__.py b/sphinx/__init__.py index c5c5a4bfd..ccdfaf3b4 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -49,7 +49,7 @@ def main(argv=sys.argv): if whichmod.startswith('docutils'): whichmod = 'Docutils library' elif whichmod.startswith('jinja'): - whichmod = 'Jinja library' + whichmod = 'Jinja2 library' elif whichmod == 'roman': whichmod = 'roman module (which is distributed with Docutils)' hint = ('This can happen if you upgraded docutils using\n' From feab1d154ef88e06c1c2d344340945ede646cd46 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 25 May 2010 16:24:44 +0200 Subject: [PATCH 07/29] Fixed console.py function term_width_line() issue. #423 --- sphinx/util/console.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sphinx/util/console.py b/sphinx/util/console.py index bd2851fa4..381803bce 100644 --- a/sphinx/util/console.py +++ b/sphinx/util/console.py @@ -11,7 +11,9 @@ import os import sys +import re +_strip_core_re = re.compile('\x1b\\[(\\d\\d;){0,2}\\d\\dm') codes = {} def get_terminal_width(): @@ -29,14 +31,15 @@ def get_terminal_width(): terminal_width = int(os.environ.get('COLUMNS', 80)) - 1 return terminal_width -_tw = get_terminal_width() +_tw = get_terminal_width() def term_width_line(text): if not codes: # if no coloring, don't output fancy backspaces return text + '\n' else: - return text.ljust(_tw) + '\r' + # codes are not displayed and must be taken into account by introducing the correction factor + return text.ljust(_tw + len(text) - len(_strip_core_re.sub('', text))) + '\r' def color_terminal(): if not hasattr(sys.stdout, 'isatty'): From 7eb85e159a23526b823a636ccc956d61be1fba16 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 26 May 2010 00:25:41 +0200 Subject: [PATCH 08/29] Fix long lines. --- sphinx/util/console.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sphinx/util/console.py b/sphinx/util/console.py index 381803bce..b0f03921c 100644 --- a/sphinx/util/console.py +++ b/sphinx/util/console.py @@ -13,7 +13,7 @@ import os import sys import re -_strip_core_re = re.compile('\x1b\\[(\\d\\d;){0,2}\\d\\dm') +_ansi_re = re.compile('\x1b\\[(\\d\\d;){0,2}\\d\\dm') codes = {} def get_terminal_width(): @@ -38,8 +38,8 @@ def term_width_line(text): # if no coloring, don't output fancy backspaces return text + '\n' else: - # codes are not displayed and must be taken into account by introducing the correction factor - return text.ljust(_tw + len(text) - len(_strip_core_re.sub('', text))) + '\r' + # codes are not displayed, this must be taken into account + return text.ljust(_tw + len(text) - len(_ansi_re.sub('', text))) + '\r' def color_terminal(): if not hasattr(sys.stdout, 'isatty'): From af51c2f7bb52097b092d6b97bdaaa4eecd5d69dc Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 3 Jun 2010 17:21:33 +0200 Subject: [PATCH 09/29] Make test suite work with docutils from trunk: they emit a line number for a warning where 0.6 doesnt. --- tests/test_build.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/test_build.py b/tests/test_build.py index b04215122..502e8c8c2 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -41,20 +41,21 @@ ENV_WARNINGS = """\ %(root)s/images.txt:9: WARNING: image file not readable: foo.png %(root)s/images.txt:23: WARNING: nonlocal image URI found: \ http://www.python.org/logo.png -%(root)s/includes.txt:: (WARNING/2) Encoding 'utf-8-sig' used for reading \ -included file u'wrongenc.inc' seems to be wrong, try giving an :encoding: option +%(root)s/includes.txt:\\d*: \\(WARNING/2\\) Encoding 'utf-8-sig' used for \ +reading included file u'wrongenc.inc' seems to be wrong, try giving an \ +:encoding: option %(root)s/includes.txt:4: WARNING: download file not readable: nonexisting.png """ HTML_WARNINGS = ENV_WARNINGS + """\ -%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.*' +%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.\\*' %(root)s/markup.txt:: WARNING: invalid index entry u'' %(root)s/markup.txt:: WARNING: invalid pair index entry u'' %(root)s/markup.txt:: WARNING: invalid pair index entry u'keyword; ' """ LATEX_WARNINGS = ENV_WARNINGS + """\ -None:None: WARNING: no matching candidate for image URI u'foo.*' +None:None: WARNING: no matching candidate for image URI u'foo.\\*' WARNING: invalid pair index entry u'' """ @@ -185,8 +186,9 @@ def check_xpath(etree, fname, path, check): def test_html(app): app.builder.build_all() html_warnings = html_warnfile.getvalue().replace(os.sep, '/') - html_warnings_exp = HTML_WARNINGS % {'root': app.srcdir} - assert html_warnings == html_warnings_exp, 'Warnings don\'t match:\n' + \ + html_warnings_exp = HTML_WARNINGS % {'root': re.escape(app.srcdir)} + assert re.match(html_warnings_exp + '$', html_warnings), \ + 'Warnings don\'t match:\n' + \ '\n'.join(difflib.ndiff(html_warnings_exp.splitlines(), html_warnings.splitlines())) @@ -203,8 +205,9 @@ def test_latex(app): LaTeXTranslator.ignore_missing_images = True app.builder.build_all() latex_warnings = latex_warnfile.getvalue().replace(os.sep, '/') - latex_warnings_exp = LATEX_WARNINGS % {'root': app.srcdir} - assert latex_warnings == latex_warnings_exp, 'Warnings don\'t match:\n' + \ + latex_warnings_exp = LATEX_WARNINGS % {'root': re.escape(app.srcdir)} + assert re.match(latex_warnings_exp + '$', latex_warnings), \ + 'Warnings don\'t match:\n' + \ '\n'.join(difflib.ndiff(latex_warnings_exp.splitlines(), latex_warnings.splitlines())) # file from latex_additional_files From b4766464b20fb0339c0100406e7e3acbcb6b2f41 Mon Sep 17 00:00:00 2001 From: Florent Gallaire Date: Thu, 3 Jun 2010 19:54:44 -0500 Subject: [PATCH 10/29] Fix the french translation. --- sphinx/locale/fr/LC_MESSAGES/sphinx.po | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sphinx/locale/fr/LC_MESSAGES/sphinx.po b/sphinx/locale/fr/LC_MESSAGES/sphinx.po index 6d1042680..8afcf435a 100644 --- a/sphinx/locale/fr/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/fr/LC_MESSAGES/sphinx.po @@ -4,6 +4,7 @@ # David Larlet , 2008. # Sebastien Douche , 2008. # Jean-Daniel Browne , 2010. +# Florent Gallaire , 2010. # msgid "" msgstr "" @@ -186,7 +187,7 @@ msgstr "%s() (méthode %s)" #: sphinx/domains/javascript.py:120 #, python-format msgid "%s (global variable or constant)" -msgstr "%s (variable globale or constant)" +msgstr "%s (variable globale ou constante)" #: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323 #, python-format @@ -357,7 +358,7 @@ msgstr "élément de grammaire" #: sphinx/domains/std.py:330 msgid "reference label" -msgstr "étiquette de reference" +msgstr "étiquette de référence" #: sphinx/domains/std.py:331 msgid "environment variable" @@ -365,7 +366,7 @@ msgstr "variable d'environnement" #: sphinx/domains/std.py:332 msgid "program option" -msgstr "option de programme" +msgstr "option du programme" #: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11 #: sphinx/themes/basic/genindex-split.html:11 @@ -396,7 +397,7 @@ msgstr "alias de :class:`%s`" #: sphinx/ext/todo.py:41 msgid "Todo" -msgstr "A faire" +msgstr "À faire" #: sphinx/ext/todo.py:109 #, python-format @@ -431,7 +432,7 @@ msgstr "Vue d'ensemble : code du module" #: sphinx/ext/viewcode.py:157 msgid "

All modules for which code is available

" -msgstr "

Modules pour lesquelles le code est disponible

" +msgstr "

Modules pour lesquels le code est disponible

" #: sphinx/locale/__init__.py:139 msgid "Attention" From 17f3643850bde788b52c35a3cb0ba39871db7a6f Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 4 Jun 2010 08:41:00 +0200 Subject: [PATCH 11/29] Regenerate French catalog. --- sphinx/locale/fr/LC_MESSAGES/sphinx.mo | Bin 8936 -> 8938 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/sphinx/locale/fr/LC_MESSAGES/sphinx.mo b/sphinx/locale/fr/LC_MESSAGES/sphinx.mo index 1b1e7af50462910a217063fa60cfb3a8a86b065d..bfa97b1938dfccc3d2cc3576ab82ad7593383913 100644 GIT binary patch delta 836 zcmXZaK}b|V9LMqhTU=LNYAxHE6rc%V3vL2!iMk1cXq9CYEaP=U>Q?z4& zE=ELk=n@N2!6Ry+4zi~X(jn*)9g2dsLj|3@q~BjWc+6*Z-p>Ec{APaSe&$|02zzNW z+h{gR;A@QHd)$woFonM`jtwnlhtWlbEQ>rgNz;zAIDqTehVSqsR%=S$VOGe1<$$rrCoZu?D}P7FtCm^A8n$gcx*`M^FpwM_$>zh&#NvEiJM0M@LKPTAMKuwOUqvmXfJ$Z&wSZ-Rs;=MZ;fB~MmszDAq4rQhP1!<~ z{D2DWyI-!)MNiBg+LTV%Ph2Z(>$n$f~35N$##fZ!3+4J%yoN~(;xnwqmso_WsJiRehnuL41X-;4 zaHV^Eq8cXj;5w>MHbYD3Sxd;VspUf<(P{J7L2>J0BuOSVxZ zzoA0g_dW$OB}GlKrps3vTfByfYR9?g^@awW;?dafNao4dP-e{g7@l){kJ4Ueq`lBd XdehMzpOc=y6;I`*AEf7B$8Y}wonKuW From 0320c3393c18bf223fa17cb083a766a8b6e1da7c Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 5 Jun 2010 15:42:18 +0200 Subject: [PATCH 12/29] Added Danish translation, thanks to Hjorth Larsen. --- CHANGES | 1 + doc/config.rst | 1 + sphinx/locale/da/LC_MESSAGES/sphinx.js | 1 + sphinx/locale/da/LC_MESSAGES/sphinx.mo | Bin 0 -> 8668 bytes sphinx/locale/da/LC_MESSAGES/sphinx.po | 678 +++++++++++++++++++++++++ 5 files changed, 681 insertions(+) create mode 100644 sphinx/locale/da/LC_MESSAGES/sphinx.js create mode 100644 sphinx/locale/da/LC_MESSAGES/sphinx.mo create mode 100644 sphinx/locale/da/LC_MESSAGES/sphinx.po diff --git a/CHANGES b/CHANGES index 492e56a46..247f899c0 100644 --- a/CHANGES +++ b/CHANGES @@ -148,6 +148,7 @@ Features added - Added Turkish translation, thanks to Firat Ozgul. - Added Catalan translation, thanks to Pau Fernández. - Added simplified Chinese translation. + - Added Danish translation, thanks to Hjorth Larsen. Release 0.6.7 (in development) diff --git a/doc/config.rst b/doc/config.rst index d968ce551..4a036df85 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -285,6 +285,7 @@ Project information * ``ca`` -- Catalan * ``cs`` -- Czech + * ``da`` -- Danish * ``de`` -- German * ``en`` -- English * ``es`` -- Spanish diff --git a/sphinx/locale/da/LC_MESSAGES/sphinx.js b/sphinx/locale/da/LC_MESSAGES/sphinx.js new file mode 100644 index 000000000..d17efc474 --- /dev/null +++ b/sphinx/locale/da/LC_MESSAGES/sphinx.js @@ -0,0 +1 @@ +Documentation.addTranslations({"locale": "da", "plural_expr": "(n != 1)", "messages": {"Search Results": "S\u00f8geresultater", "Preparing search...": "Forbereder s\u00f8gning...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Din s\u00f8gning gav ingen resultater. Kontroll\u00e9r venligst at alle ord er stavet korrekt, og at du har valgt nok kategorier.", "Search finished, found %s page(s) matching the search query.": "S\u00f8gningen fuldf\u00f8rt - fandt %s sider for denne s\u00f8gning.", ", in ": ", i ", "Permalink to this headline": "Permalink til denne overskrift", "Searching": "S\u00f8ger", "Permalink to this definition": "Permalink til denne definition", "Hide Search Matches": "Skjul s\u00f8geresultater"}}); \ No newline at end of file diff --git a/sphinx/locale/da/LC_MESSAGES/sphinx.mo b/sphinx/locale/da/LC_MESSAGES/sphinx.mo new file mode 100644 index 0000000000000000000000000000000000000000..a47f10deb890a700429fd86658a1e1022186ef93 GIT binary patch literal 8668 zcmb`LZH!#kS;r4;0(4W7keZe@Eu6TlYbT!ZZelym#&)t^+ldpuEZ(h42$0;FIWu!T zckZ3uduP^LUfO_E1u8y-7a^!fk!UPcN&?{n1oZYSv%h=ZpYxpOdCqy}E4N(t+lK$1;{SK^|0l0gY4gARZ!zYr6l?H$ zxBz#<`yu~KGq4YTnDQFj1%DOZ1fPZ)|2+I5_-S|p{F~7JGJG55e}Qj@ufv<+%`??} zw?Xy43#$D-sP;?n9k2u62|o-q&+o!_!RO$Q!q12Le}wAyU+^%ziAjGPo`(0qHq`#E z!XJUpLPRlt34aiN0Un1hhw?5qrTx4IGNri#{s24-)&DsBe)vFWKOfp3fto*p2jLo& zyw5`I?{iS=eg$5DuR_gpgvGSZeehQJ5WE|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`cj&Zch#1f=LzNlo1_gs}lRezbLx-bLK z`vB)kd_L8i%BRBav}3=^alepFg%_6TR<0D`I{Kx6py0*v*Bfiee*7P{7lKK6=2ZEV M%X, 2010. +msgid "" +msgstr "" +"Project-Id-Version: Sphinx 1.0pre/[?1034h2e1ab15e035e\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2009-11-08 16:28+0100\n" +"PO-Revision-Date: 2010-06-03 23:47+0200\n" +"Last-Translator: Ask Hjorth Larsen \n" +"Language-Team: Danish Copyright %(copyright)s." +msgstr "© Ophavsret %(copyright)s." + +#: sphinx/themes/basic/layout.html:189 sphinx/themes/scrolls/layout.html:85 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Ophavsret %(copyright)s." + +# datoformatet passer ikke med "den %(last_updated)s" +#: sphinx/themes/basic/layout.html:193 sphinx/themes/scrolls/layout.html:89 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Sidst opdateret %(last_updated)s." + +#: sphinx/themes/basic/layout.html:196 sphinx/themes/scrolls/layout.html:92 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "Bygget med Sphinx %(sphinx_version)s." + +#: sphinx/themes/basic/modindex.html:36 sphinx/themes/scrolls/modindex.html:37 +msgid "Deprecated" +msgstr "Deprecieret" + +#: sphinx/themes/basic/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "Søg i %(docstitle)s" + +#: sphinx/themes/basic/search.html:9 +msgid "" +"Please activate JavaScript to enable the search\n" +" functionality." +msgstr "" +"Aktivér venligst JavaScript for at aktivere\n" +" søgefunktionalitet." + +#: sphinx/themes/basic/search.html:14 +msgid "" +"From here you can search these documents. Enter your search\n" +" words into the box below and click \"search\". Note that the search\n" +" function will automatically search for all of the words. Pages\n" +" containing fewer words won't appear in the result list." +msgstr "" +"Her fra kan du søge i disse dokumenter. Indtast dine søgeord\n" +" i boksen nedenfor og klik på \"søg\". Bemærk at søgefunktionen\n" +" automatisk vil søge på alle ordene. Sider, der indeholder\n" +" færre ord, vil ikke indgå i resultaterne." + +#: sphinx/themes/basic/search.html:21 +msgid "search" +msgstr "søg" + +#: sphinx/themes/basic/search.html:25 +#: sphinx/themes/basic/static/searchtools.js:473 +msgid "Search Results" +msgstr "Søgeresultater" + +#: sphinx/themes/basic/search.html:27 +msgid "Your search did not match any results." +msgstr "Din søgning gav ingen resultater." + +#: sphinx/themes/basic/changes/frameset.html:5 +#: sphinx/themes/basic/changes/versionchanges.html:12 +#, python-format +msgid "Changes in Version %(version)s — %(docstitle)s" +msgstr "Ændringer i version %(version)s — %(docstitle)s" + +#: sphinx/themes/basic/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +msgstr "%(filename)s — %(docstitle)s" + +#: sphinx/themes/basic/changes/versionchanges.html:17 +#, python-format +msgid "Automatically generated list of changes in version %(version)s" +msgstr "Automatisk oprettet liste af ændringer i version %(version)s" + +#: sphinx/themes/basic/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "Biblioteksændringer" + +#: sphinx/themes/basic/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "Ændringer i C-API" + +#: sphinx/themes/basic/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "Andre ændringer" + +#: sphinx/themes/basic/static/doctools.js:138 sphinx/writers/html.py:462 +#: sphinx/writers/html.py:467 +msgid "Permalink to this headline" +msgstr "Permalink til denne overskrift" + +#: sphinx/themes/basic/static/doctools.js:144 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Permalink til denne definition" + +#: sphinx/themes/basic/static/doctools.js:173 +msgid "Hide Search Matches" +msgstr "Skjul søgeresultater" + +#: sphinx/themes/basic/static/searchtools.js:274 +msgid "Searching" +msgstr "Søger" + +#: sphinx/themes/basic/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "Forbereder søgning..." + +#: sphinx/themes/basic/static/searchtools.js:352 +msgid ", in " +msgstr ", i " + +#: sphinx/themes/basic/static/searchtools.js:475 +msgid "" +"Your search did not match any documents. Please make sure that all words " +"are spelled correctly and that you've selected enough categories." +msgstr "Din søgning gav ingen resultater. Kontrollér venligst at alle ord er stavet korrekt, og at du har valgt nok kategorier." + +#: sphinx/themes/basic/static/searchtools.js:477 +#, python-format +msgid "Search finished, found %s page(s) matching the search query." +msgstr "Søgningen fuldført - fandt %s sider for denne søgning." + +#: sphinx/writers/latex.py:187 +msgid "Release" +msgstr "Udgave" + +#: sphinx/writers/latex.py:579 +msgid "Footnotes" +msgstr "Fodnoter" + +#: sphinx/writers/latex.py:647 +msgid "continued from previous page" +msgstr "fortsat fra forrige side" + +#: sphinx/writers/latex.py:652 +msgid "Continued on next page" +msgstr "Fortsættes på næste side" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Platform: %s" + +#: sphinx/writers/text.py:428 +msgid "[image]" +msgstr "[billede]" + From ce96cfbfb606bcfc6b5b655d8debc1fcc53ab296 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 5 Jun 2010 18:10:42 +0200 Subject: [PATCH 13/29] Revert logic in _directive_helper: everything that is not a function is a class-style directive. Fixes issues with extensions registering directive classes not inheriting from Directive. --- sphinx/application.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sphinx/application.py b/sphinx/application.py index b5ba514c3..3ffd86c26 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -18,7 +18,7 @@ from os import path from cStringIO import StringIO from docutils import nodes -from docutils.parsers.rst import Directive, convert_directive_function, \ +from docutils.parsers.rst import convert_directive_function, \ directives, roles import sphinx @@ -368,16 +368,16 @@ class Sphinx(object): setattr(translator, 'depart_'+node.__name__, depart) def _directive_helper(self, obj, content=None, arguments=None, **options): - if isinstance(obj, clstypes) and issubclass(obj, Directive): - if content or arguments or options: - raise ExtensionError('when adding directive classes, no ' - 'additional arguments may be given') - return obj - else: + if isinstance(obj, (types.FunctionType, types.MethodType)): obj.content = content obj.arguments = arguments or (0, 0, False) obj.options = options return convert_directive_function(obj) + else: + if content or arguments or options: + raise ExtensionError('when adding directive classes, no ' + 'additional arguments may be given') + return obj def add_directive(self, name, obj, content=None, arguments=None, **options): directives.register_directive( From 3ff350c4d9ccf192a25f3b9af9b93263357f36b3 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 5 Jun 2010 18:21:48 +0200 Subject: [PATCH 14/29] #439: angle brackets in template class names can be misinterpreted as link targets. Clarify how to avoid this. --- doc/domains.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/domains.rst b/doc/domains.rst index 076822035..0cc0087a7 100644 --- a/doc/domains.rst +++ b/doc/domains.rst @@ -511,6 +511,15 @@ These roles link to the given object types: Reference a C++ object. You can give the full signature (and need to, for overloaded functions.) + .. note:: + + Sphinx' syntax to give references a custom title can interfere with + linking to template classes, if nothing follows the closing angle + bracket, i.e. if the link looks like this: ``:cpp:class:`MyClass```. + This is interpreted as a link to ``T`` with a title of ``MyClass``. + In this case, please escape the opening angle bracket with a backslash, + like this: ``:cpp:class:`MyClass\```. + .. admonition:: Note on References It is currently impossible to link to a specific version of an From 08285e6a50e4138b516100c3d1079ff11ce07969 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 5 Jun 2010 18:42:11 +0200 Subject: [PATCH 15/29] Prepare for 0.6.7 release. --- CHANGES | 4 ++-- sphinx/__init__.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 16a1f0f1e..8f1ce0d82 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,5 @@ -Release 0.6.7 (in development) -============================== +Release 0.6.7 (Jun 05, 2010) +============================ * #440: Remove usage of a Python >= 2.5 API in the ``literalinclude`` directive. diff --git a/sphinx/__init__.py b/sphinx/__init__.py index ccdfaf3b4..724098798 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -12,8 +12,8 @@ import sys from os import path -__version__ = '0.6.6+' -__released__ = '0.6.6' # used when Sphinx builds its own docs +__version__ = '0.6.7' +__released__ = '0.6.7' # used when Sphinx builds its own docs package_dir = path.abspath(path.dirname(__file__)) From 732857577eebb8f8817cef7a37a92d27ece0abc4 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 5 Jun 2010 18:48:25 +0200 Subject: [PATCH 17/29] Post-release updates. --- sphinx/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/__init__.py b/sphinx/__init__.py index 724098798..3ad5732ae 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -12,7 +12,7 @@ import sys from os import path -__version__ = '0.6.7' +__version__ = '0.6.7+' __released__ = '0.6.7' # used when Sphinx builds its own docs package_dir = path.abspath(path.dirname(__file__)) From 09e6001e7a99990880a17325c1be36dcdae82d78 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 12 Jun 2010 10:41:56 +0200 Subject: [PATCH 18/29] In the Python domain, references like ``:func:`.name``` now look for matching names with any prefix if no direct match is found. --- CHANGES | 2 ++ doc/intro.rst | 3 +++ sphinx/domains/python.py | 38 +++++++++++++++++++++++++------------- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index 1710c5435..af0a3ef1c 100644 --- a/CHANGES +++ b/CHANGES @@ -54,6 +54,8 @@ Features added - The :rst:role:`ref` role can now also reference tables by caption. - The :rst:dir:`include` directive now supports absolute paths, which are interpreted as relative to the source directory. + - In the Python domain, references like ``:func:`.name``` now look for + matching names with any prefix if no direct match is found. * Configuration: diff --git a/doc/intro.rst b/doc/intro.rst index 33f97a3f8..33a89fa6e 100644 --- a/doc/intro.rst +++ b/doc/intro.rst @@ -16,6 +16,9 @@ Though there is support for that kind of docs as well (which is intended to be freely mixed with hand-written content), if you need pure API docs have a look at `Epydoc `_, which also understands reST. +.. function:: Sphinxy.add_domain() + +:func:`.add_domain` Conversion from other systems ----------------------------- diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index b97b9b422..fc8086995 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -547,7 +547,7 @@ class PythonDomain(Domain): def find_obj(self, env, modname, classname, name, type, searchorder=0): """ Find a Python object for "name", perhaps using the given module and/or - classname. + classname. Returns a list of (name, object entry) tuples. """ # skip parens if name[-2:] == '()': @@ -557,6 +557,7 @@ class PythonDomain(Domain): return None, None objects = self.data['objects'] + matches = [] newname = None if searchorder == 1: @@ -567,6 +568,11 @@ class PythonDomain(Domain): newname = modname + '.' + name elif name in objects: newname = name + else: + # "fuzzy" searching mode + searchname = '.' + name + matches = [(name, objects[name]) for name in objects + if name.endswith(searchname)] else: if name in objects: newname = name @@ -585,14 +591,14 @@ class PythonDomain(Domain): elif type in ('func', 'meth') and '.' not in name and \ 'object.' + name in objects: newname = 'object.' + name - if newname is None: - return None, None - return newname, objects[newname] + if newname is not None: + matches.append((newname, objects[newname])) + return matches def resolve_xref(self, env, fromdocname, builder, - typ, target, node, contnode): - if (typ == 'mod' or - typ == 'obj' and target in self.data['modules']): + type, target, node, contnode): + if (type == 'mod' or + type == 'obj' and target in self.data['modules']): docname, synopsis, platform, deprecated = \ self.data['modules'].get(target, ('','','', '')) if not docname: @@ -607,13 +613,19 @@ class PythonDomain(Domain): modname = node.get('py:module') clsname = node.get('py:class') searchorder = node.hasattr('refspecific') and 1 or 0 - name, obj = self.find_obj(env, modname, clsname, - target, typ, searchorder) - if not obj: + matches = self.find_obj(env, modname, clsname, target, + type, searchorder) + if not matches: return None - else: - return make_refnode(builder, fromdocname, obj[0], name, - contnode, name) + elif len(matches) > 1: + env.warn(fromdocname, + 'more than one target found for cross-reference ' + '%r: %s' % (target, + ', '.join(match[0] for match in matches)), + node.line) + name, obj = matches[0] + return make_refnode(builder, fromdocname, obj[0], name, + contnode, name) def get_objects(self): for modname, info in self.data['modules'].iteritems(): From c891fdfc60eda7b70240cbd2552def35e2305600 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 12 Jun 2010 11:37:56 +0200 Subject: [PATCH 19/29] Document new :py:func:`.blah` syntax. --- doc/domains.rst | 7 +++++++ doc/intro.rst | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/domains.rst b/doc/domains.rst index 0cc0087a7..c64930a24 100644 --- a/doc/domains.rst +++ b/doc/domains.rst @@ -363,6 +363,13 @@ dot, this order is reversed. For example, in the documentation of Python's :mod:`codecs` module, ``:py:func:`open``` always refers to the built-in function, while ``:py:func:`.open``` refers to :func:`codecs.open`. +Also, if the name is prefixed with a dot, and no exact match is found, the +target is taken as a suffix and all object names with that suffix are +searched. For example, ``:py:meth:`.TarFile.close``` references the +``tarfile.TarFile.close()`` function, even if the current module is not +``tarfile``. Since this can get ambiguous, if there is more than one possible +match, you will get a warning from Sphinx. + A similar heuristic is used to determine whether the name is an attribute of the currently documented class. diff --git a/doc/intro.rst b/doc/intro.rst index 33a89fa6e..33f97a3f8 100644 --- a/doc/intro.rst +++ b/doc/intro.rst @@ -16,9 +16,6 @@ Though there is support for that kind of docs as well (which is intended to be freely mixed with hand-written content), if you need pure API docs have a look at `Epydoc `_, which also understands reST. -.. function:: Sphinxy.add_domain() - -:func:`.add_domain` Conversion from other systems ----------------------------- From 9b27aa3ae8871cbfa6cb2aad006cc2c36d188cbf Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 12 Jun 2010 12:21:04 +0200 Subject: [PATCH 20/29] #450: potentially escape index letters; _ needs to be. --- sphinx/writers/latex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index eaca3e714..ea12f0036 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -266,7 +266,8 @@ class LaTeXTranslator(nodes.NodeVisitor): for i, (letter, entries) in enumerate(content): if i > 0: ret.append('\\indexspace\n') - ret.append('\\bigletter{%s}\n' % letter) + ret.append('\\bigletter{%s}\n' % + letter.translate(tex_escape_map)) for entry in entries: if not entry[3]: continue From d30d286486562a51720e84e3528dfcfbef70ec26 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 12 Jun 2010 12:30:40 +0200 Subject: [PATCH 21/29] Fix transformation of Field. --- sphinx/util/docfields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/util/docfields.py b/sphinx/util/docfields.py index da93c6fea..c975b9b50 100644 --- a/sphinx/util/docfields.py +++ b/sphinx/util/docfields.py @@ -67,7 +67,7 @@ class Field(object): fieldname += nodes.Text(' ') fieldname += self.make_xref(self.rolename, domain, fieldarg, nodes.Text) - fieldbody = nodes.field_body('', nodes.paragraph('', *content)) + fieldbody = nodes.field_body('', nodes.paragraph('', '', *content)) return nodes.field('', fieldname, fieldbody) From 7c7d3f40102764a5ad0e46d35ff23bfd7f0340f8 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 12 Jun 2010 18:16:18 +0200 Subject: [PATCH 22/29] Added ``exclude`` argument to :func:`.autodoc.between`. From http://bitbucket.org/mfperzel/sphinx-additions. --- CHANGES | 1 + sphinx/ext/autodoc.py | 11 ++++++----- tests/test_autodoc.py | 16 ++++++++++++++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index af0a3ef1c..82308bb23 100644 --- a/CHANGES +++ b/CHANGES @@ -143,6 +143,7 @@ Features added instead of PNG images, controlled by the :confval:`graphviz_output_format` config value. - Added ``alt`` option to :rst:dir:`graphviz` extension directives. + - Added ``exclude`` argument to :func:`.autodoc.between`. * Translations: diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 8e5c5ce94..adf08bcde 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -164,11 +164,12 @@ def cut_lines(pre, post=0, what=None): lines.append('') return process -def between(marker, what=None, keepempty=False): +def between(marker, what=None, keepempty=False, exclude=False): """ - Return a listener that only keeps lines between lines that match the - *marker* regular expression. If no line matches, the resulting docstring - would be empty, so no change will be made unless *keepempty* is true. + Return a listener that either keeps, or if *exclude* is True excludes, lines + between lines that match the *marker* regular expression. If no line + matches, the resulting docstring would be empty, so no change will be made + unless *keepempty* is true. If *what* is a sequence of strings, only docstrings of a type in *what* will be processed. @@ -178,7 +179,7 @@ def between(marker, what=None, keepempty=False): if what and what_ not in what: return deleted = 0 - delete = True + delete = not exclude orig_lines = lines[:] for i, line in enumerate(orig_lines): if delete: diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index 62768b202..8f983471c 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -271,7 +271,7 @@ def test_docstring_processing(): app.disconnect(lid) lid = app.connect('autodoc-process-docstring', between('---', ['function'])) - def f(): + def g(): """ first line --- @@ -279,9 +279,21 @@ def test_docstring_processing(): --- third line """ - assert process('function', 'f', f) == ['second line', ''] + assert process('function', 'g', g) == ['second line', ''] app.disconnect(lid) + lid = app.connect('autodoc-process-docstring', between('---', ['function'], + exclude=True)) + def h(): + """ + first line + --- + second line + --- + third line + """ + assert process('function', 'h', h) == ['first line', 'third line', ''] + app.disconnect(lid) def test_new_documenter(): class MyDocumenter(ModuleLevelDocumenter): From 9a0859fea8b2f0d246234be4a4c4230feeeb3157 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 12 Jun 2010 20:04:01 +0200 Subject: [PATCH 23/29] Reverse latex appendix logic: Add appendices if docclass is not howto. Also fix docs: other docclasses can be given if you know what you do. --- doc/config.rst | 8 +++++--- sphinx/builders/latex.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/config.rst b/doc/config.rst index 4a036df85..bdfd05287 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -807,9 +807,11 @@ These options influence LaTeX output. * *author*: Author for the LaTeX document. The same LaTeX markup caveat as for *title* applies. Use ``\and`` to separate multiple authors, as in: ``'John \and Sarah'``. - * *documentclass*: Must be one of ``'manual'`` or ``'howto'``. Only "manual" - documents will get appendices. Also, howtos will have a simpler title - page. + * *documentclass*: Normally, one of ``'manual'`` or ``'howto'`` (provided by + Sphinx). Other document classes can be given, but they must include the + "sphinx" package in order to define Sphinx' custom LaTeX commands. + "howto" documents will not get appendices. Also, howtos will have a simpler + title page. * *toctree_only*: Must be ``True`` or ``False``. If ``True``, the *startdoc* document itself is not included in the output, only the documents referenced by it via TOC trees. With this option, you can put extra stuff diff --git a/sphinx/builders/latex.py b/sphinx/builders/latex.py index 1fbdbb781..b2a3c4e74 100644 --- a/sphinx/builders/latex.py +++ b/sphinx/builders/latex.py @@ -96,7 +96,7 @@ class LaTeXBuilder(Builder): encoding='utf-8') self.info("processing " + targetname + "... ", nonl=1) doctree = self.assemble_doctree(docname, toctree_only, - appendices=((docclass == 'manual') and + appendices=((docclass != 'howto') and self.config.latex_appendices or [])) self.post_process_images(doctree) self.info("writing... ", nonl=1) From 43c0c87136b90d63d8a6bf60fe63292443093fc1 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 12 Jun 2010 20:15:13 +0200 Subject: [PATCH 24/29] Give more detailed info about exception determining image type. --- sphinx/environment.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sphinx/environment.py b/sphinx/environment.py index 6bcdda0f8..76cd0888d 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -818,9 +818,10 @@ class BuildEnvironment: imgtype = imghdr.what(f) finally: f.close() - except (OSError, IOError): - self.warn(docname, - 'image file %s not readable' % filename) + except (OSError, IOError), err: + self.warn(docname, 'image file %s not ' + 'readable: %s' % (filename, err), + node.line) if imgtype: candidates['image/' + imgtype] = new_imgpath else: From 5d3ccf7a8ebb08b1808b24da71674748bbfbb4eb Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 12 Jun 2010 20:17:16 +0200 Subject: [PATCH 25/29] Add Music21. --- EXAMPLES | 1 + 1 file changed, 1 insertion(+) diff --git a/EXAMPLES b/EXAMPLES index ecc2bfa1b..e2a8bc857 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -85,6 +85,7 @@ Documentation using the sphinxdoc theme * Fityk: http://www.unipress.waw.pl/fityk/ * MapServer: http://mapserver.org/ * Matplotlib: http://matplotlib.sourceforge.net/ +* Music21: http://mit.edu/music21/doc/html/contents.html * MyHDL: http://www.myhdl.org/doc/0.6/ * NetworkX: http://networkx.lanl.gov/ * Pweave: http://mpastell.com/pweave/ From e4354a1045c5875d56c15674a813f16667a12ec2 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 13 Jun 2010 19:42:50 +0200 Subject: [PATCH 26/29] Really fix IndexError from #424. --- sphinx/ext/viewcode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py index d79df22e0..81881beb6 100644 --- a/sphinx/ext/viewcode.py +++ b/sphinx/ext/viewcode.py @@ -104,7 +104,7 @@ def collect_pages(app): # now that we have code lines (starting at index 1), insert anchors for # the collected tags (HACK: this only works if the tag boundaries are # properly nested!) - maxindex = len(lines) + maxindex = len(lines) - 1 for name, docname in used.iteritems(): type, start, end = tags[name] backlink = urito(pagename, docname) + '#' + modname + '.' + name From 762741244da7494ea79604d6321def0e6c11345b Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 13 Jun 2010 19:50:04 +0200 Subject: [PATCH 27/29] #444: Re-escape result of the "striptags" jinja filter. --- CHANGES | 7 +++++++ sphinx/themes/basic/layout.html | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 8f1ce0d82..9b34377a1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Release 0.6.8 (in development) +============================== + +* #444: In templates, properly re-escape values treated with the + "striptags" Jinja filter. + + Release 0.6.7 (Jun 05, 2010) ============================ diff --git a/sphinx/themes/basic/layout.html b/sphinx/themes/basic/layout.html index 3380dbe13..92bd44b14 100644 --- a/sphinx/themes/basic/layout.html +++ b/sphinx/themes/basic/layout.html @@ -13,7 +13,7 @@