diff --git a/CHANGES b/CHANGES index 931327564..75383c554 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,9 @@ Incompatible changes :ref:`ext-metadata`. * Sphinx expects source parser modules to have supported file formats as ``Parser.supported`` attribute +* The default value of :confval:`epub_author` and :confval:`epub_publisher` are + changed from ``'unknown'`` to the value of :confval:`author`. This is same as + a ``conf.py`` file sphinx-build generates. Deprecated ---------- @@ -26,6 +29,7 @@ Features added * Add ``sphinx.config.Any`` to represent the config value accepts any type of value * :confval:`source_suffix` allows a mapping fileext to file types +* Add :confval:`author` as a configuration value Bugs fixed ---------- diff --git a/doc/config.rst b/doc/config.rst index e85a4027d..a0ec91cf0 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -475,6 +475,10 @@ Project information The documented project's name. +.. confval:: author + + The author name(s) of the document. The default value is ``'unknown'``. + .. confval:: copyright A copyright statement in the style ``'2008, Author Name'``. @@ -1434,8 +1438,8 @@ the `Dublin Core metadata `_. .. confval:: epub_author - The author of the document. This is put in the Dublin Core metadata. The - default value is ``'unknown'``. + The author of the document. This is put in the Dublin Core metadata. It + defaults to the :confval:`author` option. .. confval:: epub_contributor @@ -1456,8 +1460,8 @@ the `Dublin Core metadata `_. .. confval:: epub_publisher The publisher of the document. This is put in the Dublin Core metadata. You - may use any sensible string, e.g. the project homepage. The default value is - ``'unknown'``. + may use any sensible string, e.g. the project homepage. The defaults to the + :confval:`author` option. .. confval:: epub_copyright diff --git a/sphinx/builders/epub3.py b/sphinx/builders/epub3.py index c98c4b853..2a1b743e0 100644 --- a/sphinx/builders/epub3.py +++ b/sphinx/builders/epub3.py @@ -231,9 +231,9 @@ def setup(app): app.add_config_value('epub_theme', 'epub', 'html') app.add_config_value('epub_theme_options', {}, 'html') app.add_config_value('epub_title', lambda self: self.html_title, 'html') - app.add_config_value('epub_author', 'unknown', 'html') + app.add_config_value('epub_author', lambda self: self.author, 'html') app.add_config_value('epub_language', lambda self: self.language or 'en', 'html') - app.add_config_value('epub_publisher', 'unknown', 'html') + app.add_config_value('epub_publisher', lambda self: self.author, 'html') app.add_config_value('epub_copyright', lambda self: self.copyright, 'html') app.add_config_value('epub_identifier', 'unknown', 'html') app.add_config_value('epub_scheme', 'unknown', 'html') diff --git a/sphinx/config.py b/sphinx/config.py index 34cbf0883..ad08b4ca4 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -103,6 +103,7 @@ class Config(object): config_values = dict( # general options project = ('Python', 'env'), + author = ('unknown', 'env'), copyright = ('', 'html'), version = ('', 'env'), release = ('', 'env'),