From 144fb2634dda00738c2b05f33de0ca7864bae97c Mon Sep 17 00:00:00 2001 From: Takayuki Hirai Date: Mon, 30 Mar 2015 19:54:17 +0900 Subject: [PATCH 01/13] Fix #1793: Add new line before first item of list --- sphinx/writers/text.py | 3 +++ tests/roots/test-build-text/listitems.txt | 4 ++++ tests/test_build_text.py | 12 ++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 tests/roots/test-build-text/listitems.txt diff --git a/sphinx/writers/text.py b/sphinx/writers/text.py index ad2d8bbbc..12f4af1e8 100644 --- a/sphinx/writers/text.py +++ b/sphinx/writers/text.py @@ -711,6 +711,9 @@ class TextTranslator(nodes.NodeVisitor): def _visit_admonition(self, node): self.new_state(2) + if isinstance(node.children[0], nodes.Sequential): + self.add_text(self.nl) + def _make_depart_admonition(name): def depart_admonition(self, node): self.end_state(first=admonitionlabels[name] + ': ') diff --git a/tests/roots/test-build-text/listitems.txt b/tests/roots/test-build-text/listitems.txt new file mode 100644 index 000000000..f0952d8c6 --- /dev/null +++ b/tests/roots/test-build-text/listitems.txt @@ -0,0 +1,4 @@ +.. seealso:: + + * item 1 + * item 2 diff --git a/tests/test_build_text.py b/tests/test_build_text.py index 014deeca3..5a1ec227f 100644 --- a/tests/test_build_text.py +++ b/tests/test_build_text.py @@ -99,3 +99,15 @@ def test_table_with_empty_cell(app, status, warning): assert lines[4] == "+-------+-------+" assert lines[5] == "| XXX | |" assert lines[6] == "+-------+-------+" + + +@with_text_app() +def test_list_items_in_admonition(app, status, warning): + app.builder.build_update() + result = (app.outdir / 'listitems.txt').text(encoding='utf-8') + lines = [line.rstrip() for line in result.splitlines()] + assert lines[0] == "See also:" + assert lines[1] == "" + assert lines[2] == " * item 1" + assert lines[3] == "" + assert lines[4] == " * item 2" From 78000d206606011ef4e4e1a63c78921c20b59f7b Mon Sep 17 00:00:00 2001 From: Takayuki Hirai Date: Tue, 28 Apr 2015 22:17:09 +0900 Subject: [PATCH 02/13] Fix #1780: Remove duplicated "class" and "exception" keywords from text builder --- sphinx/writers/text.py | 2 -- tests/test_intl.py | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sphinx/writers/text.py b/sphinx/writers/text.py index ad2d8bbbc..fcea10cc1 100644 --- a/sphinx/writers/text.py +++ b/sphinx/writers/text.py @@ -303,8 +303,6 @@ class TextTranslator(nodes.NodeVisitor): def visit_desc_signature(self, node): self.new_state(0) - if node.parent['objtype'] in ('class', 'exception'): - self.add_text('%s ' % node.parent['objtype']) def depart_desc_signature(self, node): # XXX: wrap signatures in a way that makes sense diff --git a/tests/test_intl.py b/tests/test_intl.py index 5c6be546a..ea506020f 100644 --- a/tests/test_intl.py +++ b/tests/test_intl.py @@ -269,21 +269,21 @@ def test_text_builder(app, status, warning): result = (app.outdir / 'docfields.txt').text(encoding='utf-8') expect = (u"\nI18N WITH DOCFIELDS" u"\n*******************\n" - u"\nclass class Cls1\n" + u"\nclass Cls1\n" u"\n Parameters:" u"\n **param** -- DESCRIPTION OF PARAMETER param\n" - u"\nclass class Cls2\n" + u"\nclass Cls2\n" u"\n Parameters:" u"\n * **foo** -- DESCRIPTION OF PARAMETER foo\n" u"\n * **bar** -- DESCRIPTION OF PARAMETER bar\n" - u"\nclass class Cls3(values)\n" + u"\nclass Cls3(values)\n" u"\n Raises ValueError:" u"\n IF THE VALUES ARE OUT OF RANGE\n" - u"\nclass class Cls4(values)\n" + u"\nclass Cls4(values)\n" u"\n Raises:" u"\n * **TypeError** -- IF THE VALUES ARE NOT VALID\n" u"\n * **ValueError** -- IF THE VALUES ARE OUT OF RANGE\n" - u"\nclass class Cls5\n" + u"\nclass Cls5\n" u"\n Returns:" u'\n A NEW "Cls3" INSTANCE\n') yield assert_equal, result, expect From e237dad509967a0d665a75ed26ba902b3cddabe7 Mon Sep 17 00:00:00 2001 From: Bram Geron Date: Mon, 22 Jun 2015 14:06:11 +0100 Subject: [PATCH 03/13] Allow overriding 'numfig_format' for LaTeX output in latex_elements --- sphinx/writers/latex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index ffa8ae874..62f8a5284 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -248,12 +248,12 @@ class LaTeXTranslator(nodes.NodeVisitor): return '\\usepackage{%s}' % (packagename,) usepackages = (declare_package(*p) for p in builder.usepackages) self.elements['usepackages'] += "\n".join(usepackages) + self.elements['numfig_format'] = self.generate_numfig_format(builder) # allow the user to override them all self.elements.update(builder.config.latex_elements) if self.elements['extraclassoptions']: self.elements['classoptions'] += ',' + \ self.elements['extraclassoptions'] - self.elements['numfig_format'] = self.generate_numfig_format(builder) self.highlighter = highlighting.PygmentsBridge( 'latex', From f323b60641006a22b4ca163721393a88f7d86438 Mon Sep 17 00:00:00 2001 From: Robert Lehmann Date: Wed, 24 Jun 2015 13:32:01 +0200 Subject: [PATCH 04/13] Explicitly mention sphinx-users mailing list This should now answer searches for "mailing list" and "sphinx-", in case users just skim the Web site. I have checked this in a Web browser and it looks good IMO (box not overfull.) --- doc/_templates/indexsidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/_templates/indexsidebar.html b/doc/_templates/indexsidebar.html index 0bd3d71a4..56094809f 100644 --- a/doc/_templates/indexsidebar.html +++ b/doc/_templates/indexsidebar.html @@ -27,7 +27,7 @@ are also available.{%endtrans%}

{%trans%}Questions? Suggestions?{%endtrans%}

-

{%trans%}Join the Google group:{%endtrans%}

+

{%trans%}Join the sphinx-users mailing list on Google Groups:{%endtrans%}

Date: Fri, 26 Jun 2015 18:52:45 +0900 Subject: [PATCH 05/13] Update CHANGES refs #1935 --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 1beafe60f..508d4a195 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ Release 1.3.2 (in development) ============================== +Features added +-------------- + +* #1935: Make "numfig_format" overridable in latex_elements. + Bugs fixed ---------- From 65663912a45178b323c0a0f206318ea3e518bc33 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Fri, 26 Jun 2015 21:23:03 +0900 Subject: [PATCH 06/13] Add testcase for graphviz --- tests/roots/test-ext-graphviz/conf.py | 4 ++++ tests/roots/test-ext-graphviz/index.rst | 7 +++++++ tests/test_ext_graphviz.py | 23 +++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 tests/roots/test-ext-graphviz/conf.py create mode 100644 tests/roots/test-ext-graphviz/index.rst create mode 100644 tests/test_ext_graphviz.py diff --git a/tests/roots/test-ext-graphviz/conf.py b/tests/roots/test-ext-graphviz/conf.py new file mode 100644 index 000000000..cecd53668 --- /dev/null +++ b/tests/roots/test-ext-graphviz/conf.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +extensions = ['sphinx.ext.graphviz'] +master_doc = 'index' diff --git a/tests/roots/test-ext-graphviz/index.rst b/tests/roots/test-ext-graphviz/index.rst new file mode 100644 index 000000000..39c755e9d --- /dev/null +++ b/tests/roots/test-ext-graphviz/index.rst @@ -0,0 +1,7 @@ +graphviz +======== + +.. digraph:: foo + :caption: caption of graph + + bar -> baz diff --git a/tests/test_ext_graphviz.py b/tests/test_ext_graphviz.py new file mode 100644 index 000000000..53f5be4df --- /dev/null +++ b/tests/test_ext_graphviz.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +""" + test_ext_graphviz + ~~~~~~~~~~~~~~~~~ + + Test sphinx.ext.graphviz extension. + + :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re +from util import with_app + + +@with_app('html', testroot='ext-graphviz') +def test_graphviz(app, status, warning): + app.builder.build_all() + if "dot command 'dot' cannot be run" not in warning.getvalue(): + content = (app.outdir / 'index.html').text() + html = ('

\s*\s*

\s*' + '

caption of graph') + assert re.search(html, content, re.S) From 962a830015cf949ddf1f1f9c5aca917af1af91d7 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Fri, 26 Jun 2015 21:37:16 +0900 Subject: [PATCH 07/13] Update README --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 508d4a195..b6e2aa774 100644 --- a/CHANGES +++ b/CHANGES @@ -22,7 +22,7 @@ Bugs fixed * #1823: '.' as for sphinx-apidoc cause an unfriendly error. Now '.' is converted to absolute path automatically. * Fix a crash when setting up extensions which do not support metadata. -* #1784: Provide non-minified JS code in sphinx/search/*.py +* #1784: Provide non-minified JS code in ``sphinx/search/*.py`` Release 1.3.1 (released Mar 17, 2015) From 0150548940b46c72869f5ee07e6ef56a166b25fd Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Sun, 5 Jul 2015 10:00:54 +0900 Subject: [PATCH 08/13] the release is canceled. --- sphinx/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sphinx/__init__.py b/sphinx/__init__.py index 3b45b23de..d46f19779 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -15,13 +15,13 @@ import sys from os import path -__version__ = '1.3.2' -__released__ = '1.3.2' # used when Sphinx builds its own docs +__version__ = '1.3.1+' +__released__ = '1.3.1+' # used when Sphinx builds its own docs # version info for better programmatic use # possible values for 3rd element: 'alpha', 'beta', 'rc', 'final' # 'final' has 0 as the last element -version_info = (1, 3, 2, 'final', 0) +version_info = (1, 3, 1, 'beta', 1) package_dir = path.abspath(path.dirname(__file__)) From 5b2693625bd31f0f2905c2feec2900163c686101 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 19 May 2015 10:08:26 -0700 Subject: [PATCH 09/13] FIX: Only check if members is True --- sphinx/ext/autosummary/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py index 4fd44ac67..a53b125d5 100644 --- a/sphinx/ext/autosummary/__init__.py +++ b/sphinx/ext/autosummary/__init__.py @@ -276,7 +276,7 @@ class Autosummary(Directive): self.warn('failed to import object %s' % real_name) items.append((display_name, '', '', real_name)) continue - if not documenter.check_module(): + if documenter.options.members and not documenter.check_module(): continue # try to also get a source code analyzer for attribute docs From 24604b3a276486d2025458f70d45c0655d7c9bd4 Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Mon, 6 Jul 2015 09:50:29 +0900 Subject: [PATCH 10/13] Update changes for #1892. --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index b6e2aa774..742df3f71 100644 --- a/CHANGES +++ b/CHANGES @@ -23,6 +23,8 @@ Bugs fixed is converted to absolute path automatically. * Fix a crash when setting up extensions which do not support metadata. * #1784: Provide non-minified JS code in ``sphinx/search/*.py`` +* #1822, #1892: Fix regression for #1061. autosummary can't generate doc for imported + members since sphinx-1.3b3. Thanks to Eric Larson. Release 1.3.1 (released Mar 17, 2015) From 8f560079efce81e1476d9b8bec39ad93f8db49c5 Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Sat, 11 Jul 2015 15:22:03 +0900 Subject: [PATCH 11/13] CHANGES for #1793 --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index 742df3f71..2c43898c7 100644 --- a/CHANGES +++ b/CHANGES @@ -25,6 +25,7 @@ Bugs fixed * #1784: Provide non-minified JS code in ``sphinx/search/*.py`` * #1822, #1892: Fix regression for #1061. autosummary can't generate doc for imported members since sphinx-1.3b3. Thanks to Eric Larson. +* #1793, #1819: "see also" misses a linebreak in text output. Thanks to Takayuki Hirai. Release 1.3.1 (released Mar 17, 2015) From c53fbdc9496cb662667db1267ac81c9d087c894a Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Sat, 11 Jul 2015 18:36:50 +0900 Subject: [PATCH 12/13] CHANGES for #1780 --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index 2c43898c7..da6050cbc 100644 --- a/CHANGES +++ b/CHANGES @@ -26,6 +26,7 @@ Bugs fixed * #1822, #1892: Fix regression for #1061. autosummary can't generate doc for imported members since sphinx-1.3b3. Thanks to Eric Larson. * #1793, #1819: "see also" misses a linebreak in text output. Thanks to Takayuki Hirai. +* #1780, #1866: "make text" shows "class" keyword twice. Thanks to Takayuki Hirai. Release 1.3.1 (released Mar 17, 2015) From 5d30bc635b22391c063a48b03d1b04c7ca239442 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 25 Jun 2015 11:54:05 -0400 Subject: [PATCH 13/13] One way to work around the lack of html.parser.HTMLParserError in Python 3.5 --- sphinx/builders/linkcheck.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py index 9f5c2131c..b05c5b2e0 100644 --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -19,9 +19,19 @@ from six.moves import queue from six.moves.urllib.request import build_opener, Request, HTTPRedirectHandler from six.moves.urllib.parse import unquote, urlsplit, quote from six.moves.urllib.error import HTTPError -from six.moves.html_parser import HTMLParser, HTMLParseError +from six.moves.html_parser import HTMLParser from docutils import nodes +# 2015-06-25 barry@python.org. This exception was deprecated in Python 3.3 and +# removed in Python 3.5, however for backward compatibility reasons, we're not +# going to just remove it. If it doesn't exist, define an exception that will +# never be caught but leaves the code in check_anchor() intact. +try: + from six.moves.html_parser import HTMLParseError +except ImportError: + class HTMLParseError(Exception): + pass + from sphinx.builders import Builder from sphinx.util.console import purple, red, darkgreen, darkgray, \ darkred, turquoise