We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here's a way which allows user to have a custom run_hyphenator.js -- so that if the user have the file -- extension won't overwrite it:
run_hyphenator.js
(hyphenator.py)
hyphenator.py
def builder_inited(app): if not app.config.hyphenator_path: raise ExtensionError('hyphenator extension: "hyphenator_path" must be' ' set in "conf.py"') app.add_javascript(os.path.join(app.config.hyphenator_path, 'Hyphenator.js')) if app.config.hyphenator_language: language = app.config.hyphenator_language elif app.config.language: language = app.config.language else: raise ExtensionError('hyphenator extension: no language found' ', please set "hyphenator_language"' ' in your conf.py') ### modification starts: script_name = "run_hyphenation.js" script_path = os.path.join(app.confdir, app.config.html_static_path[0], script_name) if not os.path.exists(script_path): start_script = ("var hyphenatorSettings = {\n" " selectorfunction: function() {\n" " return $('.document, .sphinxsidebar').get()},\n" " displaytogglebox: true,\n" " defaultlanguage: '%s'\n" " };\n" "Hyphenator.config(hyphenatorSettings);\n" "Hyphenator.run();" % language) with open(script_path, "w") as script_file: script_file.write(start_script) ### modification ends app.add_javascript(script_name)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here's a way which allows user to have a custom
run_hyphenator.js
-- so that if the user have the file -- extension won't overwrite it:(
hyphenator.py
)The text was updated successfully, but these errors were encountered: