mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-05-22 04:56:24 +08:00

* feat(cli): add render command as alias to `manim render` * feat(cli): add render command as alias to `manim render` * chore(test): add test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * chore(lib): simplify how ManimGL rendering is called * chore(lib): test * chore(ci): try identify error * wip * chore(test): add result output * try: checkout * Revert "try: checkout" This reverts commit 60985f0b612ca0c6bff9726ebcccf07b1b1c4832. * fix(deps): don't update lock * chore(lib): simplify code and improve usage * chore(cli): better cli * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: does this fix? --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
100 lines
2.4 KiB
Plaintext
100 lines
2.4 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "6896875b-34ce-4fc5-809c-669c295067e7",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Jupyter Magic Example\n",
|
|
"\n",
|
|
"This small example shows how to use the Manim Slides cell (`%%manim_slides`) and line (`%manim_slides`) magics:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "a73f1c06-c7f8-4f19-a90e-e283bfb8c7c5",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from manim import *\n",
|
|
"from manim_slides import *"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "68dda1a0-74ff-4d9e-9575-5b25a98f21e7",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"%%manim_slides -v WARNING --progress_bar None MySlide --manim-slides controls=true\n",
|
|
"\n",
|
|
"config.media_embed = True\n",
|
|
"\n",
|
|
"class MySlide(Slide):\n",
|
|
" def construct(self):\n",
|
|
" square = Square()\n",
|
|
" circle = Circle()\n",
|
|
" \n",
|
|
" self.play(Create(square))\n",
|
|
" self.next_slide()\n",
|
|
" self.play(Transform(square, circle))"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "54fa2d3e-bfee-417d-b64b-f3f30a8749ea",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"class MyOtherSlide(Slide):\n",
|
|
" def construct(self):\n",
|
|
" text = VGroup(\n",
|
|
" Text(\"Press\"),\n",
|
|
" Text(\"and\"),\n",
|
|
" Text(\"loop\"),\n",
|
|
" ).arrange(DOWN, buff=1.0)\n",
|
|
"\n",
|
|
" self.play(Write(text))\n",
|
|
" self.next_slide(loop=True)\n",
|
|
" self.play(Indicate(text[-1], scale_factor=2.0, run_time=0.5))\n",
|
|
" self.next_slide()\n",
|
|
" self.play(FadeOut(text))"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "7d8ad450-1487-4ca7-8d89-bf8ac344e1fa",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"%manim_slides -v WARNING --progress_bar None MyOtherSlide --manim-slides controls=true"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "manim-slides",
|
|
"language": "python",
|
|
"name": "manim-slides"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.10.6"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|