A community-maintained Python framework for creating mathematical animations.
Updated Dockerfile (include dependencies for building documentation), moved documentation to main README (#1219)
Benjamin Hackla8a37882daf7
diff --git a/README.md b/README.mdindex c2adc2c7a..17defc4ec 100644--- a/README.md+++ b/README.md@@ -29,6 +29,7 @@ Manim is an animation engine for explanatory math videos. It's used to create pr- [Installation](#installation)- [Usage](#usage)- [Documentation](#documentation)+- [Docker](#docker)- [Help with Manim](#help-with-manim)- [Contributing](#contributing)- [License](#license)@@ -79,7 +80,7 @@ You should see your native video player program pop up and play a simple scene i[GitHub repository](master/example_scenes). You can also visit the [official gallery](https://docs.manim.community/en/stable/examples.html) for more advanced examples.Manim also ships with a `%%manim` IPython magic which allows to use it conveniently in JupyterLab (as well as classic Jupyter) notebooks. See the-[corresponding documentation](https://docs.manim.community/en/stable/reference/manim.utils.ipython_magic.ManimMagic.html) for some guidance and+[corresponding documentation](https://docs.manim.community/en/stable/reference/manim.utils.ipython_magic.ManimMagic.html) for some guidance and[try it out online](https://mybinder.org/v2/gist/behackl/725d956ec80969226b7bf9b4aef40b78/HEAD?filepath=basic%20example%20scenes.ipynb).## Command line arguments@@ -102,6 +103,49 @@ For a thorough list of command line arguments, visit the [documentation](https:/Documentation is in progress at [ReadTheDocs](https://docs.manim.community/).+## Docker++The community also maintains a docker image (`manimcommunity/manim`), which can be found [on DockerHub](https://hub.docker.com/r/manimcommunity/manim). The following tags are supported:++- `latest` -- the most recent version corresponding to [the master branch](https://github.com/ManimCommunity/manim)+- `stable` -- the latest released version (according to [the releases page](https://github.com/ManimCommunity/manim/releases))+- `vX.Y.Z` -- any particular released version (according to [the releases page](https://github.com/ManimCommunity/manim/releases))++### Instructions for running the docker image++#### Quick Example+To render a scene `CircleToSquare` in a file `test_scenes.py` contained in your current working directory while preserving your user and group ID, use+```+docker run --rm -it --user="$(id -u):$(id -g)" -v "$(pwd)":/manim manimcommunity/manim manim test_scenes.py CircleToSquare -qm+```++#### Running the image in the background+Instead of using the "throwaway container" approach sketched above, you can also create a named container that you can also modify to your liking. First, run+```+docker run -it --name my-manim-container -v "$(pwd):/manim" manimcommunity/manim /bin/bash+```+to obtain an interactive shell inside your container allowing you to, e.g., install further dependencies (like texlive packages using `tlmgr`). Exit the container as soon as you are satisfied. Then, before using it, start the container by running+```+docker start my-manim-container+```+Then, to render a scene `CircleToSquare` in a file `test_scenes.py`, call+```+docker exec -it --user="$(id -u):$(id -g)" my-manim-container manim test.py CircleToSquare -qm+```++#### Jupyterlab+Another alternative is to use the docker image to spin up a local webserver running+JupyterLab in whose Python kernel manim is installed and can be accessed via the `%%manim` cell magic.+To use JupyterLab, run+```+docker run -it -p 8888:8888 manimcommunity/manim jupyter lab --ip=0.0.0.0+```+and then follow the instructions in the terminal.++#### Important notes++When executing `manim` within a Docker container, several command line flags (in particular `-p` (preview file) and `-f` (show output file in the file browser)) are not supported.+## Help with ManimIf you need help installing or using Manim, feel free to reach out to our [Discorddiff --git a/docker/Dockerfile b/docker/Dockerfileindex d3a2814bd..bb3cf4d62 100644--- a/docker/Dockerfile+++ b/docker/Dockerfile@@ -8,6 +8,7 @@ RUN apt-get update -qq \libffi-dev \libpango1.0-dev \pkg-config \+ make \wget# setup a minimal texlive installation@@ -18,16 +19,17 @@ RUN wget -O /tmp/install-tl-unx.tar.gz http://mirror.ctan.org/systems/texlive/tltar -xzf /tmp/install-tl-unx.tar.gz -C /tmp/install-tl --strip-components=1 && \/tmp/install-tl/install-tl --profile=/tmp/texlive-profile.txt \&& tlmgr install \- amsmath babel-english cm-super doublestroke dvisvgm everysel fundus-calligra \- jknapltx latex-bin microtype ms physics preview ragged2e relsize rsfs \- setspace standalone tipa wasy wasysym xcolor xkeyval+ amsmath babel-english cbfonts-fd cm-super ctex doublestroke dvisvgm everysel \+ fontspec frcursive fundus-calligra gnu-freefont jknapltx latex-bin \+ mathastext microtype ms physics preview ragged2e relsize rsfs \+ setspace standalone tipa wasy wasysym xcolor xetex xkeyval# clone and build manimCOPY . /opt/manimWORKDIR /opt/manimRUN pip install --no-cache .[jupyterlab,webgl_renderer]-# required due to current incompatibility from latest jedi version-RUN pip install jedi==0.17.2++RUN pip install -r docs/requirements.txtARG NB_USER=manimuserARG NB_UID=1000diff --git a/docker/readme.md b/docker/readme.mdindex 4931a630b..6cb96cc45 100644--- a/docker/readme.md+++ b/docker/readme.md@@ -1,51 +1,4 @@-# Quick reference-- **Maintained by:** [the Manim Community developers](https://github.com/ManimCommunity/manim)-- **Getting help:** [Manim Documentation](https://docs.manim.community) and [further helpful resources](https://manim.community)--# Supported tags-- `v0.1.1`, `stable`, `latest` -- the latest released version-- `v0.1.0`-- `experimental` -- the most recent version corresponding to [the master branch](https://github.com/ManimCommunity/manim)--# What is Manim?---Manim is a Python library for creating mathematical animations [originally created](https://github.com/3b1b/manim) by Grant "3Blue1Brown" Sanderson. The images in this repository correspond to the [community-maintained version of Manim](https://github.com/ManimCommunity/manim).--To get an impression what Manim can be used for, have a look at our [Example Gallery](https://docs.manim.community/en/stable/examples.html).--# How to use this image-## Quick Example-To render a scene `CircleToSquare` in a file `test_scenes.py` contained in your current working directory while preserving your user and group ID, use-```-$ docker run --rm -it --user="$(id -u):$(id -g)" -v "$(pwd)":/manim manimcommunity/manim manim test_scenes.py CircleToSquare -qm-```--## Running the image in the background-Instead of using the "throwaway container" approach sketched above, you can also create a named container that you can also modify to your liking. First, run-```-$ docker run -it --name my-manim-container -v "$(pwd):/manim" manimcommunity/manim /bin/bash-```-to obtain an interactive shell inside your container allowing you to, e.g., install further dependencies (like texlive packages using `tlmgr`). Exit the container as soon as you are satisfied. Then, before using it, start the container by running-```-$ docker start my-manim-container-```-Then, to render a scene `CircleToSquare` in a file `test_scenes.py`, call-```-$ docker exec -it --user="$(id -u):$(id -g)" my-manim-container manim test.py CircleToSquare -qm-```--## Jupyterlab-Another alternative is to use the docker image to spin up a local webserver running-JupyterLab in whose Python kernel manim is installed and can be accessed via the `%%manim` cell magic.-To use JupyterLab, run-```-$ docker run -it -p 8888:8888 manimcommunity/manim jupyter lab --ip=0.0.0.0-```-and then follow the instructions in the terminal.--# Important notes-When executing `manim` within a Docker container, several command line flags (in particular `-p` (preview file) and `-f` (show output file in the file browser)) are not supported.+See the [main README](https://github.com/ManimCommunity/manim/blob/master/README.md) for some instructions on how to use this image.# Building the imageThe docker image corresponding to the checked out version of the git repository