Skip to content
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
12 changes: 8 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Build and Deploy

on:
Expand All @@ -13,21 +14,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.14'
- name: Install OS dependencies
run: |
sudo apt-get update -qq && sudo apt-get install -qq libarchive-dev tesseract-ocr
- name: Install the dependencies
run: |
python -m pip install -r requirements.txt
- name: Build the JupyterLite site
run: |
make
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v5
with:
path: ./dist

Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "Mathics3-notebook-frontends"]
path = Mathics3-notebook-frontends
url = https://github.com/Mathics3/Mathics3-notebook-frontends.git
path = Mathics3-notebook-frontends
url = https://github.com/Mathics3/Mathics3-notebook-frontends.git
28 changes: 22 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
.PHONY: all serve
.PHONY: all clean-cache clean-serve serve runserver wheel

# NOTEBOOK_VERSION Mathics3-Live version. The wheel name has this number in it.
NOTEBOOK_VERSION ?= 1.0.0

PYTHON ?= python
HTTP_PORT ?= 8000

NOTEBOOK_WHEEL=pypi/Mathics3_notebook_frontends-$(NOTEBOOK_VERSION)-py3-none-any.whl
#: Build everything
all: pypi/Mathics3_notebook_frontends-0.1.0-py3-none-any.whl
all: $(NOTEBOOK_WHEEL)
jupyter lite build --contents content --output-dir dist
cp -f index.html dist/index.html

pypi/Mathics3_notebook_frontends-0.1.0-py3-none-any.whl:
#: Remove Jupyter Cache file
clean-cache:
rm .jupyterlite.doit.db || true;


#: Make Build everything
$(NOTEBOOK_WHEEL):
cd Mathics3-notebook-frontends && python3 -m build
cp -f Mathics3-notebook-frontends/dist/[Mm]athics3_notebook_frontends-0.1.0-py3-none-any.whl $@
cp -f Mathics3-notebook-frontends/dist/[Mm]athics3_notebook_frontends-${NOTEBOOK_VERSION}-py3-none-any.whl $@

#: Start a HTTP webserver running Mathics3-live
serve: all
cd dist && python3 -m http.server
runserver serve: all
cd dist && python3 -m http.server $(HTTP_PORT)

#: Clean Jupyter cache and start a HTTP webserver running Mathics3-live
clean-serve: all clean-cache serve
47 changes: 43 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,62 @@ JupyterLite is being tested against modern web browsers:
- Firefox 90+
- Chromium 89+

On Ubuntu, install `libarchive-dev`

```console
sudo apt install libarchive-dev
```

## Installing and running locally

Install this code in a virtual Python environment:
```bash

### Install Mathics3-notebook-frontends submodule

After cloning, Mathics3-notebook-frontends needs to be added as a git submodule. To do this:

```console
git submodule --init --recursive
```

If submodule change and you want to update what's here, you may need to run more `git submodule` commands.

Consult git docs for operating procudures when working with git submodules.


### Install in a virtual Python environment

To install this code in a virtual Python environment:
```console
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```

The above needs to be done only once.
The above also needs to be done only once.

Once the virtual environment has been set up with the packages installed, to run the server:

```bash
```console
make serve
```

## Making changes

### Changes in this Mathics3-live

If `index.html` is updated or possibly other changes, the JupyterLite cache, `.jupyterlite.doit.db` may need to be removed.

```console
make clean-serve
```

will both start the server after first removing the JupyterLite cache.

### Changes in Mathics3-notebook-frontends

You'll need to update the submodule here. One way is just to issue git command like `git pull` inside the `Mathics3-notebook-frontends` directory.


## Further Information and Updates

For more info, keep an eye on the JupyterLite documentation:
Expand Down
10 changes: 10 additions & 0 deletions img/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
About the Mathics3 Logo.

It uses the Times New Roman font. The "3" is italicized.
There is a reflected image that is slanted about 30 per cent and has a gradient on the reflection.

It was created in inkscape, and can probably be edited that way.

The heptatom logo was also created using inkscape.

Inline SVG's are used inside index.html, because I (rocky) can't figure out how to include them in jupyterlite from this directory
Binary file added img/favicons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions img/logo-heptatom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading