Open
Description
Description of bug / unexpected behavior
When using manim_directive for including Manim videos in a Sphinx document, the code snippet is duplicated in the rendered output.
For example, given this .rst file:
My Plugin Documentation
=======================
Test
----
TODO
.. manim:: MyScene
class MyScene(Scene):
def construct(self):
circle = Circle()
self.play(Create(circle))
self.wait()
This is the result:
Expected behavior
The second code snippet should not be there. A workaround is removing the relative HTML code, that is:
<pre data-manim-binder data-manim-classname="MyScene">
class MyScene(Scene):
def construct(self):
circle = Circle()
self.play(Create(circle))
self.wait()
</pre>
This is the result:
How to reproduce the issue
- Use manim_directive with a simple scene, as shown in the example below.
- Render the scene.
System specifications
System Details
- OS: macOS 12.7.5 (Monterey)
- RAM: 8GB
- Python version (
python/py/python3 --version
): 3.12.6
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
🆕 New
Milestone
Relationships
Development
No branches or pull requests
Activity
behackl commentedon Nov 2, 2024
I am not sure I would qualify this as a bug -- but you are right, we are using the directive to generate both the default output in the admonition, as well as an extra block for the interactive embed. We need to keep this block for the documentation, but perhaps there should be some sort of configuration option that toggles whether these additional blocks are written.
PRs are welcome!
[-][BUG] manim_directive duplicates code[/-][+]Manim directive duplicates code[/+]