Skip to content

Commit da190ec

Browse files
committed
Fix docs
1 parent abe2b04 commit da190ec

File tree

3 files changed

+15
-28
lines changed

3 files changed

+15
-28
lines changed

docs/environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: ipylab_docs
33
channels:
44
- conda-forge
55
dependencies:
6-
- python=3.5
6+
- python=3.9
77
- nodejs
88
- numpy
99
- sphinx

docs/source/conf.py

+8-20
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@
2929
"sphinx.ext.napoleon",
3030
"sphinx.ext.todo",
3131
"nbsphinx",
32-
"jupyter_sphinx.embed_widgets",
33-
"nbsphinx_link",
3432
]
3533

3634
# Ensure our extension is available:
35+
import json
3736
import sys
3837
from os.path import dirname, join as pjoin
3938

@@ -71,15 +70,16 @@
7170

7271
here = os.path.dirname(__file__)
7372
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"]
7876

7977
# 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]
8179
# 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+
)
8383

8484
# The language for content autogenerated by Sphinx. Refer to documentation
8585
# for a list of supported languages.
@@ -192,15 +192,3 @@
192192
# that nbsphinx complains about:
193193
#
194194
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)

readthedocs.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
type: sphinx
1+
version: 2
22
python:
3-
version: 3.5
4-
pip_install: true
5-
extra_requirements:
6-
- examples
7-
- docs
3+
version: "3.7"
4+
install:
5+
- method: pip
6+
path: .
87
conda:
9-
file: docs/environment.yml
8+
environment: docs/environment.yml

0 commit comments

Comments
 (0)