From 3c0c9cd198e1d4f8defd0bb1d90bb5a8ce8d17e0 Mon Sep 17 00:00:00 2001 From: Viktor Haag Date: Mon, 20 Jan 2014 13:27:52 -0500 Subject: [PATCH] updates per Georg Brandl: - Change alteration to docs to express path relative to "configuration directory" and not "conf.py" - Update block in HTML builder copying favicon to _static to mirror handling of html_logo --- doc/config.rst | 8 ++++---- sphinx/builders/html.py | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/config.rst b/doc/config.rst index 0ee36f3c6..192fc2022 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -497,9 +497,9 @@ that use Sphinx' HTMLWriter class. .. confval:: html_logo If given, this must be the name of an image file (path relative to the - ``conf.py`` 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``. + :term:`configuration directory`) 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 @@ -508,7 +508,7 @@ that use Sphinx' HTMLWriter class. .. confval:: html_favicon If given, this must be the name of an image file (path relative to the - ``conf.py`` file) that is the favicon of the docs. Modern browsers use this + :term:`configuration directory`) that is the favicon of the docs. Modern browsers use this as icon for tabs, windows and bookmarks. It should be a Windows-style icon file (``.ico``), which is 16x16 or 32x32 pixels large. Default: ``None``. diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index fe64d2aaf..beb8d3cab 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -597,7 +597,7 @@ class StandaloneHTMLBuilder(Builder): if self.config.html_logo: logobase = path.basename(self.config.html_logo) logotarget = path.join(self.outdir, '_static', logobase) - if not path.isfile(path.realpath(self.config.html_logo)): + if not path.isfile(path.join(self.confdir, self.config.html_logo)): self.warn('logo file %r does not exist' % self.config.html_logo) elif not path.isfile(logotarget): copyfile(path.join(self.confdir, self.config.html_logo), @@ -605,7 +605,9 @@ class StandaloneHTMLBuilder(Builder): if self.config.html_favicon: iconbase = path.basename(self.config.html_favicon) icontarget = path.join(self.outdir, '_static', iconbase) - if not path.isfile(icontarget): + if not path.isfile(path.join(self.confdir, self.config.html_favicon)): + self.warn('favicon file %r does not exist' % self.config.html_favicon) + elif not path.isfile(icontarget): copyfile(path.join(self.confdir, self.config.html_favicon), icontarget) self.info('done')