diff --git a/CHANGELOG.md b/CHANGELOG.md index 5807ead..a43d895 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 (unreleased)= ## [Unreleased](https://github.com/jeertmans/manim-slides/compare/v5.1.5...HEAD) +(unreleased-added)= +### Added + +- Added options to skip the Manim Slides Sphinx directive. + [#423](https://github.com/jeertmans/manim-slides/pull/423) + (unreleased-chore)= ### Chore @@ -35,7 +41,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed broken `--show-config` command. [#419](https://github.com/jeertmans/manim-slides/pull/419) - (v5.1.4)= ## [v5.1.4](https://github.com/jeertmans/manim-slides/compare/v5.1.3...v5.1.4) diff --git a/manim_slides/docs/manim_slides_directive.py b/manim_slides/docs/manim_slides_directive.py index 74b14b0..b6e2d35 100644 --- a/manim_slides/docs/manim_slides_directive.py +++ b/manim_slides/docs/manim_slides_directive.py @@ -86,6 +86,19 @@ A third application is to render scenes from another specific file:: you should probably not include examples that rely on external files, since relative paths risk to be broken. +.. note:: + + If you want to skip rendering the slides (e.g., for testing) + you can either set the ``SKIP_MANIM_SLIDES`` environ + variable (to any value) or pass the ``skip-manim-slides`` + tag to ``sphinx``: + + .. code-block:: bash + + sphinx-build -t skip-manim-slides + # or if you use a Makefile + make html O=-tskip-manim-slides + Options ------- @@ -181,6 +194,7 @@ from __future__ import annotations import csv import itertools as it +import os import re import shlex import sys @@ -272,6 +286,7 @@ class ManimSlidesDirective(Directive): "skip-manim-slides" in self.state.document.settings.env.app.builder.tags.tags or self.state.document.settings.env.app.builder.name == "gettext" + or "SKIP_MANIM_SLIDES" in os.environ ) if should_skip: node = SkipManimNode()