[Python-checkins] r64710 - in doctools/branches/0.4.x: CHANGES doc/config.rst sphinx/builder.py

georg.brandl python-checkins at python.org
Fri Jul 4 19:59:56 CEST 2008


Author: georg.brandl
Date: Fri Jul  4 19:59:56 2008
New Revision: 64710

Log:
Copy the html_logo to the output static dir.


Modified:
   doctools/branches/0.4.x/CHANGES
   doctools/branches/0.4.x/doc/config.rst
   doctools/branches/0.4.x/sphinx/builder.py

Modified: doctools/branches/0.4.x/CHANGES
==============================================================================
--- doctools/branches/0.4.x/CHANGES	(original)
+++ doctools/branches/0.4.x/CHANGES	Fri Jul  4 19:59:56 2008
@@ -14,6 +14,8 @@
   can now write arbitrary "rubric" directives, and only those with
   a title of "Footnotes" will be ignored.
 
+* Copy the HTML logo to the output "_static" directory.
+
 
 Release 0.4 (Jun 23, 2008)
 ==========================

Modified: doctools/branches/0.4.x/doc/config.rst
==============================================================================
--- doctools/branches/0.4.x/doc/config.rst	(original)
+++ doctools/branches/0.4.x/doc/config.rst	Fri Jul  4 19:59:56 2008
@@ -215,9 +215,13 @@
 
 .. confval:: html_logo
 
-   If given, this must be the name of an image file (within the static path, see
-   below) that is the logo of the docs.  It is placed at the top of the sidebar;
-   its width should therefore not exceed 200 pixels.  Default: ``None``.
+   If given, this must be the name of an image file that is the logo of the
+   docs.  It is placed at the top of the sidebar; its width should therefore not
+   exceed 200 pixels.  Default: ``None``.
+
+   .. versionadded:: 0.4.1
+      The image file will be copied to the ``_static`` directory of the output
+      HTML, so an already existing file with that name will be overwritten.
 
 .. confval:: html_favicon
 

Modified: doctools/branches/0.4.x/sphinx/builder.py
==============================================================================
--- doctools/branches/0.4.x/sphinx/builder.py	(original)
+++ doctools/branches/0.4.x/sphinx/builder.py	Fri Jul  4 19:59:56 2008
@@ -590,6 +590,11 @@
                 elif path.isdir(fullname):
                     shutil.rmtree(targetname)
                     shutil.copytree(fullname, targetname)
+        # copy logo file (handled differently)
+        if self.config.html_logo:
+            logobase = path.basename(self.config.html_logo)
+            shutil.copyfile(path.join(self.confdir, self.config.html_logo),
+                            path.join(self.outdir, '_static', logobase))
         # add pygments style file
         f = open(path.join(self.outdir, '_static', 'pygments.css'), 'w')
         f.write(PygmentsBridge('html', self.config.pygments_style).get_stylesheet())


More information about the Python-checkins mailing list