Skip to content

Commit 37c48a0

Browse files
authored
Initial commit
0 parents  commit 37c48a0

File tree

8 files changed

+333
-0
lines changed

8 files changed

+333
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Setup Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.12'
22+
23+
- name: Install mamba
24+
uses: mamba-org/setup-micromamba@v1
25+
with:
26+
micromamba-version: '1.5.8-0'
27+
environment-file: build-environment.yml
28+
cache-environment: true
29+
30+
- name: Build the JupyterLite site
31+
shell: bash -l {0}
32+
run: |
33+
cp README.md content
34+
jupyter lite build --contents content --output-dir dist
35+
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: ./dist
40+
41+
deploy:
42+
needs: build
43+
if: github.ref == 'refs/heads/main'
44+
permissions:
45+
pages: write
46+
id-token: write
47+
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
*.bundle.*
2+
lib/
3+
node_modules/
4+
.yarn-packages/
5+
*.egg-info/
6+
.ipynb_checkpoints
7+
*.tsbuildinfo
8+
9+
# Created by https://www.gitignore.io/api/python
10+
# Edit at https://www.gitignore.io/?templates=python
11+
12+
### Python ###
13+
# Byte-compiled / optimized / DLL files
14+
__pycache__/
15+
*.py[cod]
16+
*$py.class
17+
18+
# C extensions
19+
*.so
20+
21+
# Distribution / packaging
22+
.Python
23+
build/
24+
develop-eggs/
25+
dist/
26+
downloads/
27+
eggs/
28+
.eggs/
29+
lib/
30+
lib64/
31+
parts/
32+
sdist/
33+
var/
34+
wheels/
35+
pip-wheel-metadata/
36+
share/python-wheels/
37+
.installed.cfg
38+
*.egg
39+
MANIFEST
40+
41+
# PyInstaller
42+
# Usually these files are written by a python script from a template
43+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
44+
*.manifest
45+
*.spec
46+
47+
# Installer logs
48+
pip-log.txt
49+
pip-delete-this-directory.txt
50+
51+
# Unit test / coverage reports
52+
htmlcov/
53+
.tox/
54+
.nox/
55+
.coverage
56+
.coverage.*
57+
.cache
58+
nosetests.xml
59+
coverage.xml
60+
*.cover
61+
.hypothesis/
62+
.pytest_cache/
63+
64+
# Translations
65+
*.mo
66+
*.pot
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# pyenv
78+
.python-version
79+
80+
# celery beat schedule file
81+
celerybeat-schedule
82+
83+
# SageMath parsed files
84+
*.sage.py
85+
86+
# Spyder project settings
87+
.spyderproject
88+
.spyproject
89+
90+
# Rope project settings
91+
.ropeproject
92+
93+
# Mr Developer
94+
.mr.developer.cfg
95+
.project
96+
.pydevproject
97+
98+
# mkdocs documentation
99+
/site
100+
101+
# mypy
102+
.mypy_cache/
103+
.dmypy.json
104+
dmypy.json
105+
106+
# Pyre type checker
107+
.pyre/
108+
109+
# OS X stuff
110+
*.DS_Store
111+
112+
# End of https://www.gitignore.io/api/python
113+
114+
# jupyterlite
115+
*.doit.db
116+
_output

.nojekyll

Whitespace-only changes.

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Xeus-Lite demo
2+
3+
[![lite-badge](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://jupyterlite.github.io/xeus-lite-demo/notebooks/?path=demo.ipynb)
4+
5+
This GitHub template allows you to create deployments of JupyterLite with a custom set of conda packages.
6+
7+
## 💡 How to make your own deployment
8+
9+
Creating a new deployment can be done in three easy steps:
10+
11+
**Step 1: Apply the GitHub template**
12+
13+
1. Click the **"Use this template"** button in the upper right corner of the GitHub repository.
14+
2. Choose a name for your project and select the GitHub organization where you want to create it.
15+
3. Then hit **"Create repository from template"** to finalize the setup.
16+
17+
**Step 2: Enable building the GitHub pages from GitHub actions.**
18+
19+
1. Once your repository is created, enable GitHub Pages by configuring GitHub Actions. This will build and deploy your site automatically.
20+
2. Your deployment will be accessible at the following URL: https://{USERNAME}.github.io/{DEMO_REPO_NAME}.
21+
22+
**Step 3: Customize your conda environment**
23+
24+
1. Update your ``environment.yml`` file to include the required packages.
25+
2. This ensures that your environment has all the necessary dependencies.
26+
27+
## 🎬 Visual Guide
28+
29+
For a step-by-step visual guide, check out the screencast below:
30+
31+
![Deploy your own](deploy.gif)
32+
33+
## 📦 How to install kernels and packages
34+
35+
You can install specific kernels and extra packages by adding them to the ``environment.yml`` file.
36+
37+
See https://jupyterlite-xeus.readthedocs.io/en/latest/environment.html for more documentation.
38+
39+
### Example 1: JupyterLite with NumPy and Matplotlib
40+
41+
To create a JupyterLite deployment with NumPy and Matplotlib pre-installed, edit the ``environment.yml`` file as follows:
42+
43+
```yml
44+
name: xeus-kernel
45+
channels:
46+
- https://repo.prefix.dev/emscripten-forge-dev
47+
- https://repo.prefix.dev/conda-forge
48+
dependencies:
49+
- xeus-python
50+
- numpy
51+
- matplotlib
52+
```
53+
54+
### Example 2: JupyterLite with R and coursekata
55+
56+
To use the R kernel and the coursekata package, edit the environment.yml file as follows:
57+
58+
```yml
59+
name: xeus-kernel
60+
channels:
61+
- https://repo.prefix.dev/emscripten-forge-dev
62+
- https://repo.prefix.dev/conda-forge
63+
dependencies:
64+
- xeus-r
65+
- r-coursekata
66+
```
67+
68+
### Example 3: JupyterLite with C++
69+
70+
To use the C++ kernel, edit the environment.yml file as follows:
71+
72+
```yml
73+
name: xeus-kernel
74+
channels:
75+
- https://repo.prefix.dev/emscripten-forge-dev
76+
- https://repo.prefix.dev/conda-forge
77+
dependencies:
78+
- xeus-cpp
79+
```

build-environment.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: build-env
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python
6+
- pip
7+
- jupyter_server
8+
- jupyterlite-core >=0.6
9+
- jupyterlite-xeus >=4

content/demo.ipynb

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"import this"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": null,
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"from math import pi\n",
19+
"\n",
20+
"from ipycanvas import Canvas\n",
21+
"\n",
22+
"canvas = Canvas(width=1600, height=1200, layout=dict(width=\"100%\"))\n",
23+
"\n",
24+
"canvas.fill_style = \"#8ee05e\"\n",
25+
"canvas.fill_rect(0, 0, canvas.width, canvas.height)\n",
26+
"\n",
27+
"canvas.fill_style = \"#f5f533\"\n",
28+
"canvas.fill_circle(canvas.width / 2.0, canvas.height / 2.0, 500)\n",
29+
"\n",
30+
"canvas.stroke_style = \"black\"\n",
31+
"canvas.line_width = 30\n",
32+
"canvas.stroke_circle(canvas.width / 2.0, canvas.height / 2.0, 500)\n",
33+
"\n",
34+
"canvas.fill_style = \"black\"\n",
35+
"canvas.fill_circle(canvas.width / 2.7, canvas.height / 3.0, 100) # Right eye\n",
36+
"canvas.stroke_arc(canvas.width / 2.0, canvas.height / 2.0, 400, 0, pi, False) # Mouth\n",
37+
"canvas.stroke_arc(\n",
38+
" canvas.width - canvas.width / 2.7, canvas.height / 2.7, 100, 0, pi, True\n",
39+
") # Left eye\n",
40+
"\n",
41+
"canvas"
42+
]
43+
}
44+
],
45+
"metadata": {
46+
"kernelspec": {
47+
"display_name": "xeus-python",
48+
"language": "python",
49+
"name": "xeus-python"
50+
},
51+
"language_info": {
52+
"codemirror_mode": {
53+
"name": "ipython",
54+
"version": 3
55+
},
56+
"file_extension": ".py",
57+
"mimetype": "text/x-python",
58+
"name": "python",
59+
"nbconvert_exporter": "python",
60+
"pygments_lexer": "ipython3",
61+
"version": "3.10.4"
62+
}
63+
},
64+
"nbformat": 4,
65+
"nbformat_minor": 4
66+
}

deploy.gif

1.81 MB
Loading

environment.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: xeus-kernel
2+
channels:
3+
- https://repo.prefix.dev/emscripten-forge-dev
4+
- https://repo.prefix.dev/conda-forge
5+
dependencies:
6+
- xeus-python
7+
- ipycanvas

0 commit comments

Comments
 (0)