[Python-checkins] r63583 - in doctools/trunk: CHANGES doc/config.rst sphinx/builder.py
georg.brandl
python-checkins at python.org
Sat May 24 18:40:12 CEST 2008
Author: georg.brandl
Date: Sat May 24 18:40:11 2008
New Revision: 63583
Log:
Allow subdirs in html_static_path.
Modified:
doctools/trunk/CHANGES
doctools/trunk/doc/config.rst
doctools/trunk/sphinx/builder.py
Modified: doctools/trunk/CHANGES
==============================================================================
--- doctools/trunk/CHANGES (original)
+++ doctools/trunk/CHANGES Sat May 24 18:40:11 2008
@@ -17,6 +17,8 @@
* The new `exclude_trees` config option can be used to exclude whole
subtrees from the search for source files.
+* The directories in the `html_static_path` can now contain subdirectories.
+
Bugs fixed
----------
Modified: doctools/trunk/doc/config.rst
==============================================================================
--- doctools/trunk/doc/config.rst (original)
+++ doctools/trunk/doc/config.rst Sat May 24 18:40:11 2008
@@ -202,6 +202,9 @@
files, so a file named :file:`default.css` will overwrite the builtin
:file:`default.css`.
+ .. versionchanged:: 0.4
+ The paths in :confval:`html_static_path` can now contain subdirectories.
+
.. confval:: html_last_updated_fmt
If this is not the empty string, a 'Last updated on:' timestamp is inserted
Modified: doctools/trunk/sphinx/builder.py
==============================================================================
--- doctools/trunk/sphinx/builder.py (original)
+++ doctools/trunk/sphinx/builder.py Sat May 24 18:40:11 2008
@@ -507,8 +507,14 @@
for spath in self.config.html_static_path]
for staticdirname in staticdirnames:
for filename in os.listdir(staticdirname):
- if not filename.startswith('.'):
- shutil.copyfile(path.join(staticdirname, filename),
+ if filename.startswith('.'):
+ continue
+ fullname = path.join(staticdirname, filename)
+ if path.isfile(fullname):
+ shutil.copyfile(fullname,
+ path.join(self.outdir, '_static', filename))
+ elif path.isdir(fullname):
+ shutil.copytree(fullname,
path.join(self.outdir, '_static', filename))
# add pygments style file
f = open(path.join(self.outdir, '_static', 'pygments.css'), 'w')
More information about the Python-checkins
mailing list