Animate highlighted blocks of code in Manim
Project description
Manim Code Blocks Redux
manim-code-blocks-redux
is a library for Manim that allows animating blocks of code in Manim videos and scenes.
Example Usage
from manim import *
from manim_code_blocks import *
class Main(Scene):
def construct(self):
java = CodeBlock(
"""
public class Main {
public static void main(String[] args) {
System.out.println("Hello world");
}
}
""",
language = Java
)
self.play(*java.create(run_time = 3))
Outputs:
Problems & Limitations
Limited Language Support
Currently only the following languages are supported for syntax highlighting:
- C
- C#
- C++
- Java
- JavaScript
- Lua
- Go
- Python
- Rust
- TypeScript
To add language support, submit a pull request to to the tokenize_all_code module.
Unintelligent Highlighting
Manim-Code-Block
uses syntax highlighting, not semantic highlighting. The source code is only tokenized, not parsed, and as such accurate highlighting can be impossible for certain circumstances. Syntax highlighting is provided by the tokenize_all_code module, which lacks thorough language support. Additionally many languages have not been thoroughly tested enough for accurate highlighting. If you find an issue in your syntax highlighting, please report it to the issues thread.
Lack of Themes
Currently the only theme supported out of the box is the One Dark Pro theme from Atom and used in Visual Studio Code. Adding a custom theme is possible (and simple), however currently this is the only theme supported out of the box.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file manim_code_blocks_redux-1.0.14.tar.gz
.
File metadata
- Download URL: manim_code_blocks_redux-1.0.14.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bafc10e7cf41107ca0ceb397b02b6d518325224dc96df9a2c9fc713f0799618 |
|
MD5 | 843d9817fec16d53b701f638daf55114 |
|
BLAKE2b-256 | f9cab224908d021fd8ba754fdfb7257d9b433cc22d2c3230a4bd37d258acb3e5 |
File details
Details for the file manim_code_blocks_redux-1.0.14-py3-none-any.whl
.
File metadata
- Download URL: manim_code_blocks_redux-1.0.14-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2fe1d322d6ae0926de850a82b77a6205d5d2730e35aa408d3709a71c7e0c4b2 |
|
MD5 | 27bbfc5ae50aa09af55da4a0680a5003 |
|
BLAKE2b-256 | f98277b1a04d1640edbca75e1e39b48c58dccdc2b506f4129f7caa7a7f6399f8 |