|
| 1 | +# Sharing your slides |
| 2 | + |
| 3 | +Maybe one of the most important features is the ability to share your |
| 4 | +presentation with other people, or even with yourself but on another computer! |
| 5 | + |
| 6 | +There exists a variety of solutions, and all of them are exposed here. |
| 7 | + |
| 8 | +We will go from the *most restrictive* method, to the least restrictive one. |
| 9 | +If you need to present on a computer without prior knowledge on what will be |
| 10 | +installed on it, please directly refer to the last sections. |
| 11 | + |
| 12 | +> **NOTES:** in the next sections, we will assume your animations are described |
| 13 | +in `example.py`, and you have one presentation called `BasicExample`. |
| 14 | + |
| 15 | +## With Manim Slides installed on the target machine |
| 16 | + |
| 17 | +If Manim Slides, Manim (or ManimGL), and their dependencies are installed, then |
| 18 | +using `manim-slides present` allows for the best presentations, with the most |
| 19 | +options available. |
| 20 | + |
| 21 | +### Sharing your Python file(s) |
| 22 | + |
| 23 | +The lightest way to share your presentation is with the Python files that |
| 24 | +describe the slides. |
| 25 | + |
| 26 | +If you have such files, you can recompile the animations locally, and use |
| 27 | +`manim-slides present` for your presentation. You may want to copy / paste |
| 28 | +you own `.manim-slides.json` config file, but it is **not recommended** if |
| 29 | +you are sharing from one platform (e.g., Linux) to another (e.g., Windows) as |
| 30 | +the key bindings might not be the same. |
| 31 | + |
| 32 | +Example: |
| 33 | + |
| 34 | +```bash |
| 35 | +# If you use ManimGl, replace `manim` with `manimgl` |
| 36 | +manim example.py BasicExample |
| 37 | + |
| 38 | +# This or `manim-slides BasicExample` works since |
| 39 | +# `present` is implied by default |
| 40 | +manim-slides present BasicExample |
| 41 | +``` |
| 42 | + |
| 43 | +### Sharing your animations files |
| 44 | + |
| 45 | +If you do not want to recompile all the animations, you can simply share the |
| 46 | +slides folder (defaults to `./slides`). Then, Manim Slides will be able to read |
| 47 | +the animations from this folder and its subdirectories. |
| 48 | + |
| 49 | +Example: |
| 50 | + |
| 51 | +```bash |
| 52 | +# Make sure that the slides directory is in the current |
| 53 | +# working directory, or specify with `--folder <FOLDER>` |
| 54 | +manim-slides present BasicExample |
| 55 | +``` |
| 56 | + |
| 57 | +and the corresponding tree: |
| 58 | + |
| 59 | +``` |
| 60 | +. |
| 61 | +└── slides |
| 62 | + ├── BasicExample.json |
| 63 | + └── files |
| 64 | + └── BasicExample (files not shown) |
| 65 | +``` |
| 66 | + |
| 67 | +## Without Manim Slides installed on the target machine |
| 68 | + |
| 69 | +An alternative to `manim-slides present` is `manim-slides convert`. |
| 70 | +Currently, only HTML conversion is available, but do not hesitate to propose |
| 71 | +other formats by creating a |
| 72 | +[Feature Request](https://github.com/jeertmans/manim-slides/issues/new/choose), |
| 73 | +or directly proposing a |
| 74 | +[Pull Request](https://github.com/jeertmans/manim-slides/compare). |
| 75 | + |
| 76 | +A major advantage of HTML files is that they can be opened cross-platform, |
| 77 | +granted one has a modern web browser (which is pretty standard). |
| 78 | + |
| 79 | +### Sharing HTML and animation files |
| 80 | + |
| 81 | +First, you need to create the HTML file and its assets directory. |
| 82 | + |
| 83 | +Example: |
| 84 | + |
| 85 | +```bash |
| 86 | +manim-slides convert BasicExample basic_example.html |
| 87 | +``` |
| 88 | + |
| 89 | +Then, you need to copy the HTML files and its assets directory to target location, |
| 90 | +while keeping the relative path between the HTML and the assets the same. The |
| 91 | +easiest solution is to compress both the file and the directory into one ZIP, |
| 92 | +and to extract it to the desired location. |
| 93 | + |
| 94 | +By default, the assets directory will be named after the main HTML file, using `{basename}_assets`. |
| 95 | + |
| 96 | +Example: |
| 97 | + |
| 98 | +``` |
| 99 | +. |
| 100 | +├── basic_example_assets |
| 101 | +│ ├── 1413466013_2261824125_223132457.mp4 |
| 102 | +│ ├── 1672018281_2145352439_3942561600.mp4 |
| 103 | +│ └── 1672018281_3136302242_2191168284.mp4 |
| 104 | +└── basic_example.html |
| 105 | +``` |
| 106 | + |
| 107 | +Then, you can simply open the HTML file with any web browser application. |
| 108 | + |
| 109 | +### Sharing ONE HTML file |
| 110 | + |
| 111 | +A future feature, that will be available once |
| 112 | +[#122](https://github.com/jeertmans/manim-slides/issues/122) is solved, will be |
| 113 | +to include all animations as data URI encoded, within the HTML file itself. |
| 114 | + |
| 115 | +### Over the internet |
| 116 | + |
| 117 | +Finally, HTML conversion makes it convenient to play your presentation on a |
| 118 | +remote server. |
| 119 | + |
| 120 | +This is how your are able to watch all the examples on this website. If you want |
| 121 | +to know how to share your slide with GitHub pages, see the |
| 122 | +[workflow file](https://github.com/jeertmans/manim-slides/blob/main/.github/workflows/pages.yml). |
| 123 | + |
| 124 | +> **WARNING:** keep in minde that playing large video files over the internet |
| 125 | +can take some time, and *glitches* may occur between slide transitions for this |
| 126 | +reason. |
0 commit comments