Skip to main content

Manim plugin: theme tokens, mobjects, slide hierarchy, deck manifest schema.

Project description

manim-simplex

PyPI version Python CI License

manim-simplex is the Manim plugin layer for Simplex: theme tokens, slide bases, reusable mobjects, animation helpers, and the shared deck manifest schema used by the Simplex web builder.

It is published as manim-simplex and exposes modules under the implicit namespace package simplex.

Requirements

Install

pip install manim-simplex

With uv:

uv add manim-simplex

Verify that Manim can discover the plugin:

python -m manim plugins -l

The output should include simplex.

Configure Manim

Enable the plugin in the manim.cfg next to your scenes or deck:

[CLI]
plugins = simplex
save_sections = True

Manim imports simplex.plugin through the manim.plugins entry point. The plugin applies the active Simplex theme to Manim defaults, registers the Darcula Pygments style, sets the TeX template, sets the background color, and enables section JSON output.

Quick Start

from manim import ORIGIN, MathTex, Write

from simplex.slides import BaseSlide, make_chrome
from simplex.theme import presets


class HelloSlide(BaseSlide):
    def setup(self) -> None:
        super().setup()
        chrome = make_chrome(
            presets.DASTIMATOR_DARK,
            self.region,
            header="Hello, Simplex",
        )
        self.add_to_canvas(**chrome.mobjects)
        self.region = chrome.body_region

    def construct(self) -> None:
        eq = MathTex(r"e^{i\pi} + 1 = 0")
        self.region.place(eq, ORIGIN)
        self.play(Write(eq))
        self.next_slide()  # first call -> MAIN named "Hello Slide"

        consequence = MathTex(r"\therefore\ \cos\pi + i\sin\pi = -1")
        self.region.place(consequence, ORIGIN)
        self.play(Write(consequence))
        self.next_slide()  # later bare calls -> SUB stops

Render as a slide deck:

manim-slides render path/to/scene.py HelloSlide
manim-slides present HelloSlide

Or, in a uv-managed project:

uv run manim-slides render path/to/scene.py HelloSlide
uv run manim-slides present HelloSlide

What Ships Here

Module Public surface
simplex.plugin activate() entry point used by Manim.
simplex.slides BaseSlide, OutlineScene, OutlinePart, Chrome, make_chrome.
simplex.engine Region, Remove, clear_scene, exit_for, register_exit, set_exit_animation, HighlightResult, apply_theme_defaults.
simplex.mobjects Node, Edge, ArrayMob, ArrayEntry, ArrayPointer, OutlineProgressBar.
simplex.theme Theme, Palette, Typography, Spacing, Motion, LatexProfile, WebPalette, active_theme, get_active_theme, presets, render_web_css.
simplex.section SimplexSectionType, the section strings written into Manim section JSON.
simplex.manifest DeckManifest, MainSlide, Subsection, the Pydantic schema shared with simplex-py.

Additional focused helpers live in submodules such as simplex.engine.glyph_map, simplex.engine.code, simplex.engine.geometry, simplex.engine.text, and simplex.engine.debug.

Slide Hierarchy

BaseSlide.next_slide writes Simplex section types into Manim's native section JSON. The simplex-py web builder later reconciles those sections with manim-slides metadata.

self.next_slide(name="Title")          # MAIN slide named "Title"
self.next_slide()                      # first bare call: MAIN named after the class
self.next_slide()                      # later bare calls: SUB slide
self.next_slide(loop=True)             # loop variant
self.next_slide(section_type="simplex.main.skip")  # explicit override

The first bare call is auto-named from the scene class, so DFSLecture becomes DFS Lecture.

Themes

Themes are frozen Pydantic models. The same theme instance drives Manim defaults, TeX defaults, Pygments highlighting, and CSS variables for the web portal.

from manim import Tex

from simplex.theme import presets
from simplex.theme.context import active_theme


with active_theme(presets.ACADEMIC_LIGHT):
    label = Tex("This Tex uses the academic light palette.")

Available presets include DASTIMATOR_DARK and ACADEMIC_LIGHT.

Outline Slides

OutlineScene turns typed OutlinePart objects into an animated agenda slide with progress indicators.

from manim import Circle, Square, Tex

from simplex.engine.text import Caption
from simplex.slides import OutlinePart, OutlineScene


class Outline(OutlineScene):
    def __init__(self, **kwargs):
        super().__init__(
            parts=[
                OutlinePart(Tex("Research Question"), Caption("Question"), Circle()),
                OutlinePart(Tex("Algorithms"), Caption("Algorithms"), Square()),
            ],
            section_name="Outline",
            **kwargs,
        )

Examples

This repository includes runnable examples:

uv run manim -pql examples/theme_demo.py ThemeDemo
uv run manim -pql examples/glyph_map_demo.py GlyphMapDemo
uv run manim-slides render examples/hello_slide.py HelloSlide
uv run manim-slides render examples/outline_slide.py OutlineDemo

The examples directory has its own manim.cfg, so the Simplex plugin is enabled when commands are run from the repository root.

Relationship To simplex-py

Simplex is split into two PyPI distributions:

Distribution Import namespace Purpose
manim-simplex simplex.* Manim plugin, slide bases, theme, mobjects, manifest schema.
simplex-py simplex.* CLI, deck discovery, render orchestration, and static web portal.

Both wheels intentionally contribute to the same PEP 420 namespace. This package does not ship simplex/__init__.py; neither should downstream extensions that want to share the namespace.

Install only manim-simplex if you want to render scenes and slides. Install simplex-py later when you want the full lecture portal and CLI.

Development

git clone https://github.com/shlomi-perles/manim-simplex.git
cd manim-simplex
uv sync --all-extras
uv run pre-commit install

Useful checks:

uv run ruff check .
uv run ruff format --check .
uv run basedpyright
uv run pytest -q
uv build
uvx twine check dist/*

Run plugin smoke tests locally:

uv run python -c "import simplex.plugin; simplex.plugin.activate(); print('ok')"
uv run manim plugins -l

Release

Releases are published to PyPI by GitHub Actions through PyPI Trusted Publishing. To release a new version:

  1. Update version in pyproject.toml.
  2. Move changelog entries under a dated release heading.
  3. Commit the release prep.
  4. Push an annotated tag such as v0.2.1.

The Publish to PyPI workflow builds an sdist and wheel, checks both with Twine, uploads them as a GitHub artifact, and publishes to PyPI via OIDC.

License

MIT. See LICENSE.

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

manim_simplex-0.2.1.tar.gz (141.4 kB view details)

Uploaded Source

Built Distribution

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

manim_simplex-0.2.1-py3-none-any.whl (60.5 kB view details)

Uploaded Python 3

File details

Details for the file manim_simplex-0.2.1.tar.gz.

File metadata

  • Download URL: manim_simplex-0.2.1.tar.gz
  • Upload date:
  • Size: 141.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for manim_simplex-0.2.1.tar.gz
Algorithm Hash digest
SHA256 485373b0dc801042570ffac25656dd20a00119d6fd5795fa00c765842d2f8243
MD5 787af2810cf03e8ccc94fe33e3a8ca76
BLAKE2b-256 08fd78ea50d7998fd5c32db465df6add2c5a4b8684cce796e6d524f743b5731d

See more details on using hashes here.

Provenance

The following attestation bundles were made for manim_simplex-0.2.1.tar.gz:

Publisher: publish-pypi.yml on shlomi-perles/manim-simplex

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

File details

Details for the file manim_simplex-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: manim_simplex-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 60.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for manim_simplex-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc6df3377925b5573b869a3c8a212ead2cb0def6189956bff38a3162c2429c08
MD5 67d5b44dae0ac698e096b5f20b970f21
BLAKE2b-256 fe0f307695a4f3decb1f8d9a753d0fc105cd14de6917ad045f0c777f88b08374

See more details on using hashes here.

Provenance

The following attestation bundles were made for manim_simplex-0.2.1-py3-none-any.whl:

Publisher: publish-pypi.yml on shlomi-perles/manim-simplex

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