mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-06-03 08:16:13 +08:00
feat(lib): add options for skipping Sphinx directive (#423)
This commit is contained in:
@ -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)
|
||||
|
||||
|
@ -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 <OTHER_SPHINX_OPTIONS>
|
||||
# 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()
|
||||
|
Reference in New Issue
Block a user