From 9f5cb0eca988a9c6b9371e871336ee23f59a9d46 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 19 Jan 2014 17:49:28 +0100 Subject: [PATCH 1/9] docnames can also be None... --- sphinx/builders/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index f1280a0b2..17c9f51d7 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -268,7 +268,7 @@ class Builder(object): # filter "docnames" (list of outdated files) by the updated # found_docs of the environment; this will remove docs that # have since been removed - if docnames != ['__all__']: + if docnames and docnames != ['__all__']: docnames = set(docnames) & self.env.found_docs # another indirection to support builders that don't build From 48aeed6fd80a2ebdc8136b4d0ccc9e60dfc9e5ef Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 19 Jan 2014 17:49:57 +0100 Subject: [PATCH 2/9] add back missing @ --- doc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 8bc59724e..559096493 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -15,4 +15,4 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: - $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) From 5dcf03fb2ddcbf67579b1576ab20d6ee665d9d26 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 19 Jan 2014 18:10:19 +0100 Subject: [PATCH 3/9] Closes #1330: Fix :confval:`exclude_patterns` behavior with subdirectories in the :confval:`html_static_path`. --- CHANGES | 3 +++ sphinx/util/__init__.py | 23 +++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 0ff050036..78d6b446a 100644 --- a/CHANGES +++ b/CHANGES @@ -116,6 +116,9 @@ Bugs fixed * #1283: Fix a bug in the detection of changed files that would try to access doctrees of deleted documents. +* #1330: Fix :confval:`exclude_patterns` behavior with subdirectories in the + :confval:`html_static_path`. + Documentation ------------- diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index 5cbbb61b6..a20fc19be 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -158,18 +158,17 @@ def copy_static_entry(source, targetdir, builder, context={}, else: copyfile(source, target) elif path.isdir(source): - if level == 0: - for entry in os.listdir(source): - if entry.startswith('.'): - continue - copy_static_entry(path.join(source, entry), targetdir, - builder, context, level=1, - exclude_matchers=exclude_matchers) - else: - target = path.join(targetdir, path.basename(source)) - if path.exists(target): - shutil.rmtree(target) - shutil.copytree(source, target) + if not path.isdir(targetdir): + os.mkdir(targetdir) + for entry in os.listdir(source): + if entry.startswith('.'): + continue + newtarget = targetdir + if path.isdir(path.join(source, entry)): + newtarget = path.join(targetdir, entry) + copy_static_entry(path.join(source, entry), newtarget, + builder, context, level=level+1, + exclude_matchers=exclude_matchers) _DEBUG_HEADER = '''\ From ce492862409700399c5dee8f01715ca18f0566c1 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 19 Jan 2014 18:12:52 +0100 Subject: [PATCH 4/9] Closes #1071: add mention of "orphan" to toctree docs --- doc/markup/toctree.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/markup/toctree.rst b/doc/markup/toctree.rst index 9316e69a7..1d5d667ae 100644 --- a/doc/markup/toctree.rst +++ b/doc/markup/toctree.rst @@ -141,8 +141,12 @@ tables of contents. The ``toctree`` directive is the central element. 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 finds a file that is not included, because that means that this file will not - be reachable through standard navigation. Use :confval:`exclude_patterns` to - explicitly exclude documents or directories from building. + be reachable through standard navigation. + + Use :confval:`exclude_patterns` to explicitly exclude documents or + directories from building completely. Use :ref:`the "orphan" metadata + ` to let a document be built, but notify Sphinx that it is not + reachable via a toctree. The "master document" (selected by :confval:`master_doc`) is the "root" of the TOC tree hierarchy. It can be used as the documentation's main page, or From 7a74fe81b18f18d38cf3820fe3154a3279219ffc Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 19 Jan 2014 18:21:23 +0100 Subject: [PATCH 5/9] Closes #1323: Fix emitting empty ``
    `` tags in the HTML writer, which is not valid HTML. --- CHANGES | 3 +++ sphinx/writers/html.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGES b/CHANGES index 78d6b446a..950c7a4b9 100644 --- a/CHANGES +++ b/CHANGES @@ -119,6 +119,9 @@ Bugs fixed * #1330: Fix :confval:`exclude_patterns` behavior with subdirectories in the :confval:`html_static_path`. +* #1323: Fix emitting empty ``
      `` tags in the HTML writer, which is not + valid HTML. + Documentation ------------- diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py index 41663a0cc..2d68564f5 100644 --- a/sphinx/writers/html.py +++ b/sphinx/writers/html.py @@ -240,6 +240,12 @@ class HTMLTranslator(BaseTranslator): self.body.append('.'.join(map(str, numbers)) + self.secnumber_suffix) + # overwritten to avoid emitting empty
        + def visit_bullet_list(self, node): + if len(node) == 1 and node[0].tagname == 'toctree': + raise nodes.SkipNode + BaseTranslator.visit_bullet_list(self, node) + # overwritten def visit_title(self, node): BaseTranslator.visit_title(self, node) From 63b4f3bfae99a2a8609521e667be298dfe6bf118 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 19 Jan 2014 18:40:00 +0100 Subject: [PATCH 6/9] Closes #1147: Don't emit a sidebar search box in the "singlehtml" builder. --- CHANGES | 2 ++ sphinx/themes/basic/searchbox.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 950c7a4b9..6035c50bf 100644 --- a/CHANGES +++ b/CHANGES @@ -122,6 +122,8 @@ Bugs fixed * #1323: Fix emitting empty ``
          `` tags in the HTML writer, which is not valid HTML. +* #1147: Don't emit a sidebar search box in the "singlehtml" builder. + Documentation ------------- diff --git a/sphinx/themes/basic/searchbox.html b/sphinx/themes/basic/searchbox.html index 609aac83b..1495701a2 100644 --- a/sphinx/themes/basic/searchbox.html +++ b/sphinx/themes/basic/searchbox.html @@ -7,7 +7,7 @@ :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{%- if pagename != "search" %} +{%- if pagename != "search" and builder != "singlehtml" %}