From f2ee29ad5850aa7f22446fbad0aac2ad44edc5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Wed, 6 Sep 2023 15:12:29 +0200 Subject: [PATCH] chore(docs): render subclass example --- docs/source/reference/examples.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/source/reference/examples.md b/docs/source/reference/examples.md index f3dcd8f..f441371 100644 --- a/docs/source/reference/examples.md +++ b/docs/source/reference/examples.md @@ -121,6 +121,35 @@ If you do not plan to reuse `MovingCameraSlide` more than once, then you can directly write the `construct` method in the body of `MovingCameraSlide`. ::: +```{eval-rst} +.. manim-slides:: SubclassExample + :hide_source: + :quality: high + + from manim import * + from manim_slides import Slide + + + class MovingCameraSlide(Slide, MovingCameraScene): + pass + + class SubclassExample(MovingCameraSlide): + def construct(self): + eq1 = MathTex("x", "=", "1") + eq2 = MathTex("x", "=", "2") + + self.play(Write(eq1)) + + self.next_slide() + + self.play( + TransformMatchingTex(eq1, eq2), + self.camera.frame.animate.scale(0.5) + ) + + self.wait() +``` + ## Advanced Example A more advanced example is `ConvertExample`, which is used as demo slide and tutorial.