Manim-Notebook / manim-notebook

Manim with interactive previewing in VSCode. [Currently in its alpha stage.]
MIT License
9 stars 1 forks source link

Manim Notebook

VSCode extension for replicating Grant Sanderson's manim workflow for Sublime Text from this video

Note this extension is specifically for 3b1b's original manim library, NOT the community version.

Example usage

  1. Install manimgl, make sure that the command manimgl works in your terminal
  2. Open your manim file (e.g. scene.py) in VSCode
  3. Place your cursor where you want to start the scene, on a line of code within the construct method in a scene class
  4. Run the VSCode command: cmd+shift+p -> Manim Notebook: Start scene at cursor
    (This command runs manimgl scene.py NAME_OF_SCENE -se <lineNumber> in your terminal)
    In the upper-right of your screen - the manim interactive video will appear.

Then you can do either:

Keybord shortcuts

You can use the default keyboard shortcuts for these commands, or assign your own.

All current commands are:

Demonstration

The resulting workflow can look like Grant's 🥳

(see demo on youtube)

Customization

// https://stackoverflow.com/a/71962342/
// https://stackoverflow.com/a/77515370/
// Use `[*Light*]` to match themes whose name contains `Light` in them.
"workbench.colorCustomizations": {
    "[*Light*]": {
        "manimNotebookColors.baseColor": "#FF708A",
        "manimNotebookColors.unfocused": "#FFBFCC"
    },
    "[*Dark*]": {
        "manimNotebookColors.baseColor": "#FF708A",
        "manimNotebookColors.unfocused": "#804953"
    },
    "[*Light High Contrast*]": {
        "manimNotebookColors.baseColor": "#FF5473",
        "manimNotebookColors.unfocused": "#FFA3B6"
    },
    "[*Dark High Contrast*]": {
        "manimNotebookColors.baseColor": "#FF5473",
        "manimNotebookColors.unfocused": "#8C5660"
    }
}
See default blue-ish colors ```json // https://stackoverflow.com/a/71962342/ // https://stackoverflow.com/a/77515370/ // Use `[*Light*]` to match themes whose name contains `Light` in them. "workbench.colorCustomizations": { "[*Light*]": { "manimNotebookColors.baseColor": "#2B7BD6", "manimNotebookColors.unfocused": "#DCE9F7" }, "[*Dark*]": { "manimNotebookColors.baseColor": "#64A4ED", "manimNotebookColors.unfocused": "#39506B" }, "[*Light High Contrast*]": { "manimNotebookColors.baseColor": "#216CC2", "manimNotebookColors.unfocused": "#C3DDF7" }, "[*Dark High Contrast*]": { "manimNotebookColors.baseColor": "#75B6FF", "manimNotebookColors.unfocused": "#3C5878" } } ```

Links

Troubleshooting

If you encounter an issue, search for some related keywords first in the issues. If you can't find anything, feel free to open a new issue. To analyze the problem, we need a log file from you: