summaryrefslogtreecommitdiff
path: root/sphinx/builders/html.py
diff options
context:
space:
mode:
authorYoshiki Shibukawa <yoshiki@shibu.jp>2017-04-19 22:22:37 +0900
committerGitHub <noreply@github.com>2017-04-19 22:22:37 +0900
commit23f55ac58df75a75084931836c8c2400d439ec6e (patch)
treefa3ce3f1ec63d632a05bf980b3a97b7cc4a3a29c /sphinx/builders/html.py
parentac6a74ad8911ab590f6901a48344e6a5f1dbdfe1 (diff)
parent388d5936c1377b1f84f45f5b6af464b7671d90bd (diff)
downloadsphinx-git-23f55ac58df75a75084931836c8c2400d439ec6e.tar.gz
Merge pull request #3640 from shibukawa/feature/html5_enabled_for_epub_by_default
fix #3639: use html5 writer for epub by default
Diffstat (limited to 'sphinx/builders/html.py')
-rw-r--r--sphinx/builders/html.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index 7bfce0ad6..cfdfe9718 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -109,6 +109,8 @@ class StandaloneHTMLBuilder(Builder):
search = True # for things like HTML help and Apple help: suppress search
use_index = False
download_support = True # enable download role
+ # use html5 translator by default
+ default_html5_translator = False
# This is a class attribute because it is mutated by Sphinx.add_javascript.
script_files = ['_static/jquery.js', '_static/underscore.js',
@@ -199,7 +201,11 @@ class StandaloneHTMLBuilder(Builder):
def init_translator_class(self):
# type: () -> None
if self.translator_class is None:
- if self.config.html_experimental_html5_writer and html5_ready:
+ use_html5_writer = self.config.html_experimental_html5_writer
+ if use_html5_writer is None:
+ use_html5_writer = self.default_html5_translator and html5_ready
+
+ if use_html5_writer and html5_ready:
if self.config.html_use_smartypants:
self.translator_class = SmartyPantsHTML5Translator
else:
@@ -1322,7 +1328,7 @@ def setup(app):
app.add_config_value('html_search_options', {}, 'html')
app.add_config_value('html_search_scorer', '', None)
app.add_config_value('html_scaled_image_link', True, 'html')
- app.add_config_value('html_experimental_html5_writer', False, 'html')
+ app.add_config_value('html_experimental_html5_writer', None, 'html')
return {
'version': 'builtin',