diff --git a/docs/source/conf.py b/docs/source/conf.py index cfea894..a0de36c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,7 +16,9 @@ author = "Jérome Eertmans" extensions = [ "sphinx.ext.autodoc", + "sphinx.ext.intersphinx", "sphinx.ext.viewcode", + "sphinxext.opengraph", "sphinx_click", "myst_parser", "sphinx_copybutton", @@ -31,3 +33,29 @@ exclude_patterns = [] html_theme = "furo" html_static_path = ["_static"] + +html_theme_options = { + "footer_icons": [ + { + "name": "GitHub", + "url": "https://github.com/jeertmans/manim-slides", + "html": """ + + + + """, + "class": "", + }, + ], + "source_repository": "https://github.com/jeertmans/manim-slides/", + "source_branch": "main", + "source_directory": "docs/source/", +} + +## -- Intersphinx mapping + +intersphinx_mapping = { + "python": ("https://docs.python.org/3", None), + "manim": ("https://docs.manim.community/en/stable/", None), + "manimlib": ("https://3b1b.github.io/manim/", None), +} diff --git a/docs/source/reference/examples.md b/docs/source/reference/examples.md index efcdaac..29084d8 100644 --- a/docs/source/reference/examples.md +++ b/docs/source/reference/examples.md @@ -2,7 +2,28 @@ Contents of `example.py`. -Do not forget to import Manim Slides and Manim or ManimGL. +Do not forget to import Manim Slides and Manim or ManimGL: + +```python +from manim import * +from manim_slides import Slide, ThreeDSlide +``` + +or + +```python +from manimlib import * +from manim_slides import Slide, ThreeDSlide +``` + +Then, each presentation, named `SCENE`, was generated with those two commands: + +```bash +manim example.py SCENE # or manimgl example SCENE +manim-slides convert SCENE -ccontrols=true +``` + +where `-ccontrols=true` indicates that we want to display the blue navigation arrows. ## Basic Example diff --git a/manim_slides/slide.py b/manim_slides/slide.py index 598789e..2cd73e2 100644 --- a/manim_slides/slide.py +++ b/manim_slides/slide.py @@ -27,7 +27,7 @@ def reverse_video_file(src: str, dst: str) -> None: class Slide(Scene): # type:ignore """ - Inherits from :class:`manim.Scene` or :class:`manimlib.Scene` and provide necessary tools for slides rendering. + Inherits from :class:`manim.scene.scene.Scene` or :class:`manimlib.scene.scene.Scene` and provide necessary tools for slides rendering. """ def __init__( @@ -229,7 +229,7 @@ class Slide(Scene): # type:ignore class ThreeDSlide(Slide, ThreeDScene): # type: ignore """ - Inherits from :class:`Slide` and :class:`manim.ThreeDScene` or :class:`manimlib.ThreeDScene` and provide necessary tools for slides rendering. + Inherits from :class:`Slide` and :class:`manim.scene.three_d_scene.ThreeDScene` or :class:`manimlib.scene.three_d_scene.ThreeDScene` and provide necessary tools for slides rendering. .. note:: ManimGL does not need ThreeDScene for 3D rendering in recent versions, see `example.py`. """ diff --git a/poetry.lock b/poetry.lock index 545755d..4ec08ac 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1333,6 +1333,17 @@ python-versions = ">=3.5" lint = ["docutils-stubs", "flake8", "mypy"] test = ["pytest"] +[[package]] +name = "sphinxext-opengraph" +version = "0.7.5" +description = "Sphinx Extension to enable OGP support" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +sphinx = ">=4.0" + [[package]] name = "srt" version = "3.5.2" @@ -1499,7 +1510,7 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "1.1" python-versions = ">=3.8.1,<3.12" -content-hash = "c3931f97423e6cf1082a0144b675da951151869c357f33a44a3bce06fd0b6520" +content-hash = "0f342939336f7eac6af6ebf0ac4bc9922777f12b0b4c7718f869dad73860c64d" [metadata.files] alabaster = [ @@ -2750,6 +2761,10 @@ sphinxcontrib-serializinghtml = [ {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, ] +sphinxext-opengraph = [ + {file = "sphinxext-opengraph-0.7.5.tar.gz", hash = "sha256:caf061fb3bea8d8f2228f7a1d55cb8f6809f2b5c806bf3600e21ce1a3cf906d1"}, + {file = "sphinxext_opengraph-0.7.5-py3-none-any.whl", hash = "sha256:d7fcf48b5d6477292492c0c7da6ddc469e3657159952e2a0a0df074f54aad99e"}, +] srt = [ {file = "srt-3.5.2.tar.gz", hash = "sha256:7aa4ad5ce4126d3f53b3e7bc4edaa86653d0378bf1c0b1ab8c59f5ab41384450"}, ] diff --git a/pyproject.toml b/pyproject.toml index 6de7775..2ca1baa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,6 +88,7 @@ myst-parser = "^0.18.1" sphinx = "^5.3.0" sphinx-click = "^4.4.0" sphinx-copybutton = "^0.5.1" +sphinxext-opengraph = "^0.7.5" [tool.poetry.group.test.dependencies] manim = "^0.17.0"