From c0c0ae814a7eacfe60d31b3d6e04f5e9624d725d Mon Sep 17 00:00:00 2001 From: Eli Sohl Date: Fri, 17 May 2024 09:20:12 -0700 Subject: [PATCH] wip --- README.md | 8 ++++---- docs/ Showcase.md | 2 +- docs/BendyArrow.md | 2 +- docs/Block.md | 4 ++-- docs/ByteBox.md | 2 +- docs/CBCBlock.md | 8 ++++---- docs/ECBBlock.md | 4 ++-- docs/ECBBlocks.md | 2 +- docs/FuncBox.md | 4 ++-- docs/index.md | 28 ++++++++++++++-------------- tests/gallery.py | 8 +++++++- 11 files changed, 39 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index e373334..f41475f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # cranim -Manim toolkit for cryptographic scenes. +Manim toolkit for cryptographic scenes. Check out the example gallery: [https://nccgroup.github.io/manim-cranim/](https://nccgroup.github.io/manim-cranim/) -Local install: clone the repo locally and run `pip install -e .` from the repo's root directory (or `pip install .` if you don't expect to ever make local changes). - -In lieu of documentation (for now), please see the code samples and associated renders in the [example gallery](examples/index.md). +Local install: From the repo's root directory, run `pip install -e .` (or `pip install .` if you don't expect to ever make local changes). This is a Manim plugin. Manim requires plugins to be explicitly enabled using a command-line flag or `manim.cfg` file. See e.g. the example in [tests/manim.cfg](tests/manim.cfg), or the official [Manim docs](https://docs.manim.community/en/stable/plugins.html#using-plugins-in-projects) for more info. + +cranim is documented by example; in lieu of API docs, please see the code samples and associated renders in the [example gallery](https://nccgroup.github.io/manim-cranim/). diff --git a/docs/ Showcase.md b/docs/ Showcase.md index c800e12..df0204a 100644 --- a/docs/ Showcase.md +++ b/docs/ Showcase.md @@ -39,7 +39,7 @@ class ECBvsCBCExample(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python diff --git a/docs/BendyArrow.md b/docs/BendyArrow.md index 43c1a99..5f60fba 100644 --- a/docs/BendyArrow.md +++ b/docs/BendyArrow.md @@ -1,6 +1,6 @@ {::nomarkdown} - + {:/nomarkdown} ```python diff --git a/docs/Block.md b/docs/Block.md index db86d7a..f59930b 100644 --- a/docs/Block.md +++ b/docs/Block.md @@ -74,7 +74,7 @@ class BlockExample1(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python @@ -91,7 +91,7 @@ class BlockExample2(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python diff --git a/docs/ByteBox.md b/docs/ByteBox.md index 7b58530..9d19fee 100644 --- a/docs/ByteBox.md +++ b/docs/ByteBox.md @@ -1,6 +1,6 @@ {::nomarkdown} - + {:/nomarkdown} ```python diff --git a/docs/CBCBlock.md b/docs/CBCBlock.md index 2a20b22..3b992ef 100644 --- a/docs/CBCBlock.md +++ b/docs/CBCBlock.md @@ -1,6 +1,6 @@ {::nomarkdown} - + {:/nomarkdown} ```python @@ -13,7 +13,7 @@ class CBCExample1(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python @@ -28,7 +28,7 @@ class CBCExample2(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python @@ -86,7 +86,7 @@ class CBCExample4(MovingCameraScene): # Loops seamlessly ----- {::nomarkdown} - + {:/nomarkdown} ```python diff --git a/docs/ECBBlock.md b/docs/ECBBlock.md index 690d230..eb45d82 100644 --- a/docs/ECBBlock.md +++ b/docs/ECBBlock.md @@ -1,6 +1,6 @@ {::nomarkdown} - + {:/nomarkdown} ```python @@ -33,7 +33,7 @@ class ECBExample3(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python diff --git a/docs/ECBBlocks.md b/docs/ECBBlocks.md index c6e47b1..6082fc4 100644 --- a/docs/ECBBlocks.md +++ b/docs/ECBBlocks.md @@ -1,6 +1,6 @@ {::nomarkdown} - + {:/nomarkdown} ```python diff --git a/docs/FuncBox.md b/docs/FuncBox.md index 8ddd8a3..cfc2f81 100644 --- a/docs/FuncBox.md +++ b/docs/FuncBox.md @@ -1,6 +1,6 @@ {::nomarkdown} - + {:/nomarkdown} ```python @@ -12,7 +12,7 @@ class FuncBoxExample1(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python diff --git a/docs/index.md b/docs/index.md index 51cdcd3..f4579f2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -44,7 +44,7 @@ class ECBvsCBCExample(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python @@ -155,7 +155,7 @@ class CodeRewriteExample1(Scene): {::nomarkdown} - + {:/nomarkdown} ```python @@ -259,7 +259,7 @@ class BlockExample1(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python @@ -276,7 +276,7 @@ class BlockExample2(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python @@ -374,7 +374,7 @@ class BufferToTextExample1(Scene): {::nomarkdown} - + {:/nomarkdown} ```python @@ -442,7 +442,7 @@ class ByteBoxExample2(Scene): {::nomarkdown} - + {:/nomarkdown} ```python @@ -455,7 +455,7 @@ class CBCExample1(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python @@ -470,7 +470,7 @@ class CBCExample2(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python @@ -528,7 +528,7 @@ class CBCExample4(MovingCameraScene): # Loops seamlessly ----- {::nomarkdown} - + {:/nomarkdown} ```python @@ -598,7 +598,7 @@ class CycleExample1(Scene): {::nomarkdown} - + {:/nomarkdown} ```python @@ -631,7 +631,7 @@ class ECBExample3(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python @@ -647,7 +647,7 @@ class ECBExample4(Scene): {::nomarkdown} - + {:/nomarkdown} ```python @@ -661,7 +661,7 @@ class ECBExample2(Scene): {::nomarkdown} - + {:/nomarkdown} ```python @@ -673,7 +673,7 @@ class FuncBoxExample1(Scene): ----- {::nomarkdown} - + {:/nomarkdown} ```python diff --git a/tests/gallery.py b/tests/gallery.py index 864fd54..c6e194d 100755 --- a/tests/gallery.py +++ b/tests/gallery.py @@ -664,15 +664,21 @@ def _write_scenes_to_file(outfile, scenes): else: print("[*] Skipping re-rendering scene", scene_name) + if dest.endswith(".mp4"): + embed = f'' + else: + embed = f'' + entries.append(f""" {{::nomarkdown}} - +{embed} {{:/nomarkdown}} ```python {_trim(inspect.getsource(Scene))} ``` """) + with open(outfile, "w") as f: f.write("\n-----\n".join(entries))