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

Commit c7e7c48

Browse files
authored
Convert docs to Markdown (#125)
* Convert docs to Markdown * Minor doc edits
1 parent b9e96d1 commit c7e7c48

File tree

10 files changed

+126
-123
lines changed

10 files changed

+126
-123
lines changed

docs/build-environment.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ dependencies:
88
- pip
99
- click
1010
- typer
11+
- myst-parser
1112
- pydata-sphinx-theme
1213
- yarn
13-
- jupyterlab
14+
- jupyterlab >=3.5.3,<3.6
15+
- jupyterlite-core >=0.1.0,<0.2.0
1416
- empack >=2.0.9,<3
1517
- pip:
16-
- jupyterlite-core==0.1.0
1718
- jupyterlite-sphinx
1819
- ..

docs/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# -*- coding: utf-8 -*-
22

33
extensions = [
4-
'jupyterlite_sphinx'
4+
'jupyterlite_sphinx',
5+
'myst_parser',
56
]
67

78
master_doc = 'index'

docs/configuration.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
(configuration)=
2+
3+
# Configuration
4+
5+
## Pre-installed packages
6+
7+
`xeus-python` allows you to pre-install packages in the Python runtime. You can pre-install packages by adding an `environment.yml` file in the JupyterLite build directory, this file will be found automatically by xeus-python which will pre-build the environment when running `jupyter lite build`.
8+
9+
Furthermore, this automatically installs any labextension that it founds, for example installing ipyleaflet will make ipyleaflet work without the need to manually install the jupyter-leaflet labextension.
10+
11+
Say you want to install `NumPy`, `Matplotlib` and `ipycanvas`, it can be done by creating the `environment.yml` file with the following content:
12+
13+
```
14+
name: xeus-python-kernel
15+
channels:
16+
- https://repo.mamba.pm/emscripten-forge
17+
- https://repo.mamba.pm/conda-forge
18+
dependencies:
19+
- numpy
20+
- matplotlib
21+
- ipycanvas
22+
```
23+
24+
Then you only need to build JupyterLite:
25+
26+
```
27+
jupyter lite build
28+
```
29+
30+
You can also pick another name for that environment file (*e.g.* `custom.yml`), by doing so, you will need to specify that name to xeus-python:
31+
32+
```
33+
jupyter lite build --XeusPythonEnv.environment_file=custom.yml
34+
```
35+
36+
```{note}
37+
It is common to provide `pip` dependencies in a conda environment file. This is currently **not supported** by xeus-python, but there is a [work-in-progress](https://github.com/jupyterlite/xeus-python-kernel/pull/102) to support it.
38+
```
39+
40+
Then those packages are usable directly:
41+
42+
```{eval-rst}
43+
.. replite::
44+
:kernel: xeus-python
45+
:height: 600px
46+
:prompt: Try it!
47+
48+
%matplotlib inline
49+
50+
import matplotlib.pyplot as plt
51+
import numpy as np
52+
53+
fig = plt.figure()
54+
plt.plot(np.sin(np.linspace(0, 20, 100)))
55+
plt.show();
56+
```

docs/configuration.rst

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

docs/deploy.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
(deploy)=
2+
3+
# Deploy your own
4+
5+
## On Github Pages
6+
7+
In order to make your own JupyterLite deployment, you can use the [xeus-python-demo repository template](https://github.com/jupyterlite/xeus-python-demo)
8+
that allows you to easily make a JupyteLite deployment on Github pages with xeus-python as default kernel.
9+
10+
This template repository contains an `environment.yml` file where you can specify the packages you need. You can also add Notebooks to the `content` folder.
11+
12+
## In Sphinx documentation
13+
14+
You can make a JupyterLite deployment with xeus-python installed using the [jupyterlite-sphinx extension](https://github.com/jupyterlite/jupyterlite-sphinx)

docs/deploy.rst

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

docs/index.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# xeus-python in JupyterLite 🚀🪐
2+
3+
The [xeus-python](https://github.com/jupyter-xeus/xeus-python) kernel compiled to WebAssembly and installable in JupyterLite!
4+
5+
Features:
6+
7+
- all IPython features included (magics, matplotlib inline `etc`)
8+
- code completion
9+
- code inspection
10+
- interactive widgets (ipywidgets, ipyleaflet, bqplot, ipycanvas `etc`)
11+
- JupyterLite custom file-system mounting
12+
13+
How does it compare to the [Pyodide kernel](https://github.com/jupyterlite/pyodide-kernel) for JupyterLite?
14+
15+
- `from time import sleep` works!
16+
- starts faster!
17+
- it's lighter by default!
18+
- pre-installed packages! No more piplite (see {ref}`configuration` page)
19+
- no more piplite, but we will be working on a mambalite, stay tuned :D
20+
21+
```{eval-rst}
22+
.. replite::
23+
:kernel: xeus-python
24+
:height: 600px
25+
26+
print("Hello from xeus-python!")
27+
```
28+
29+
```{toctree}
30+
:caption: Usage
31+
:maxdepth: 2
32+
33+
installation
34+
deploy
35+
configuration
36+
```

docs/index.rst

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

docs/installation.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(installation)=
2+
3+
# Installation
4+
5+
You can install `jupyterlite-xeus-python` with `pip`:
6+
7+
```
8+
pip install jupyterlite-xeus-python
9+
```
10+
11+
Once you have installed `jupyterlite-xeus-python`, you can use it as a kernel in JupyterLite. You can use the `jupyter lite` command line interface to build a JupyterLite application to start using the `xeus-python` kernel:
12+
13+
```bash
14+
jupyter lite build
15+
```

docs/installation.rst

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

0 commit comments

Comments
 (0)