Skip to content

Commit 8696fca

Browse files
chore(README): upgrade documentation in README (#13)
* chore(README): upgrade in the README documentation * chore(README): upgrade in the README documentation * fix(README): typo in emoji * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix(README): typo in emoji (bis) * fix: toc link * fix: few typos found by LT Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2856aeb commit 8696fca

File tree

2 files changed

+121
-73
lines changed

2 files changed

+121
-73
lines changed

.github/workflows/languagetool.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on:
2+
pull_request:
3+
workflow_dispatch:
4+
5+
name: LanguageTool check
6+
7+
jobs:
8+
languagetool_check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- uses: reviewdog/action-languagetool@v1
13+
with:
14+
reporter: github-pr-review
15+
level: warning

README.md

Lines changed: 106 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,66 @@
55
![PyPI - Downloads](https://img.shields.io/pypi/dm/manim-slides)
66
# Manim Slides
77

8-
Tool for live presentations using either [manim-community](https://www.manim.community/) or [manimgl](https://3b1b.github.io/manim/). `manim-slides` will automatically detect the one you are using!
8+
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

1010
> **_NOTE:_** This project extends the work of [`manim-presentation`](https://github.com/galatolofederico/manim-presentation), with a lot more features!
1111
12-
## Install
12+
- [Install](#install)
13+
* [Dependencies](#dependencies)
14+
* [Pip install](#pip-install)
15+
* [Install From Repository](#install-from-repository)
16+
- [Usage](#usage)
17+
* [Basic Example](#basic-example)
18+
* [Key Bindings](#key-bindings)
19+
* [Other Examples](#other-examples)
20+
- [Features and Comparison with Original manim-presentation](#features-and-comparison-with-original-manim-presentation)
21+
- [Contributing](#contributing)
1322

14-
```
23+
## Installation
24+
25+
While installing Manim Slides and its dependencies on your global Python is fine, I recommend using a [virtualenv](https://docs.python.org/3/tutorial/venv.html) for a local installation.
26+
27+
### Dependencies
28+
29+
Manim Slides requires either Manim or ManimGL to be installed. Having both packages installed is fine too.
30+
31+
If none of those packages are installed, please refer to their specifc installation guidelines:
32+
- [Manim](https://docs.manim.community/en/stable/installation.html)
33+
- [ManimGL](https://3b1b.github.io/manim/getting_started/installation.html)
34+
35+
### Pip Install
36+
37+
The recommended way to install the latest release is to use pip:
38+
39+
```bash
1540
pip install manim-slides
1641
```
1742

18-
## Usage
43+
### Install From Repository
1944

20-
Use the class `Slide` as your scenes base class:
21-
```python
22-
from manim_slides import Slide
45+
An alternative way to install Manim Slides is to clone the git repository, and install from there:
2346

24-
class Example(Slide):
25-
def construct(self):
26-
...
47+
```bash
48+
git clone https://github.com/jeertmans/manim-slides
49+
pip install -e .
2750
```
2851

29-
call `self.pause()` when you want to pause the playback and wait for an input to continue (check the keybindings).
52+
> *Note:* the `-e` flag allows you to edit the files, and observe the changes directly when using Manim Slides
53+
54+
## Usage
55+
56+
Using Manim Slides is a two-step process:
57+
1. Render animations using `Slide` (resp. `ThreeDSlide`) as a base class instead of `Scene` (resp. `ThreeDScene`), and add calls to `self.pause()` everytime you want to create a new slide.
58+
2. Run `manim-slides` on rendered animations and display them like a *Power Point* presentation.
59+
60+
### Basic Example
61+
3062

3163
Wrap a series of animations between `self.start_loop()` and `self.stop_loop()` when you want to loop them (until input to continue):
64+
3265
```python
66+
# example.py
67+
3368
from manim import *
3469
# or: from manimlib import *
3570
from manim_slides import Slide
@@ -40,105 +75,103 @@ class Example(Slide):
4075
dot = Dot()
4176

4277
self.play(GrowFromCenter(circle))
43-
self.pause()
78+
self.pause() # Waits user to press continue to go to the next slide
4479

45-
self.start_loop()
80+
self.start_loop() # Start loop
4681
self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
47-
self.end_loop()
82+
self.end_loop() # This will loop until user inputs a key
4883

4984
self.play(dot.animate.move_to(ORIGIN))
50-
self.pause()
85+
self.pause() # Waits user to press continue to go to the next slide
5186

52-
self.wait()
87+
self.wait() # The presentation directly exits after last animation
5388
```
5489

55-
You **must** end your `Slide` with a `self.play(...)` or a `self.wait(..)`.
90+
You **must** end your `Slide` with a `self.play(...)` or a `self.wait(...)`.
5691

57-
To start the presentation using `Scene1`, `Scene2` and so on simply run:
92+
First, render the animation files:
93+
94+
```bash
95+
manim example.py
96+
# or
97+
manimgl example.py
5898
```
59-
manim-slides Scene1 Scene2...
99+
100+
To start the presentation using `Scene1`, `Scene2` and so on simply run:
101+
102+
```bash
103+
manim-slides [OPTIONS] Scene1 Scene2...
60104
```
61105

62-
## Keybindings
106+
Or in this example:
107+
108+
```bash
109+
manim-slides Example
110+
```
63111

64-
Default keybindings to control the presentation:
112+
## Key Bindings
65113

66-
| Keybinding | Action |
67-
|:-----------:|:------------------------:|
68-
| Right Arrow | Continue/Next Slide |
69-
| Left Arrow | Previous Slide |
70-
| R | Re-Animate Current Slide |
71-
| V | Reverse Current Slide |
72-
| Spacebar | Play/Pause |
73-
| Q | Quit |
114+
The default key bindings to control the presentation are:
74115

116+
| Keybinding | Action | Icon |
117+
|:-----------:|:------------------------:|:----:|
118+
| Right Arrow | Continue/Next Slide | <svg height="25px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4l192 160L256 241V96c0-17.7 14.3-32 32-32s32 14.3 32 32V416c0 17.7-14.3 32-32 32s-32-14.3-32-32V271l-11.5 9.6-192 160z"/></svg> |
119+
| Left Arrow | Previous Slide | <svg height="25px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M267.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160L64 241V96c0-17.7-14.3-32-32-32S0 78.3 0 96V416c0 17.7 14.3 32 32 32s32-14.3 32-32V271l11.5 9.6 192 160z"/></svg> |
120+
| R | Replay Current Slide | <svg height="25px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M48.5 224H40c-13.3 0-24-10.7-24-24V72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8H48.5z"/></svg> |
121+
| V | Reverse Current Slide | <svg height="25px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3V256v41.7L459.5 440.6zM256 352V256 128 96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V352z"/></svg> |
122+
| Spacebar | Play/Pause | <svg height="25px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80V432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"/></svg> <svg height="25px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M48 64C21.5 64 0 85.5 0 112V400c0 26.5 21.5 48 48 48H80c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48H48zm192 0c-26.5 0-48 21.5-48 48V400c0 26.5 21.5 48 48 48h32c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48H240z"/></svg> |
123+
| Q | Quit | <svg height="25px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z"/></svg> |
75124

76-
You can run the **configuration wizard** with:
125+
You can run the **configuration wizard** to change those key bindings:
77126

78-
```
127+
```bash
79128
manim-slides wizard
80129
```
81130

82-
Alternatively you can specify different keybindings creating a file named `.manim-slides.json` with the keys: `QUIT` `CONTINUE` `BACK` `REVERSE` `REWIND` and `PLAY_PAUSE`.
131+
Alternatively you can specify different key bindings creating a file named `.manim-slides.json` with the keys: `QUIT` `CONTINUE` `BACK` `REVERSE` `REWIND` and `PLAY_PAUSE`.
83132

84133
A default file can be created with:
85-
```
134+
135+
```bash
86136
manim-slides init
87137
```
88138

89139
> **_NOTE:_** `manim-slides` uses `cv2.waitKeyEx()` to wait for keypresses, and directly registers the key code.
90140
91-
## Run Example
141+
## Other Examples
92142

93-
Clone this repository:
94-
```
95-
git clone https://github.com/jeertmans/manim-slides.git
96-
cd manim-slides
97-
```
98-
99-
Install `manim` and `manim-slides`:
100-
```
101-
pip install manim manim-slides
102-
# or
103-
pip install manimgl manim-slides
104-
```
105-
106-
Render the example scene:
107-
```
108-
manim -qh example.py Example
109-
# or
110-
manimgl --hd example.py Example
111-
```
112-
113-
Run the presentation
114-
```
115-
manim-slides Example
116-
```
143+
Other examples are available in the `example.py` file, if you downloaded the git repository.
117144

118145
Below is a small recording of me playing with the slides back and forth.
119146

120147
![](https://raw.githubusercontent.com/jeertmans/manim-slides/main/static/example.gif)
121148

122149

123-
## Comparison with original `manim-presentation`
150+
## Features and Comparison with original manim-presentation
151+
152+
Below is a non-exhaustive list of features:
124153

125-
Here are a few things that I implemented (or that I'm planning to implement) on top of the original work:
154+
| Feature | `manim-slides` | `manim-presentation` |
155+
|:--------|:--------------:|:--------------------:|
156+
| Support for Manim | :heavy_check_mark: | :heavy_check_mark: |
157+
| Support for ManimGL | :heavy_check_mark: | :heavy_multiplication_x: |
158+
| Configurable key bindings | :heavy_check_mark: | :heavy_check_mark: |
159+
| Configurable paths | :heavy_check_mark: | :heavy_multiplication_x: |
160+
| Play / Pause slides | :heavy_check_mark: | :heavy_check_mark: |
161+
| Next / Previous slide | :heavy_check_mark: | :heavy_check_mark: |
162+
| Replay slide | :heavy_check_mark: | :heavy_check_mark: |
163+
| Reverse slide | :heavy_check_mark: | :heavy_multiplication_x: |
164+
| Multiple key per actions | :heavy_check_mark: | :heavy_multiplication_x: |
165+
| One command line tool | :heavy_check_mark: | :heavy_multiplication_x: |
166+
| Robust config file parsing | :heavy_check_mark: | :heavy_multiplication_x: |
167+
| Support for 3D Scenes | :heavy_check_mark: | :heavy_multiplication_x: |
168+
| Documented code | WIP | :heavy_multiplication_x: |
169+
| Tested on Unix, macOS, and Windows | :heavy_check_mark: | :heavy_multiplication_x: |
126170

127-
- [x] Allowing multiple keys to control one action (useful when you use a laser pointer)
128-
- [x] More robust config files checking
129-
- [x] Dependencies are installed with the package
130-
- [x] Only one cli (to rule them all)
131-
- [x] User can easily generate dummy config file
132-
- [x] Config file path can be manually set
133-
- [x] Play animation in reverse [#9](https://github.com/galatolofederico/manim-presentation/issues/9)
134-
- [x] Handle 3D scenes out of the box
135-
- [x] Support for both `manim` and `manimgl` modules
136-
- [ ] Generate docs online
137-
- [x] Fix the quality problem on Windows platforms with `fullscreen` flag
138171

139-
## Contributions and license
172+
## Contributing
140173

141-
The code is released as Free Software under the [GNU/GPLv3](https://choosealicense.com/licenses/gpl-3.0/) license. Copying, adapting and republishing it is not only consent but also encouraged.
174+
Contributions are more than welcome!
142175

143176
[pypi-version-badge]: https://img.shields.io/pypi/v/manim-slides?label=manim-slides
144177
[pypi-version-url]: https://pypi.org/project/manim-slides/

0 commit comments

Comments
 (0)