Skip to content

Commit

Permalink
Merge pull request #336 from melexis/sphinxcontrib-jquery-local-doc-b…
Browse files Browse the repository at this point in the history
…uild

Avoid sphinxcontrib.jquery==3.0.0 and enable plugin
  • Loading branch information
Letme committed Feb 22, 2023
2 parents 9084869 + 78a5081 commit 8c13a6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions mlx/traceability.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from os import path

from requests import Session
from sphinx import version_info as sphinx_version
from sphinx.roles import XRefRole
from sphinx.util.nodes import make_refnode
from sphinx.errors import NoUri
Expand Down Expand Up @@ -472,6 +473,14 @@ def setup(app):
app.add_css_file('https://cdn.rawgit.com/aexmachina/jquery-bonsai/master/jquery.bonsai.css')
app.add_js_file('traceability.js')

# Since Sphinx 6, jquery isn't bundled anymore and we need to ensure that
# the sphinxcontrib-jquery extension is enabled.
# See: https://dev.readthedocs.io/en/latest/design/sphinx-jquery.html
if sphinx_version >= (6, 0, 0):
# Documentation of Sphinx guarantees that an extension is added and enabled at most once.
# See: https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.setup_extension
app.setup_extension("sphinxcontrib.jquery")

# Configuration for exporting collection to json
app.add_config_value('traceability_json_export_path', None, 'env')

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

requires = [
'Sphinx>=2.4.5,<7.0',
'sphinxcontrib-jquery>=3.0.0',
'sphinxcontrib-jquery>=2.0.0,!=3.0.0',
'docutils',
'matplotlib<4.0',
'natsort',
Expand Down

0 comments on commit 8c13a6f

Please sign in to comment.