Skip to main content

Jupyter extension to proxy MyST build server

Project description

jupyter-myst-build-proxy

A Jupyter server extension that serves and proxies static MyST websites.

Overview

jupyter-myst-build-proxy helps JupyterHub users development MyST-based websites. It can build the static HTML assets and serve them from a minimal python web server, allowing users to view MyST sites directly in a JupyterHub environment.

Features

  • Path-based routing: Access MyST projects at /myst/<project-path>/
  • On-demand building: Automatically builds MyST sites when first accessed
  • Rebuild support: Trigger rebuilds with ?rebuild=1 query parameter
  • Multiple projects: Serve different MyST projects from subdirectories
  • Error handling: Shows helpful error page when myst.yml is missing

Installation

pip install .

Usage

Basic Usage

With a jupyter application running, visit /myst/<project-path>/ where <project-path> is a directory containing a MyST project (with myst.yml).

Example 1:

http://localhost:8888/myst/my-documentation/

Example 2:

https://jupyterhub.example.edu/user/username/myst/my-website/

Configuration

Set the default directory using the JUPYTER_MYST_BUILD_PROXY_DIR environment variable to specify an alternative root for where the extension finds MyST projects. The default is the user's current working directory.

Rebuilding Sites

To force a rebuild of a MyST site, add ?rebuild=1 to any page URL:

http://localhost:8888/myst/my-documentation/?rebuild=1

This will delete the _build/html directory and regenerate the site.

How It Works

  1. When you access /myst/<project-path>/, the extension:

    • Checks if <project-path>/myst.yml exists
    • If the site hasn't been built, runs myst build --html --ci with the appropriate BASE_URL
    • Serves the static HTML from <project-path>/_build/html/
  2. The extension uses path-based routing to ensure all assets and navigation links work correctly with the /myst/<project-path>/ prefix.

Requirements

  • jupyter-server-proxy >= 4.1.0
  • mystmd (MyST Markdown CLI tool)

Project Structure

jupyter-myst-build-proxy/
├── jupyter_myst_build_proxy/
│   ├── __init__.py           # Main extension setup
│   ├── static_server.py      # HTTP server for serving MyST sites
│   └── no_myst_error.html    # Error page template
├── setup.py                  # Package configuration
└── README.md                 # This file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter_myst_build_proxy-0.1.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyter_myst_build_proxy-0.1.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_myst_build_proxy-0.1.1.tar.gz.

File metadata

  • Download URL: jupyter_myst_build_proxy-0.1.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jupyter_myst_build_proxy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9e7777e83e059355fac04e7ed8cf35e3356341f5d3b47408d4cf68a07297b944
MD5 0a774c7094dde96b4575b166e2faed58
BLAKE2b-256 88b56c68c39fd927b3a821726900701a16531616d6819dfdc252913fa0984318

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_myst_build_proxy-0.1.1.tar.gz:

Publisher: publish.yml on ryanlovett/jupyter-myst-build-proxy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jupyter_myst_build_proxy-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_myst_build_proxy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 efa42f1911859a65eddda77eda46f4b2d32a3ce36905c18361e97a4f6dca8128
MD5 377a69d88c1444b6ed257369920cdb21
BLAKE2b-256 1f4c6fb7d2dc89ce88bf1c1106a272d516423f54cb5021986a7fa9c72cec31d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_myst_build_proxy-0.1.1-py3-none-any.whl:

Publisher: publish.yml on ryanlovett/jupyter-myst-build-proxy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page