|
29 | 29 | "sphinx.ext.napoleon",
|
30 | 30 | "sphinx.ext.todo",
|
31 | 31 | "nbsphinx",
|
32 |
| - "jupyter_sphinx.embed_widgets", |
33 |
| - "nbsphinx_link", |
34 | 32 | ]
|
35 | 33 |
|
36 | 34 | # Ensure our extension is available:
|
| 35 | +import json |
37 | 36 | import sys
|
38 | 37 | from os.path import dirname, join as pjoin
|
39 | 38 |
|
|
71 | 70 |
|
72 | 71 | here = os.path.dirname(__file__)
|
73 | 72 | repo = os.path.join(here, "..", "..")
|
74 |
| -_version_py = os.path.join(repo, "ipylab", "_version.py") |
75 |
| -version_ns = {} |
76 |
| -with open(_version_py) as f: |
77 |
| - exec(f.read(), version_ns) |
| 73 | +with open(os.path.join(repo, "package.json")) as f: |
| 74 | + package = json.load(f) |
| 75 | + _version_js = package["version"] |
78 | 76 |
|
79 | 77 | # The short X.Y version.
|
80 |
| -version = "%i.%i" % version_ns["version_info"][:2] |
| 78 | +version = "%i.%i" % tuple(int(part) for part in _version_js.split("."))[:2] |
81 | 79 | # The full version, including alpha/beta/rc tags.
|
82 |
| -release = version_ns["__version__"] |
| 80 | +release = ( |
| 81 | + _version_js.replace("-alpha.", "a").replace("-beta.", "b").replace("-rc.", "rc") |
| 82 | +) |
83 | 83 |
|
84 | 84 | # The language for content autogenerated by Sphinx. Refer to documentation
|
85 | 85 | # for a list of supported languages.
|
|
192 | 192 | # that nbsphinx complains about:
|
193 | 193 | #
|
194 | 194 | nbsphinx_allow_errors = True # exception ipstruct.py ipython_genutils
|
195 |
| - |
196 |
| - |
197 |
| -def setup(app): |
198 |
| - app.setup_extension("jupyter_sphinx.embed_widgets") |
199 |
| - |
200 |
| - def add_scripts(app): |
201 |
| - for fname in ["helper.js", "embed-bundle.js"]: |
202 |
| - if not os.path.exists(os.path.join(here, "_static", fname)): |
203 |
| - app.warn("missing javascript file: %s" % fname) |
204 |
| - app.add_javascript(fname) |
205 |
| - |
206 |
| - app.connect("builder-inited", add_scripts) |
0 commit comments