diff --git a/doc/config.rst b/doc/config.rst index 5e641cbfb..39feaae78 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -768,6 +768,12 @@ that use Sphinx's HTMLWriter class. will be used to convert quotes and dashes to typographically correct entities. Default: ``True``. + .. deprecated:: 1.6 + Use the `smart_quotes option`_ in the Docutils configuration file + (``docutils.conf``) instead. + + .. _`smart_quotes option`: http://docutils.sourceforge.net/docs/user/config.html#smart-quotes + .. confval:: html_add_permalinks Sphinx will add "permalinks" for each heading and description environment as diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index a0b3d8e87..16145beb3 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -1312,7 +1312,7 @@ def setup(app): app.add_config_value('html_static_path', [], 'html') app.add_config_value('html_extra_path', [], 'html') app.add_config_value('html_last_updated_fmt', None, 'html', string_classes) - app.add_config_value('html_use_smartypants', True, 'html') + app.add_config_value('html_use_smartypants', None, 'html') app.add_config_value('html_sidebars', {}, 'html') app.add_config_value('html_additional_pages', {}, 'html') app.add_config_value('html_domain_indices', True, 'html', [list]) diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py index b0a1a2ce5..4c078a9a3 100644 --- a/sphinx/environment/__init__.py +++ b/sphinx/environment/__init__.py @@ -674,8 +674,14 @@ class BuildEnvironment(object): self.settings['gettext_compact'] = self.config.gettext_compact language = (self.config.language or 'en').replace('_', '-') self.settings['language_code'] = language - if language in smartchars.quotes: - self.settings['smart_quotes'] = self.config.html_use_smartypants + if self.config.html_use_smartypants is not None: + warnings.warn("html_use_smartypants option is deprecated. Use the " + "smart_quotes option in docutils.conf instead.", + RemovedInSphinx17Warning) + if language in smartchars.quotes: + self.settings['smart_quotes'] = self.config.html_use_smartypants + elif language in smartchars.quotes: # We enable smartypants by default + self.settings['smart_quotes'] = True docutilsconf = path.join(self.srcdir, 'docutils.conf') # read docutils.conf from source dir, not from current dir