Skip to main content

Sphinx Extension: PRIME applets

Introduction

This extension provides an interface to include PRIME applets with relative ease.

What does it do?

This extension provides one Sphinx directives (applet) that can be used to quickly insert a PRIME applet.

Installation

To use this extension, follow these steps:

Step 1: Install the Package

Install the module sphinx-prime-applets package using pip:

pip install sphinx-prime-applets

Step 2: Add to requirements.txt

Make sure that the package is included in your project's requirements.txt to track the dependency:

sphinx-prime-applets

Step 3: Enable in _config.yml

In your _config.yml file, add the extension to the list of Sphinx extra extensions (important: underscore, not dash this time):

sphinx: 
    extra_extensions:
        .
        .
        .
        - sphinx_prime_applets
        .
        .
        .

Applet directive

```{applet}
:url: lines_and_planes/normal_equation_plane_origin
:fig: Images/image_shown_in_print_version.svg
:name: name_that_is_used_to_refer_to_this_figure
:class: dark-light
:title: This title is shown when you full-screen the applet

A plane through the point $P$.
```

Setting the base URL

By default, the extension uses https://openla.ewi.tudelft.nl/applet/ as the base URL for the applets. If you want to change this, you can set the prime_applets_base_url configuration option in your Sphinx configuration file to the desired base URL. For example:

# In your Sphinx configuration file (e.g., conf.py)
prime_applets_base_url = "https://my-custom-url.com/applet/"

or in YAML format:

# In your Sphinx configuration file (e.g., _config.yml)
sphinx:
    config:
        prime_applets_base_url: "https://my-custom-url.com/applet/"

Parameters for an applet

Some parameters can be set for an applet. Only the url and name parameters are required; the rest is optional. It is recommended to add a status to the applet, which can be unreviewed, in-review or reviewed.

```{applet}
:url: lines_and_planes/normal_equation_plane_origin # Required url
:fig: Images/lines_and_planes/normal_equation_plane_origin.svg  # Image shown in print version
:status: reviewed # default is "unreviewed". Other options are "in-review" and "reviewed"
:name: Fig:InnerProduct:ProjectionVectorLine

A title that describes the applet
```

Optional parameters

Parameter Description Default
fig The path to an image that will be shown in the print version of the document None
title A string that will be shown as the title of the applet when the applet is in fullscreen mode ""
status The status of the applet. Can be unreviewed, in-review or reviewed unreviewed
width The width of the applet in pixels 100%
height The height of the applet in pixels 400px

Control parameters

2D Specific parameters

Parameter Description Default
position2D The position of the applet in the 2D plane 0,0
zoom2D The zoom level of the applet in the 2D plane 1

3D Specific parameters

Parameter Description Default
position3D The position of the applet in the 3D plane 0,0,0
zoom3D The zoom level of the applet in the 3D plane 1

Contribute

This tool's repository is stored on GitHub. If you'd like to contribute, you can create a fork and open a pull request on the GitHub repository.

The README.md of the branch manual is also part of the TeachBooks manual as a submodule.

Metadata

By default the applet directive adds metadata to the figure node it creates. This metadata includes information such as author, license, copyright, and source. This information is useful for documentation and attribution purposes. If you want to disable this feature, you can set the prime_applets_metadata configuration option to False in your Sphinx configuration file.

Release files for sphinx-prime-applets 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-prime-applets 1.4.0
File Size Uploaded
sphinx_prime_applets-1.4.0.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-prime-applets 1.4.0
File Interpreter ABI Platform
sphinx_prime_applets-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.7 kB

Release files / sphinx_prime_applets-1.4.0.tar.gz

Download URL sphinx_prime_applets-1.4.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6a82aae40946b3e55963719a9e272733d45c91dd722ea36b8ba3895a871e5b32
BLAKE2b-256 checksum
How to use checksums
070c2307a023d4e4a90721214e801234b8559de40504e97a92c1fa13a7033c20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / sphinx_prime_applets-1.4.0-py3-none-any.whl

Download URL sphinx_prime_applets-1.4.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
423b7decde4564703f5a22296bc43ae5c446e32dbb758cee81468c832c616333
BLAKE2b-256 checksum
How to use checksums
d8358e074890c445107131c183dd3965a88fc90b2fbc9253a0d882c5333c44ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page