Skip to content
This repository was archived by the owner on Feb 14, 2024. It is now read-only.

Commit fcb4281

Browse files
authored
Update docs using 0.3.0 (#19)
* Update docs using 0.3.0 * Add more docs * More docs * Styling * Iterate on the docs
1 parent 0bb2609 commit fcb4281

File tree

9 files changed

+119
-488
lines changed

9 files changed

+119
-488
lines changed

docs/Makefile

Lines changed: 0 additions & 194 deletions
This file was deleted.

docs/source/conf.py renamed to docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@
1414
exclude_patterns = []
1515

1616
html_theme = "pydata_sphinx_theme"
17+
18+
jupyterlite_config = "jupyterlite_config.json"

docs/configuration.rst

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
.. _configuration:
2+
3+
Configuration
4+
=============
5+
6+
Pre-installed packages
7+
----------------------
8+
9+
xeus-python allows you to pre-install packages in the Python runtime.
10+
11+
Requirements
12+
~~~~~~~~~~~~
13+
14+
This feature requires you to have at least ``conda``, `mamba <https://github.com/mamba-org/mamba>`_ or ``micromamba`` installed.
15+
16+
You also need to install ``emsdk``, this can be done by installing it from ``conda-forge``:
17+
18+
.. code::
19+
20+
conda install -c conda-forge emsdk
21+
22+
# OR
23+
24+
mamba install -c conda-forge emsdk
25+
26+
# OR
27+
28+
micromamba install -c conda-forge emsdk
29+
30+
Usage
31+
~~~~~
32+
33+
You can pre-install packages by passing the ``XeusPythonEnv.packages`` CLI option to ``jupyter lite build``.
34+
35+
.. note::
36+
This will automatically install any labextension that it founds, for example installing ipyleaflet will make ipyleaflet work without the need to manually install the jupyter-leaflet labextension.
37+
38+
For example, say you want to install NumPy, Matplotlib and ipyleaflet, it can be done with the following command:
39+
40+
.. code::
41+
42+
jupyter lite build --XeusPythonEnv.packages=numpy,matplotlib,ipyleaflet
43+
44+
The same can be achieved through a `jupyterlite_config.json` file:
45+
46+
.. code::
47+
48+
{
49+
"XeusPythonEnv": {
50+
"packages": ["numpy", "matplotlib", "ipyleaflet"]
51+
}
52+
}
53+
54+
Then those packages are usable directly:
55+
56+
.. replite::
57+
:kernel: xeus-python
58+
:height: 600px
59+
60+
%matplotlib inline
61+
62+
import matplotlib.pyplot as plt
63+
import numpy as np
64+
65+
fig = plt.figure()
66+
plt.plot(np.sin(np.linspace(0, 20, 100)))
67+
plt.show();

docs/environment.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ channels:
44
- conda-forge
55

66
dependencies:
7-
- yarn
8-
- jupyterlab
9-
- jupyter-packaging
7+
- mamba
108
- pydata-sphinx-theme
9+
- emsdk
10+
# - empack
1111

1212
- pip:
13-
- jupyterlite-xeus-python
13+
- jupyterlite
1414
- jupyterlite-sphinx
15+
- jupyterlite-xeus-python==0.3.0
16+
- empack

docs/index.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
xeus-python in JupyterLite
2+
==========================
3+
4+
The `xeus-python <https://github.com/jupyter-xeus/xeus-python>`_ kernel compiled to wasm and installable in JupyterLite!!
5+
6+
Features:
7+
8+
- all IPython features included (magics, matplotlib inline `etc`)
9+
- code completion
10+
- code inspection
11+
- interactive widgets (ipywidgets, ipyleaflet, bqplot, ipycanvas `etc`)
12+
- ``from time import sleep`` works!
13+
- pre-installed packages: you can install the packages you want in your xeus-python lite installation (see :ref:`configuration` page)
14+
15+
.. replite::
16+
:kernel: xeus-python
17+
:height: 600px
18+
19+
print("Hello from xeus-python!")
20+
21+
.. toctree::
22+
:caption: Installation
23+
:maxdepth: 2
24+
25+
installation
26+
configuration

docs/installation.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. _installation:
2+
3+
Installation
4+
============
5+
6+
You can install ``jupyterlite-xeus-python`` with ``pip``:
7+
8+
.. code::
9+
10+
pip install jupyterlite jupyterlite-xeus-python
11+
12+
# This should pick up the xeus-python kernel automatically
13+
jupyter lite build

docs/jupyterlite_config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"XeusPythonEnv": {
3+
"packages": ["numpy", "matplotlib", "ipyleaflet"]
4+
}
5+
}

0 commit comments

Comments
 (0)