Skip to content

Commit 74a0b16

Browse files
committed
Allow passing custom config file
1 parent e7a5956 commit 74a0b16

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
html_theme = "pydata_sphinx_theme"
88

9+
jupyterlite_config = "jupyterlite_config.json"
10+
911
master_doc = 'index'
1012

1113
# General information about the project.

docs/jupyterlite_config.json

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"LiteBuildConfig": {
3+
"federated_extensions": [
4+
"https://github.com/conda-forge/releases/releases/download/noarch/bqplot-0.12.33-pyhd8ed1ab_0.tar.bz2/bqplot-0.12.33-pyhd8ed1ab_0.tar.bz2",
5+
"https://github.com/conda-forge/releases/releases/download/noarch/ipycanvas-0.10.2-pyhd8ed1ab_0.tar.bz2/ipycanvas-0.10.2-pyhd8ed1ab_0.tar.bz2",
6+
"https://github.com/conda-forge/releases/releases/download/noarch/ipycytoscape-1.3.2-pyh1d7be83_0.tar.bz2/ipycytoscape-1.3.2-pyh1d7be83_0.tar.bz2",
7+
"https://github.com/conda-forge/releases/releases/download/noarch/ipyleaflet-0.15.0-pyhd8ed1ab_3.tar.bz2/ipyleaflet-0.15.0-pyhd8ed1ab_3.tar.bz2",
8+
"https://github.com/conda-forge/releases/releases/download/noarch/ipympl-0.8.8-pyhd8ed1ab_0.tar.bz2/ipympl-0.8.8-pyhd8ed1ab_0.tar.bz2",
9+
"https://github.com/conda-forge/releases/releases/download/noarch/ipyvue-1.7.0-pyhd8ed1ab_0.tar.bz2/ipyvue-1.7.0-pyhd8ed1ab_0.tar.bz2",
10+
"https://github.com/conda-forge/releases/releases/download/noarch/ipyvuetify-1.8.2-pyhd8ed1ab_0.tar.bz2/ipyvuetify-1.8.2-pyhd8ed1ab_0.tar.bz2",
11+
"https://github.com/conda-forge/releases/releases/download/noarch/jupyterlab-drawio-0.9.0-pyhd8ed1ab_0.tar.bz2/jupyterlab-drawio-0.9.0-pyhd8ed1ab_0.tar.bz2",
12+
"https://github.com/conda-forge/releases/releases/download/noarch/jupyterlab-fasta-3.2.0-pyhd8ed1ab_0.tar.bz2/jupyterlab-fasta-3.2.0-pyhd8ed1ab_0.tar.bz2",
13+
"https://github.com/conda-forge/releases/releases/download/noarch/jupyterlab-geojson-3.2.0-pyhd8ed1ab_0.tar.bz2/jupyterlab-geojson-3.2.0-pyhd8ed1ab_0.tar.bz2",
14+
"https://github.com/conda-forge/releases/releases/download/noarch/jupyterlab-kernelspy-3.0.6-pyhd8ed1ab_0.tar.bz2/jupyterlab-kernelspy-3.0.6-pyhd8ed1ab_0.tar.bz2",
15+
"https://github.com/conda-forge/releases/releases/download/noarch/jupyterlab-tour-3.1.4-pyhd8ed1ab_0.tar.bz2/jupyterlab-tour-3.1.4-pyhd8ed1ab_0.tar.bz2",
16+
"https://github.com/conda-forge/releases/releases/download/noarch/jupyterlab_miami_nights-0.3.2-pyhd8ed1ab_0.tar.bz2/jupyterlab_miami_nights-0.3.2-pyhd8ed1ab_0.tar.bz2",
17+
"https://github.com/conda-forge/releases/releases/download/noarch/jupyterlab_widgets-1.0.2-pyhd8ed1ab_0.tar.bz2/jupyterlab_widgets-1.0.2-pyhd8ed1ab_0.tar.bz2",
18+
"https://github.com/conda-forge/releases/releases/download/noarch/plotly-5.6.0-pyhd8ed1ab_0.tar.bz2/plotly-5.6.0-pyhd8ed1ab_0.tar.bz2",
19+
"https://github.com/conda-forge/releases/releases/download/noarch/theme-darcula-3.1.1-pyh3684270_0.tar.bz2/theme-darcula-3.1.1-pyh3684270_0.tar.bz2",
20+
"https://github.com/jupyterlite/p5-kernel/releases/download/v0.1.0a12/jupyterlite_p5_kernel-0.1.0a12-py3-none-any.whl"
21+
],
22+
"ignore_sys_prefix": true,
23+
"piplite_urls": [
24+
"https://files.pythonhosted.org/packages/py2.py3/a/asttokens/asttokens-2.0.5-py2.py3-none-any.whl",
25+
"https://files.pythonhosted.org/packages/py2.py3/b/backcall/backcall-0.2.0-py2.py3-none-any.whl",
26+
"https://files.pythonhosted.org/packages/py2.py3/b/bqplot/bqplot-0.12.33-py2.py3-none-any.whl",
27+
"https://files.pythonhosted.org/packages/py2.py3/c/certifi/certifi-2021.10.8-py2.py3-none-any.whl",
28+
"https://files.pythonhosted.org/packages/py2.py3/d/defusedxml/defusedxml-0.7.1-py2.py3-none-any.whl",
29+
"https://files.pythonhosted.org/packages/py2.py3/e/executing/executing-0.8.2-py2.py3-none-any.whl",
30+
"https://files.pythonhosted.org/packages/py2.py3/f/folium/folium-0.12.1.post1-py2.py3-none-any.whl",
31+
"https://files.pythonhosted.org/packages/py2.py3/i/ipycanvas/ipycanvas-0.10.2-py2.py3-none-any.whl",
32+
"https://files.pythonhosted.org/packages/py2.py3/i/ipycytoscape/ipycytoscape-1.3.2-py2.py3-none-any.whl",
33+
"https://files.pythonhosted.org/packages/py2.py3/i/ipyleaflet/ipyleaflet-0.15.0-py2.py3-none-any.whl",
34+
"https://files.pythonhosted.org/packages/py2.py3/i/ipython-genutils/ipython_genutils-0.2.0-py2.py3-none-any.whl",
35+
"https://files.pythonhosted.org/packages/py2.py3/i/ipyvue/ipyvue-1.7.0-py2.py3-none-any.whl",
36+
"https://files.pythonhosted.org/packages/py2.py3/i/ipyvuetify/ipyvuetify-1.8.2-1-py2.py3-none-any.whl",
37+
"https://files.pythonhosted.org/packages/py2.py3/i/ipywidgets/ipywidgets-7.6.5-py2.py3-none-any.whl",
38+
"https://files.pythonhosted.org/packages/py2.py3/m/mistune/mistune-0.8.4-py2.py3-none-any.whl",
39+
"https://files.pythonhosted.org/packages/py2.py3/m/mypy-extensions/mypy_extensions-0.4.3-py2.py3-none-any.whl",
40+
"https://files.pythonhosted.org/packages/py2.py3/p/pandocfilters/pandocfilters-1.5.0-py2.py3-none-any.whl",
41+
"https://files.pythonhosted.org/packages/py2.py3/p/pexpect/pexpect-4.8.0-py2.py3-none-any.whl",
42+
"https://files.pythonhosted.org/packages/py2.py3/p/pickleshare/pickleshare-0.7.5-py2.py3-none-any.whl",
43+
"https://files.pythonhosted.org/packages/py2.py3/p/plotly/plotly-5.6.0-py2.py3-none-any.whl",
44+
"https://files.pythonhosted.org/packages/py2.py3/p/ptyprocess/ptyprocess-0.7.0-py2.py3-none-any.whl",
45+
"https://files.pythonhosted.org/packages/py2.py3/p/python-dateutil/python_dateutil-2.8.2-py2.py3-none-any.whl",
46+
"https://files.pythonhosted.org/packages/py2.py3/r/requests/requests-2.27.1-py2.py3-none-any.whl",
47+
"https://files.pythonhosted.org/packages/py2.py3/s/spectate/spectate-1.0.1-py2.py3-none-any.whl",
48+
"https://files.pythonhosted.org/packages/py2.py3/t/testpath/testpath-0.5.0-py3-none-any.whl",
49+
"https://files.pythonhosted.org/packages/py2.py3/t/traittypes/traittypes-0.2.1-py2.py3-none-any.whl",
50+
"https://files.pythonhosted.org/packages/py2.py3/u/urllib3/urllib3-1.26.8-py2.py3-none-any.whl",
51+
"https://files.pythonhosted.org/packages/py2.py3/w/wcwidth/wcwidth-0.2.5-py2.py3-none-any.whl",
52+
"https://files.pythonhosted.org/packages/py3/J/Jinja2/Jinja2-3.0.3-py3-none-any.whl",
53+
"https://files.pythonhosted.org/packages/py3/P/Pygments/Pygments-2.11.2-py3-none-any.whl",
54+
"https://files.pythonhosted.org/packages/py3/S/Send2Trash/Send2Trash-1.8.0-py3-none-any.whl",
55+
"https://files.pythonhosted.org/packages/py3/a/altair/altair-4.2.0-py3-none-any.whl",
56+
"https://files.pythonhosted.org/packages/py3/b/branca/branca-0.4.2-py3-none-any.whl",
57+
"https://files.pythonhosted.org/packages/py3/c/charset-normalizer/charset_normalizer-2.0.12-py3-none-any.whl",
58+
"https://files.pythonhosted.org/packages/py3/c/click/click-8.0.4-py3-none-any.whl",
59+
"https://files.pythonhosted.org/packages/py3/e/entrypoints/entrypoints-0.4-py3-none-any.whl",
60+
"https://files.pythonhosted.org/packages/py3/i/idna/idna-3.3-py3-none-any.whl",
61+
"https://files.pythonhosted.org/packages/py3/i/ipython/ipython-8.0.1-py3-none-any.whl",
62+
"https://files.pythonhosted.org/packages/py3/j/jsonschema/jsonschema-4.4.0-py3-none-any.whl",
63+
"https://files.pythonhosted.org/packages/py3/j/jupyter-client/jupyter_client-7.1.2-py3-none-any.whl",
64+
"https://files.pythonhosted.org/packages/py3/j/jupyter-core/jupyter_core-4.9.2-py3-none-any.whl",
65+
"https://files.pythonhosted.org/packages/py3/j/jupyterlab-widgets/jupyterlab_widgets-1.0.2-py3-none-any.whl",
66+
"https://files.pythonhosted.org/packages/py3/m/matplotlib-inline/matplotlib_inline-0.1.3-py3-none-any.whl",
67+
"https://files.pythonhosted.org/packages/py3/n/nbclient/nbclient-0.5.11-py3-none-any.whl",
68+
"https://files.pythonhosted.org/packages/py3/n/nbconvert/nbconvert-6.4.2-py3-none-any.whl",
69+
"https://files.pythonhosted.org/packages/py3/n/nbformat/nbformat-5.1.3-py3-none-any.whl",
70+
"https://files.pythonhosted.org/packages/py3/n/nest-asyncio/nest_asyncio-1.5.4-py3-none-any.whl",
71+
"https://files.pythonhosted.org/packages/py3/n/notebook/notebook-6.4.8-py3-none-any.whl",
72+
"https://files.pythonhosted.org/packages/py3/p/platformdirs/platformdirs-2.5.1-py3-none-any.whl",
73+
"https://files.pythonhosted.org/packages/py3/p/prometheus-client/prometheus_client-0.13.1-py3-none-any.whl",
74+
"https://files.pythonhosted.org/packages/py3/p/prompt-toolkit/prompt_toolkit-3.0.28-py3-none-any.whl",
75+
"https://files.pythonhosted.org/packages/py3/p/pure-eval/pure_eval-0.2.2-py3-none-any.whl",
76+
"https://files.pythonhosted.org/packages/py3/s/stack-data/stack_data-0.2.0-py3-none-any.whl",
77+
"https://files.pythonhosted.org/packages/py3/t/tenacity/tenacity-8.0.1-py3-none-any.whl",
78+
"https://files.pythonhosted.org/packages/py3/t/terminado/terminado-0.13.1-py3-none-any.whl",
79+
"https://files.pythonhosted.org/packages/py3/t/tomli/tomli-2.0.1-py3-none-any.whl",
80+
"https://files.pythonhosted.org/packages/py3/t/traitlets/traitlets-5.1.1-py3-none-any.whl",
81+
"https://files.pythonhosted.org/packages/py3/t/typing_extensions/typing_extensions-4.1.1-py3-none-any.whl",
82+
"https://files.pythonhosted.org/packages/py3/v/vega-datasets/vega_datasets-0.9.0-py3-none-any.whl",
83+
"https://files.pythonhosted.org/packages/py3/x/xyzservices/xyzservices-2022.2.0-py3-none-any.whl"
84+
]
85+
}
86+
}

src/jupyterlite_sphinx.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,18 @@ def jupyterlite_build(app: Sphinx, error):
156156
if app.builder.format == 'html':
157157
print("[jupyterlite-sphinx] Running JupyterLite build")
158158

159+
config = []
160+
if app.env.config.jupyterlite_config:
161+
config = ["--config", app.env.config.jupyterlite_config]
162+
159163
with tempfile.TemporaryDirectory() as tmp_dir:
160164
subprocess.check_output(
161165
[
162166
"jupyter",
163167
"lite",
164168
"build",
165169
"--debug",
170+
*config,
166171
"--lite-dir",
167172
tmp_dir,
168173
"--contents",
@@ -188,6 +193,9 @@ def setup(app):
188193
# We need to build JupyterLite at the end, when all the content was created
189194
app.connect("build-finished", jupyterlite_build)
190195

196+
# Config options
197+
app.add_config_value("jupyterlite_config", None, rebuild="html")
198+
191199
# Initialize RetroLite directive and parser
192200
app.add_node(
193201
RetroliteIframe,

0 commit comments

Comments
 (0)