Skip to main content

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

Project description

manim-simplex

PyPI version Python License

The Manim plugin half of Simplex: theme tokens, reusable mobjects, slide hierarchy, deck manifest schema, and the manim.plugins entry-point. Distributed on PyPI as manim-simplex.

The lecture-portal platform (CLI, deck discovery, render orchestration, web builder) lives in the sibling simplex package; both contribute modules to the shared PEP 420 simplex/ namespace.

What ships here

Module Contents
simplex.plugin activate() -- the manim.plugins entry-point. Applies the active theme to manim.config.
simplex.section SimplexSectionType enum -- the slide-hierarchy strings written into Manim's sections JSON. Manim-free.
simplex.manifest DeckManifest, MainSlide, Subsection Pydantic models -- the cross-package contract consumed by the simplex web builder. Manim-free.
simplex.theme Theme, Palette, Typography, Spacing, Motion, LatexProfile, WebPalette, active_theme, get_active_theme, presets, render_web_css.
simplex.engine Animation primitives -- Region, Remove, clear_scene, exit_for, register_exit, set_exit_animation, HighlightResult, apply_theme_defaults, plus the glyph_map, ghost_fade, dynamics, geometry, code, text, scaling, debug submodules.
simplex.mobjects Node, Edge, ArrayMob, ArrayEntry, ArrayPointer, OutlineProgressBar.
simplex.slides BaseSlide, OutlineScene, OutlinePart, Chrome, make_chrome.

Install

uv add manim-simplex
# or
pip install manim-simplex

System dependencies (texlive, ffmpeg, cairo, pango) are the same as Manim's -- see the Manim install guide.

Quick start

# decks/<your-deck>/manim.cfg
[CLI]
plugins = simplex
save_sections = True
from manim import MathTex
from simplex.slides import BaseSlide, make_chrome
from simplex.theme import presets

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

    def construct(self) -> None:
        from manim import ORIGIN, Write
        eq = MathTex(r"e^{i\pi} + 1 = 0")
        self.region.place(eq, ORIGIN)
        self.play(Write(eq))
        self.next_slide(name="Hello")
uv run manim-slides render path/to/your_deck/scene.py Hello

Slide hierarchy

BaseSlide.next_slide writes a SimplexSectionType value into Manim's native section JSON. The web builder reconciles that with manim-slides' PresentationConfig to build a main/sub tree.

  • self.next_slide(name="Title") -> MAIN slide named "Title".
  • self.next_slide() as the first call -> MAIN slide auto-named after the scene class with PascalCase boundaries spaced out (DFSLecture"DFS Lecture"; no warning).
  • self.next_slide() after a named main -> SUB slide.
  • self.next_slide(..., loop=True) -> the LOOP variant.
  • self.next_slide(..., section_type="simplex.main.skip") -> explicit override always wins.

Outline slides

OutlineScene composes typed OutlinePart objects into an animated BaseSlide outline. Each part owns already-built Manim mobjects for its feature title, compact label, and optional visual. Progress dots are positioned with self.region.linspace(RIGHT, n) defaults, so edge margins and inter-dot gaps are equal.

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()),
            ],
            **kwargs,
        )

Theme

Themes are frozen Pydantic models -- the same instance produces:

  1. Manim defaults (via apply_theme_defaults, called by the plugin).
  2. A TexTemplate (via LatexProfile.as_tex_template).
  3. CSS variables for the web portal + RevealJS HTML (via render_web_css(theme.web_palette)).
  4. The darcula Pygments style (registered by the plugin).

Switch themes per-scope with active_theme:

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

from manim import Tex

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

Cross-package contract

manim-simplex owns the manifest schema; simplex imports it:

from simplex.manifest import DeckManifest, MainSlide, Subsection

When the schema bumps schema_version, the web builder hard-fails on unknown versions with a pointer at the manim-simplex upgrade. This keeps the two repos honest about their contract.

Why a separate distribution?

The plugin surface (mobjects + theme + entry-point + manifest schema) is reusable independently of the lecture-portal pipeline. Splitting them lets the plugin be a thin dependency for users who want to render slides without pulling in Typer, watchfiles, Jinja, and the web builder stack.

Python's PEP 420 implicit namespace packages merge the two distributions at import time. Neither wheel ships src/simplex/__init__.py, so from simplex.engine import Remove resolves regardless of which wheel contributed the module.

Development

Requires Python 3.13+ and uv.

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

Examples under examples/ are runnable demo scenes; they double as documentation and CI smoke tests:

uv run manim -pql examples/hello_slide.py HelloSlide

License

MIT.

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.0.tar.gz (140.7 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.0-py3-none-any.whl (60.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: manim_simplex-0.2.0.tar.gz
  • Upload date:
  • Size: 140.7 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.0.tar.gz
Algorithm Hash digest
SHA256 5db4a7ebd129d20494e941dee6c0c029b3bb9e679eb17ca382bed9ab0985d6cc
MD5 fac56e8538f4d7227361f9b7cef7daf4
BLAKE2b-256 97e9badef1f7ae6d1178f5b03171f9873a554c9b340e5109ed1b59cc756e67ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for manim_simplex-0.2.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: manim_simplex-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 60.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d61747cdcd5da25a33424b572a4b7cab9fdedb66510c5ce6ab242dc0d527609b
MD5 b0220cec89c7b99a96db5eabfa4e48bc
BLAKE2b-256 7604882d7ff08325bb599698103c254309fc7f5d4a059b8297e12f8e20078f80

See more details on using hashes here.

Provenance

The following attestation bundles were made for manim_simplex-0.2.0-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