From 28873bfa6a86ee5351605226967305be6419d22d Mon Sep 17 00:00:00 2001 From: "Matthias C. M. Troffaes" Date: Thu, 22 Aug 2013 09:20:47 +0100 Subject: [PATCH] Set up initial test. --- doc/config.rst | 12 ++++++++---- sphinx/environment.py | 1 + tests/root/conf.py | 1 + tests/root/robots.txt | 2 ++ 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 tests/root/robots.txt diff --git a/doc/config.rst b/doc/config.rst index d6aa96452..e8bf87177 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -524,10 +524,14 @@ that use Sphinx' HTMLWriter class. .. confval:: html_extra_path - A list of paths that contain extra files (such as - :file:`robots.txt` or :file:`.htaccess`). Relative paths are taken - as relative to the configuration directory. They are copied to the - output directory, and will overwrite any existing generated file. + A list of paths that contain extra files not directly related to + the documentation, such as :file:`robots.txt` or :file:`.htaccess`. + Relative paths are taken as relative to the configuration + directory. They are copied to the output directory. They will + overwrite any existing file of the same name. + + As these files are not meant to be built, they are automatically added to + :confval:`exclude_patterns`. .. versionadded:: 1.2 diff --git a/sphinx/environment.py b/sphinx/environment.py index 35799bea2..3c9c830c1 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -335,6 +335,7 @@ class BuildEnvironment: """ matchers = compile_matchers( config.exclude_patterns[:] + + config.html_extra_path + config.exclude_trees + [d + config.source_suffix for d in config.unused_docs] + ['**/' + d for d in config.exclude_dirnames] + diff --git a/tests/root/conf.py b/tests/root/conf.py index 37b9127e7..8025ba33c 100644 --- a/tests/root/conf.py +++ b/tests/root/conf.py @@ -38,6 +38,7 @@ html_sidebars = {'**': 'customsb.html', 'contents': ['contentssb.html', 'localtoc.html'] } html_style = 'default.css' html_static_path = ['_static', 'templated.css_t'] +html_extra_path = ['robots.txt'] html_last_updated_fmt = '%b %d, %Y' html_context = {'hckey': 'hcval', 'hckey_co': 'wrong_hcval_co'} diff --git a/tests/root/robots.txt b/tests/root/robots.txt new file mode 100644 index 000000000..1b425ee0f --- /dev/null +++ b/tests/root/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: /cgi-bin/