Skip to main content

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.

Metadata

Release files for manim-code-blocks-redux 1.0.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for manim-code-blocks-redux 1.0.14
File Size Uploaded Provenance Actions
manim_code_blocks_redux-1.0.14.tar.gz 6.2 kB Without provenance Details for manim_code_blocks_redux-1.0.14.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for manim-code-blocks-redux 1.0.14
File Interpreter ABI Platform Actions
manim_code_blocks_redux-1.0.14-py3-none-any.whl Python 3 none any Details for manim_code_blocks_redux-1.0.14-py3-none-any.whl

Total release size: 13.1 kB

Release files / manim_code_blocks_redux-1.0.14.tar.gz

Download URL manim_code_blocks_redux-1.0.14.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7bafc10e7cf41107ca0ceb397b02b6d518325224dc96df9a2c9fc713f0799618
BLAKE2b-256 checksum
How to use checksums
f9cab224908d021fd8ba754fdfb7257d9b433cc22d2c3230a4bd37d258acb3e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.4

Release files / manim_code_blocks_redux-1.0.14-py3-none-any.whl

Download URL manim_code_blocks_redux-1.0.14-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2fe1d322d6ae0926de850a82b77a6205d5d2730e35aa408d3709a71c7e0c4b2
BLAKE2b-256 checksum
How to use checksums
f98277b1a04d1640edbca75e1e39b48c58dccdc2b506f4129f7caa7a7f6399f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.4

Security for manim-code-blocks-redux 1.0.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.14 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page