Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add video_embed or --embed argument to ManimMagic #2441

Closed
mforbes opened this issue Jan 8, 2022 · 0 comments · Fixed by #2442
Closed

Add video_embed or --embed argument to ManimMagic #2441

mforbes opened this issue Jan 8, 2022 · 0 comments · Fixed by #2442
Labels
new feature Enhancement specifically adding a new feature (feature request should be used for issues instead)

Comments

@mforbes
Copy link
Contributor

mforbes commented Jan 8, 2022

Description of proposed feature

Add an embed flag to the ManimMagic so that the user can control whether or not videos are embded.

Currently video_embed = "google.colab" in str(get_ipython()) is hardcoded to be enabled on Google's CoLab, but there are other places this can be useful, for example, when generating documentation using Sphinx or JupyterBook.

How can the new feature be used?

From the example:

%%manim --embed -v WARNING --disable_caching -qm BannerExample

config.media_width = "75%"

class BannerExample(Scene):
    def construct(self):
        self.camera.background_color = "#ece6e2"
        banner_large = ManimBanner(dark_theme=False).scale(0.7)
        self.play(banner_large.create())
        self.play(banner_large.expand())

This would embed the video in the notebook and output, allowing it to be displayed in other contexts.

Additional comments

This is a rather trivial change. I will submit a PR shortly once I explore a bit to see what the best naming options are.

References

The following may be relevant/useful:

@mforbes mforbes added the new feature Enhancement specifically adding a new feature (feature request should be used for issues instead) label Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Enhancement specifically adding a new feature (feature request should be used for issues instead)
Projects
None yet
1 participant