Skip to content

Commit 4cd433b

Browse files
authored
chore(docs): document sharing slides (#134)
* chore(docs): remove deprecated "last animation" mention * chore(docs): document sharing slides
1 parent e83df48 commit 4cd433b

File tree

4 files changed

+130
-3
lines changed

4 files changed

+130
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
Tool for live presentations using either [Manim (community edition)](https://www.manim.community/) or [ManimGL](https://3b1b.github.io/manim/). Manim Slides will *automatically* detect the one you are using!
99

10-
> **_NOTE:_** This project extends the work of [`manim-presentation`](https://github.com/galatolofederico/manim-presentation), with a lot more features!
10+
> **NOTE:** this project extends the work of [`manim-presentation`](https://github.com/galatolofederico/manim-presentation), with a lot more features!
1111
1212
- [Installation](#installation)
1313
* [Dependencies](#dependencies)

docs/source/reference/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ Automatically generated reference for Manim Slides.
88
api
99
cli
1010
examples
11+
sharing
1112
```
1213

1314
[Application Programming Interface](./api): list of classes and methods that may be useful to the end-user.
1415

1516
[Command Line Interface](./cli): list of all commands available using Manim Slides' executable.
1617

1718
[Examples](./examples): curated list of examples and their output.
19+
20+
[Sharing](./sharing): how to share your presentation with others.

docs/source/reference/sharing.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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.

example.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ def construct(self):
300300
self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
301301
self.end_loop()
302302

303-
# Each slide MUST end with an animation (a self.wait is considered an animation)
304303
self.play(dot.animate.move_to(ORIGIN))
305304

306305
# [manim-3d]
@@ -349,7 +348,6 @@ def construct(self):
349348
self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
350349
self.end_loop()
351350

352-
# Each slide MUST end with an animation (a self.wait is considered an animation)
353351
self.play(dot.animate.move_to(ORIGIN))
354352

355353
# [manimgl-3d]

0 commit comments

Comments
 (0)