Skip to content

Commit 336593d

Browse files
authored
Merge pull request #256 from martinRenou/jupyterlite-sphinx
Add jupyterlite-sphinx in the docs
2 parents b9c0d3c + 6144646 commit 336593d

File tree

5 files changed

+103
-2
lines changed

5 files changed

+103
-2
lines changed

docs/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
ipycanvas
2-
git+https://github.com/pandas-dev/pydata-sphinx-theme@master
2+
jupyterlite-sphinx
3+
pydata-sphinx-theme

docs/source/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# -*- coding: utf-8 -*-
22
extensions = [
33
'sphinx.ext.autodoc',
4-
'sphinx.ext.napoleon'
4+
'sphinx.ext.napoleon',
5+
'jupyterlite_sphinx'
56
]
67

78
templates_path = ['_templates']
89

10+
jupyterlite_config = "jupyterlite_config.json"
11+
912
master_doc = 'index'
1013
source_suffix = '.rst'
1114

docs/source/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ You can try ipycanvas, without the need of installing anything on your computer,
1414
.. image:: https://img.shields.io/badge/start-drawing!-F5A252.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXm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R9EBw8zRUcKxwp73xkaLiqQb+kGduJTNHG72zcW9LoJgqQxpP3/Tj//c3yB0tqzaml05/+orHLksVO+95kX7/7qgJvnjlrfr2Ggsyx0eoy9uPzN5SPd86aXggOsEKW2Prz7du3VID3/tzs/sSRs2w7ovVHKtjrX2pd7ZMlTxAYfBAL9jiDwfLkq55Tm7ifhMlTGPyCAs7RFRhn47JnlcB9RM5T97ASuZXIcVNuUDIndpDbdsfrqsOppeXl5Y+XVKdjFCTh+zGaVuj0d9zy05PPK3QzBamxdwtTCrzyg/2Rvf2EstUjordGwa/kx9mSJLr8mLLtCW8HHGJc2R5hS219IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/MsrQhltE7Ug0uFOzufJFE2PxBo/YAx8XPPdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC
1515
:target: https://mybinder.org/v2/gh/martinRenou/ipycanvas/stable?urlpath=lab%2Ftree%2Fexamples
1616

17+
Or you can try it directly in this documentation page thanks to JupyterLite!!
18+
19+
.. retrolite:: source/ipycanvas.ipynb
20+
1721
Questions?
1822
----------
1923

docs/source/ipycanvas.ipynb

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "b7c49844",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"# This cell is only needed in this documentation page\n",
11+
"# do not try to run this in your Notebooks if not using JupyterLite, it won't work :)\n",
12+
"import piplite\n",
13+
"await piplite.install('ipycanvas')"
14+
]
15+
},
16+
{
17+
"cell_type": "code",
18+
"execution_count": null,
19+
"id": "27d1bf8c",
20+
"metadata": {},
21+
"outputs": [],
22+
"source": [
23+
"from math import pi\n",
24+
"\n",
25+
"from ipycanvas import Canvas\n",
26+
"\n",
27+
"canvas = Canvas(width=1600, height=1200, layout=dict(width='100%'))\n",
28+
"\n",
29+
"canvas.fill_style = '#8ee05e'\n",
30+
"canvas.fill_rect(0, 0, canvas.width, canvas.height)\n",
31+
"\n",
32+
"canvas.fill_style = '#f5f533'\n",
33+
"canvas.fill_circle(canvas.width / 2., canvas.height / 2., 500)\n",
34+
"\n",
35+
"canvas.stroke_style = 'black'\n",
36+
"canvas.line_width = 30\n",
37+
"canvas.stroke_circle(canvas.width / 2., canvas.height / 2., 500)\n",
38+
"\n",
39+
"canvas.fill_style = 'black'\n",
40+
"canvas.fill_circle(canvas.width / 2.7, canvas.height / 3., 100) # Right eye\n",
41+
"canvas.stroke_arc(canvas.width / 2., canvas.height / 2., 400, 0, pi, False) # Mouth\n",
42+
"canvas.stroke_arc(canvas.width - canvas.width / 2.7, canvas.height / 2.7, 100, 0, pi, True) # Left eye\n",
43+
"\n",
44+
"canvas"
45+
]
46+
}
47+
],
48+
"metadata": {
49+
"kernelspec": {
50+
"display_name": "Python 3 (ipykernel)",
51+
"language": "python",
52+
"name": "python3"
53+
},
54+
"language_info": {
55+
"codemirror_mode": {
56+
"name": "ipython",
57+
"version": 3
58+
},
59+
"file_extension": ".py",
60+
"mimetype": "text/x-python",
61+
"name": "python",
62+
"nbconvert_exporter": "python",
63+
"pygments_lexer": "ipython3",
64+
"version": "3.10.2"
65+
}
66+
},
67+
"nbformat": 4,
68+
"nbformat_minor": 5
69+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"LiteBuildConfig": {
3+
"federated_extensions": [
4+
"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",
5+
],
6+
"ignore_sys_prefix": true,
7+
"piplite_urls": [
8+
"https://files.pythonhosted.org/packages/py2.py3/i/ipycanvas/ipycanvas-0.10.2-py2.py3-none-any.whl",
9+
"https://files.pythonhosted.org/packages/py2.py3/i/ipython-genutils/ipython_genutils-0.2.0-py2.py3-none-any.whl",
10+
"https://files.pythonhosted.org/packages/py2.py3/i/ipywidgets/ipywidgets-7.6.5-py2.py3-none-any.whl",
11+
"https://files.pythonhosted.org/packages/py2.py3/r/requests/requests-2.27.1-py2.py3-none-any.whl",
12+
"https://files.pythonhosted.org/packages/py2.py3/t/traittypes/traittypes-0.2.1-py2.py3-none-any.whl",
13+
"https://files.pythonhosted.org/packages/py2.py3/u/urllib3/urllib3-1.26.8-py2.py3-none-any.whl",
14+
"https://files.pythonhosted.org/packages/py3/b/branca/branca-0.4.2-py3-none-any.whl",
15+
"https://files.pythonhosted.org/packages/py3/i/ipython/ipython-8.0.1-py3-none-any.whl",
16+
"https://files.pythonhosted.org/packages/py3/j/jupyter-client/jupyter_client-7.1.2-py3-none-any.whl",
17+
"https://files.pythonhosted.org/packages/py3/j/jupyter-core/jupyter_core-4.9.2-py3-none-any.whl",
18+
"https://files.pythonhosted.org/packages/py3/j/jupyterlab-widgets/jupyterlab_widgets-1.0.2-py3-none-any.whl",
19+
"https://files.pythonhosted.org/packages/py3/n/nest-asyncio/nest_asyncio-1.5.4-py3-none-any.whl",
20+
"https://files.pythonhosted.org/packages/py3/n/notebook/notebook-6.4.8-py3-none-any.whl",
21+
"https://files.pythonhosted.org/packages/py3/t/traitlets/traitlets-5.1.1-py3-none-any.whl",
22+
]
23+
}
24+
}

0 commit comments

Comments
 (0)