Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs to use latest ipywidgets + jupyterlite-xeus #359

Merged
merged 8 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
Expand All @@ -27,7 +27,7 @@ jobs:
version_spec: next

- name: Upload Distributions
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ipycanvas-releaser-dist-${{ github.run_number }}
path: .jupyter_releaser_checkout/dist
24 changes: 12 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-name: ipycanvas-dev
environment-file: dev-environment.yml
channels: conda-forge
extra-specs: |
create-args: >-
python=${{ matrix.python-version }}

- name: Test PEP8
Expand All @@ -46,15 +46,15 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-name: ipycanvas-dev
environment-file: dev-environment.yml
channels: conda-forge
extra-specs: |
create-args: >-
python=${{ matrix.python-version }}


Expand All @@ -65,7 +65,7 @@ jobs:
sha256sum * | tee SHA256SUMS

- name: Upload builds
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: dist ${{ github.run_number }}
path: ./dist
Expand All @@ -86,18 +86,18 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-name: ipycanvas-dev
environment-file: dev-environment.yml
channels: conda-forge
extra-specs: |
create-args: >-
python=${{ matrix.python-version }}

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: dist ${{ github.run_number }}
path: ./dist
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:

- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ipycanvas-playwright-tests
path: |
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/update_galata_references.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -41,14 +41,15 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-name: ipycanvas-dev
environment-file: dev-environment.yml
channels: conda-forge
extra-specs: |
create-args: >-
python=${{ matrix.python-version }}


- name: Install the package
run: pip install -vv .

Expand Down
6 changes: 3 additions & 3 deletions docs/build-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ channels:

dependencies:
- ipycanvas
- mamba
# This is needed for building ipycanvas from source for the emscripten env
- micromamba
- yarn
# Docs requirements
- pydata-sphinx-theme
- jupyterlite-sphinx
- jupyterlite-xeus-python >=0.9.2,<0.10
- jupyterlite-core
- jupyterlite-xeus
- jupyterlab-night
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "jupyterlite_sphinx"]

jupyterlite_dir = "."
jupyterlite_silence = False

master_doc = "index"
source_suffix = ".rst"
Expand Down
5 changes: 3 additions & 2 deletions docs/environment.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: ipycanvas
channels:
- https://repo.mamba.pm/emscripten-forge
- https://repo.mamba.pm/conda-forge
- conda-forge
dependencies:
- xeus-python
- pillow
- numpy
- ipywidgets
- ipywidgets>=8.1.3
- pip:
- ..
31 changes: 29 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,35 @@ You can try ipycanvas, without the need of installing anything on your computer,

Or you can run it directly in your browser using JupyterLite!!

.. image:: https://jupyterlite.rtfd.io/en/latest/_static/badge.svg
:target: https://ipycanvas.readthedocs.io/en/latest/lite/lab
.. replite::
:kernel: xpython
:height: 600px

from math import pi

from ipycanvas import Canvas

canvas = Canvas(width=1600, height=1200, layout=dict(width="100%"))

canvas.fill_style = "#8ee05e"
canvas.fill_rect(0, 0, canvas.width, canvas.height)

canvas.fill_style = "#f5f533"
canvas.fill_circle(canvas.width / 2.0, canvas.height / 2.0, 500)

canvas.stroke_style = "black"
canvas.line_width = 30
canvas.stroke_circle(canvas.width / 2.0, canvas.height / 2.0, 500)

canvas.fill_style = "black"
canvas.fill_circle(canvas.width / 2.7, canvas.height / 3.0, 100) # Right eye
canvas.stroke_arc(canvas.width / 2.0, canvas.height / 2.0, 400, 0, pi, False) # Mouth
canvas.stroke_arc(
canvas.width - canvas.width / 2.7, canvas.height / 2.7, 100, 0, pi, True
) # Left eye

canvas


Questions?
----------
Expand Down
Loading