Fix mathjax is not loaded

This commit is contained in:
Takeshi KOMIYA 2018-06-13 22:03:32 +09:00
parent 1c3eadcf61
commit e5ddc36fd1
2 changed files with 5 additions and 3 deletions

View File

@ -64,7 +64,8 @@ def builder_inited(app):
if not app.config.jsmath_path:
raise ExtensionError('jsmath_path config value must be set for the '
'jsmath extension to work')
app.add_js_file(app.config.jsmath_path)
if app.builder.format == 'html':
app.builder.add_js_file(app.config.jsmath_path) # type: ignore
def setup(app):

View File

@ -72,8 +72,9 @@ def builder_inited(app):
if not app.config.mathjax_path:
raise ExtensionError('mathjax_path config value must be set for the '
'mathjax extension to work')
options = {'async': 'async'}
app.add_js_file(app.config.mathjax_path, **options)
if app.builder.format == 'html':
options = {'async': 'async'}
app.builder.add_js_file(app.config.mathjax_path, **options) # type: ignore
def setup(app):