From aa2f064e2f169bccb7852f50a81dffc96bb560c4 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 1 Mar 2014 09:23:09 +0100 Subject: [PATCH 1/5] Closes #1391: Actually prevent using "pngmath" and "mathjax" extensions at the same time in sphinx-quickstart. --- CHANGES | 2 ++ sphinx/quickstart.py | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 3e0809185..4d17a0c64 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,8 @@ Bugs fixed * #1374: Fix for autosummary generating overly-long summaries if first line doesn't end with a period. * #1383: Fix Python 2.5 compatibility of sphinx-apidoc. +* #1391: Actually prevent using "pngmath" and "mathjax" extensions at the same + time in sphinx-quickstart. Documentation ------------- diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index 8ea5b3a30..5cf067e96 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -1141,6 +1141,7 @@ Please indicate if you want to use one of the following Sphinx extensions:''' if d['ext_pngmath'] and d['ext_mathjax']: print '''Note: pngmath and mathjax cannot be enabled at the same time. pngmath has been deselected.''' + d['ext_pngmath'] = False if 'ext_ifconfig' not in d: do_prompt(d, 'ext_ifconfig', 'ifconfig: conditional inclusion of ' 'content based on config values (y/n)', 'n', boolean) From 3149f3618979545ed29487e54dcd8b2614845b50 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 1 Mar 2014 09:25:36 +0100 Subject: [PATCH 2/5] Closes #1386: Fix bug preventing more than one theme being added by the entry point mechanism. --- CHANGES | 2 ++ sphinx/theming.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 4d17a0c64..232ecad01 100644 --- a/CHANGES +++ b/CHANGES @@ -17,6 +17,8 @@ Bugs fixed * #1383: Fix Python 2.5 compatibility of sphinx-apidoc. * #1391: Actually prevent using "pngmath" and "mathjax" extensions at the same time in sphinx-quickstart. +* #1386: Fix bug preventing more than one theme being added by the entry point + mechanism. Documentation ------------- diff --git a/sphinx/theming.py b/sphinx/theming.py index ac25de71d..abc09c17f 100644 --- a/sphinx/theming.py +++ b/sphinx/theming.py @@ -72,7 +72,7 @@ class Theme(object): for theme in os.listdir(themedir): if not path.isfile(path.join(themedir, theme, THEMECONF)): continue - cls.themes[theme] = (path.join(themedir, theme), None) + cls.themes[theme] = (path.join(themedir, theme), None) def __init__(self, name): if name not in self.themes: From 1390388baaccd4b2a19a070a08d0af205e081f46 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 1 Mar 2014 09:27:13 +0100 Subject: [PATCH 3/5] Closes #1370: Ignore "toctree" nodes in text writer, instead of raising. --- CHANGES | 1 + sphinx/writers/text.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 232ecad01..abe83d28f 100644 --- a/CHANGES +++ b/CHANGES @@ -19,6 +19,7 @@ Bugs fixed time in sphinx-quickstart. * #1386: Fix bug preventing more than one theme being added by the entry point mechanism. +* #1370: Ignore "toctree" nodes in text writer, instead of raising. Documentation ------------- diff --git a/sphinx/writers/text.py b/sphinx/writers/text.py index 44d7f90b3..42ba05077 100644 --- a/sphinx/writers/text.py +++ b/sphinx/writers/text.py @@ -729,6 +729,9 @@ class TextTranslator(nodes.NodeVisitor): def visit_index(self, node): raise nodes.SkipNode + def visit_toctree(self, node): + raise nodes.SkipNode + def visit_substitution_definition(self, node): raise nodes.SkipNode From 194e50fd2d0fee64c63a5374746c28edafb40444 Mon Sep 17 00:00:00 2001 From: Takayuki Shimizukawa Date: Sun, 2 Mar 2014 14:40:29 +0900 Subject: [PATCH 4/5] Fix 'make gettext' fails when the '.. todolist::' directive is present. Closes #1364 Nodes that are replicated like todo don't have a uid, however i18n also unnecessary. If extensions need to choose i18n for the extended nodes or not, we need another approach. --- CHANGES | 1 + sphinx/builders/gettext.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index abe83d28f..61f1475b0 100644 --- a/CHANGES +++ b/CHANGES @@ -20,6 +20,7 @@ Bugs fixed * #1386: Fix bug preventing more than one theme being added by the entry point mechanism. * #1370: Ignore "toctree" nodes in text writer, instead of raising. +* #1364: Fix 'make gettext' fails when the '.. todolist::' directive is present. Documentation ------------- diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py index fb8bd0ccd..bf43f9b4a 100644 --- a/sphinx/builders/gettext.py +++ b/sphinx/builders/gettext.py @@ -55,6 +55,9 @@ class Catalog(object): self.metadata = {} # msgid -> file, line, uid def add(self, msg, origin): + if not hasattr(origin, 'uid'): + # Nodes that are replicated like todo don't have a uid, however i18n is also unnecessary. + return if msg not in self.metadata: # faster lookup in hash self.messages.append(msg) self.metadata[msg] = [] From c68104b1be74b8b102a2f3bf394e03072c760cfa Mon Sep 17 00:00:00 2001 From: Takayuki Shimizukawa Date: Sun, 2 Mar 2014 16:02:46 +0900 Subject: [PATCH 5/5] Fix a change of pull request #96 that break sphinx.util.docfields.Field.make_field interface/behavior for `item` argument usage. Closes #1367 --- CHANGES | 2 ++ sphinx/util/docfields.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 61f1475b0..cbeb2a155 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,8 @@ Bugs fixed mechanism. * #1370: Ignore "toctree" nodes in text writer, instead of raising. * #1364: Fix 'make gettext' fails when the '.. todolist::' directive is present. +* #1367: Fix a change of PR#96 that break sphinx.util.docfields.Field.make_field + interface/behavior for `item` argument usage. Documentation ------------- diff --git a/sphinx/util/docfields.py b/sphinx/util/docfields.py index 9cd176b84..d6f46ab99 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) @@ -272,10 +272,10 @@ class DocFieldTransformer(object): groupindices[typename] = len(entries) group = [typedesc, []] entries.append(group) - entry = typedesc.make_entry(fieldarg, translatable_content) + entry = typedesc.make_entry(fieldarg, [translatable_content]) group[1].append(entry) else: - entry = typedesc.make_entry(fieldarg, translatable_content) + entry = typedesc.make_entry(fieldarg, [translatable_content]) entries.append([typedesc, entry]) # step 2: all entries are collected, construct the new field list