Skip to content

Commit 48747a7

Browse files
Refactored structure of documentation; added :doc:FAQ section <faq/index> (#2732)
* move tutorials -> tutorials_guide * change title in tutorials_guides * rename: a_deeper_look -> output_and_config * splitting Tutorials * reorder index (sidebar), move some top level sections elsewhere * rename some tutorials * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * replace recommonmark with rest for rendering md files * fixed broken references * fixed **all** warnings and errors during docbuild * faq: help, more structure for landing page * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix deprecation tests * prepare some sort of skeleton for installation faq * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * ensure that pip from poetry venv is used in pipeline * added myst-parser as dev dependency * remove fixed sphinx version from requirement.txt, don't re-install dependencies * move and improve versions and troubleshooting content to FAQ * resolve broken references * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * help blacken-docs * new: navigating the docs * make different versions question more prominent * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed order of tutorials * added explicit references to building blocks and quickstart tutorial * docs -> doc * change a page-reference to a paragraph-reference * pypi manimlib, split answer regarding chocolatey failing * added a note on #beginner-resources Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 4129505 commit 48747a7

38 files changed

+765
-467
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
5858
- name: Run doctests in rst files
5959
run: |
60-
cd docs && pip install -r requirements.txt && poetry run make doctest O=-tskip-manim
60+
cd docs && poetry run make doctest O=-tskip-manim
6161
6262
6363
test:

docs/i18n/readyForTranslation

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ examples.po
99
reference.po
1010
tutorials.po
1111
tutorials/building_blocks.po
12-
tutorials/a_deeper_look.po
12+
tutorials/output_and_config.po
1313
tutorials/quickstart.po
1414
tutorials/configuration.po

docs/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
sphinx==4.1.2
21
furo
3-
recommonmark>=0.5.0
2+
myst-parser
3+
sphinx
44
sphinx-copybutton
55
sphinxext-opengraph

docs/source/changelog/0.14.0-changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Documentation-related changes
111111
* :pr:`2415`: Removed instructions on using and installing Docker in README
112112

113113

114-
* :pr:`2414`: Made improvements to the :doc:`configuration` tutorial
114+
* :pr:`2414`: Made improvements to the :doc:`/guides/configuration` tutorial
115115

116116

117117
* :pr:`2423`: Changed recommendation to ``mactex-no-gui`` from ``mactex`` for macOS install

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
# ones.
3636
extensions = [
3737
"sphinx.ext.autodoc",
38-
"recommonmark",
3938
"sphinx_copybutton",
4039
"sphinx.ext.napoleon",
4140
"sphinx.ext.autosummary",
@@ -47,6 +46,7 @@
4746
"sphinx.ext.graphviz",
4847
"sphinx.ext.inheritance_diagram",
4948
"sphinxcontrib.programoutput",
49+
"myst_parser",
5050
]
5151

5252
# Automatically generate stub pages when using the .. autosummary directive

docs/source/contributing/development.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,6 @@ Develop your contribution
154154
Use the :mod:`manim directive for Sphinx <manim.utils.docbuild.manim_directive>` to add examples
155155
to the documentation!
156156

157-
.. autosummary::
158-
:toctree: ../reference
159-
160-
manim.utils.docbuild.manim_directive
161-
162157
As far as development on your local machine goes, these are the main steps you
163158
should follow.
164159

@@ -282,7 +277,7 @@ Further useful guidelines
282277

283278

284279
You can find examples for the ``docs`` in several places:
285-
the :doc:`Example Gallery <../examples>`, :doc:`Tutorials <../tutorials>`,
280+
the :doc:`Example Gallery <../examples>`, :doc:`Tutorials <../tutorials/index>`,
286281
and :doc:`Reference Classes <../reference>`.
287282

288283
In case you are contributing, please have a look at this flowchart:

docs/source/faq/general.md

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# FAQ: General Usage
2+
3+
## Why does Manim say that "there are no scenes inside that module"?
4+
5+
There are two main reasons why this error appears: if you have edited
6+
the file containing your `Scene` class and forgot to save it, or if you
7+
have accidentally passed the name of a wrong file to `manim`, this is
8+
a likely outcome. Check that you have spelled everything correctly.
9+
10+
Otherwise you are likely mixing up Manim versions. See {ref}`this FAQ answer <different-versions>`
11+
for an explanation regarding why there are different versions. Under the assumption
12+
that you are trying to use the `manim` executable from the terminal to run
13+
a scene that has been written for the community version (i.e., there is
14+
`from manim import *`, or more specifically `from manim import Scene`)
15+
16+
---
17+
18+
## No matter what code I put in my file, Manim only renders a black frame! Why?
19+
20+
If you are using the usual pattern to write a `Scene`, i.e.,
21+
```python
22+
class MyAwesomeScene(Scene):
23+
def construct(self):
24+
...
25+
# your animation code
26+
```
27+
then double check whether you have spelled `construct` correctly.
28+
If the method containing your code is not called `construct` (or
29+
if you are not calling a different, custom method from `construct`),
30+
Manim will not call your method and simply output a black frame.
31+
32+
---
33+
34+
## I have watched a video where a creator ran command X, but it does not work for me. Why?
35+
36+
The video you have been watching is likely outdated. If you want to follow
37+
along, you either need to use the same version used in the video, or
38+
modify the code (in many cases it is just a method having been renamed etc.)
39+
accordingly. Check the video description, in some cases creators point out
40+
whether changes need to be applied to the code shown in the video.
41+
42+
---
43+
44+
## When using `Tex` or `MathTex`, some letters are missing. How can I fix this?
45+
46+
It is possible that you have to (re)build some fonts used by LaTeX. For
47+
some distributions, you can do this manually by running
48+
```bash
49+
fmtutil -sys --all
50+
```
51+
We recommend consulting the documentation of your LaTeX distribution
52+
for more information.
53+
54+
---
55+
56+
## I want to translate some code from `manimgl` to `manim`, what do I do with `CONFIG` dictionaries?
57+
58+
The community maintained version has dropped the use of `CONFIG` dictionaries very
59+
early, with {doc}`version v0.2.0 </changelog/0.2.0-changelog>` released in
60+
January 2021.
61+
62+
Before that, Manim's classes basically processed `CONFIG` dictionaries
63+
by mimicking inheritance (to properly process `CONFIG` dictionaries set
64+
by parent classes) and then assigning all of the key-value-pairs in the
65+
dictionary as attributes of the corresponding object.
66+
67+
In situations where there is not much inheritance going on,
68+
or for any custom setting, you should set these attributes yourself.
69+
For example, for an old-style `Scene` with custom attributes like
70+
71+
```python
72+
class OldStyle(Scene):
73+
CONFIG = {"a": 1, "b": 2}
74+
```
75+
76+
should be written as
77+
78+
```python
79+
class NewStyle(Scene):
80+
a = 1
81+
b = 2
82+
```
83+
84+
In situations where values should be properly inherited, the arguments
85+
should be added to the initialization function of the class. An old-style
86+
mobject `Thing` could look like
87+
88+
```python
89+
class Thing(VMobject):
90+
CONFIG = {
91+
"stroke_color": RED,
92+
"fill_opacity": 0.7,
93+
"my_awesome_argument": 42,
94+
}
95+
```
96+
97+
where `stroke_color` and `fill_opacity` are arguments that concern the
98+
parent class of `Thing`, and `my_awesome_argument` is a custom argument
99+
that only concerns `Thing`. A version without `CONFIG` could look like this:
100+
101+
```python
102+
class Thing(VMobject):
103+
def __init__(
104+
self, stroke_color=RED, fill_opacity=0.7, my_awesome_argument=42, **kwargs
105+
):
106+
self.my_awesome_argument = my_awesome_argument
107+
super().__init__(stroke_color=stroke_color, fill_opacity=fill_opacity, **kwargs)
108+
```
109+
110+
---
111+
112+
## My installation does not support converting PDF to SVG, help?
113+
114+
This is an issue with `dvisvgm`, the tool shipped with LaTeX that
115+
transforms LaTeX output to a `.svg` file that
116+
Manim can parse.
117+
118+
First, make sure your ``dvisvgm`` version is at least 2.4 by
119+
checking the output of
120+
121+
```bash
122+
dvisvgm --version
123+
```
124+
125+
If you do not know how to update `dvisvgm`, please refer to your
126+
LaTeX distributions documentation (or the documentation of your
127+
operating system, if `dvisvgm` was installed as a system package).
128+
129+
Second, check whether your ``dvisvgm`` supports PostScript specials. This is
130+
needed to convert from PDF to SVG. Run:
131+
132+
```bash
133+
dvisvgm -l
134+
```
135+
136+
If the output to this command does **not** contain `ps dvips PostScript specials`,
137+
this is a bad sign. In this case, run
138+
139+
```bash
140+
dvisvgm -h
141+
```
142+
143+
If the output does **not** contain `--libgs=filename`, this means your
144+
`dvisvgm` does not currently support PostScript. You must get another binary.
145+
146+
If, however, `--libgs=filename` appears in the help, that means that your
147+
`dvisvgm` needs the Ghostscript library to support PostScript. Search for
148+
`libgs.so` (on Linux, probably in `/usr/local/lib` or `/usr/lib`) or
149+
`gsdll32.dll` (on 32-bit Windows, probably in `C:\windows\system32`) or
150+
`gsdll64.dll` (on 64-bit Windows, also probably in `C:\windows\system32`)
151+
or `libgsl.dylib` (on MacOS, probably in `/usr/local/lib` or
152+
`/opt/local/lib`). Please look carefully, as the file might be located
153+
elsewhere, e.g. in the directory where Ghostscript is installed.
154+
155+
When you have found the library, try (on MacOS or Linux)
156+
157+
```bash
158+
export LIBGS=<path to your library including the file name>
159+
dvisvgm -l
160+
```
161+
162+
or (on Windows)
163+
164+
```bat
165+
set LIBGS=<path to your library including the file name>
166+
dvisvgm -l
167+
```
168+
169+
You should now see `ps dvips PostScript specials` in the output. Refer to
170+
your operating system's documentation to find out how you can set or export the
171+
environment variable ``LIBGS`` automatically whenever you open a shell.
172+
173+
As a last check, you can run
174+
175+
```bash
176+
dvisvgm -V1
177+
```
178+
179+
(while still having `LIBGS` set to the correct path, of course.) If `dvisvgm`
180+
can find your Ghostscript installation, it will be shown in the output together
181+
with the version number.
182+
183+
If you do not have the necessary library on your system, please refer to your
184+
operating system's documentation to find out where you can get it and how you
185+
have to install it.
186+
187+
If you are unable to solve your problem, check out the
188+
[dvisvgm FAQ](https://dvisvgm.de/FAQ/).
189+
190+
---
191+
192+
## Where can I find more resources for learning Manim?
193+
194+
In our [Discord server](https://manim.community/discord), we have the community maintained
195+
`#beginner-resources` channel in which links to helpful learning resources are collected.
196+
You are welcome to join our Discord and take a look yourself! If you have found some
197+
guides or tutorials yourself that are not on our list yet, feel free to add them!

docs/source/faq/help.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# FAQ: Getting Help
2+
3+
## How do I animate X? Why do I get error Y? Can someone help me?
4+
5+
Before asking the community, please make sure that the issue you are having
6+
is not already discussed in our {doc}`FAQ section </faq/index>` sufficiently
7+
well so that you can resolve the problem yourself. You can also try to
8+
use your favorite search engine, if you are lucky you might find a blog post,
9+
a question on [StackOverflow](https://stackoverflow.com/questions/tagged/manim),
10+
or a post in the [r/manim subreddit](https://reddit.com/r/manim).
11+
12+
If this is not the case, please take a moment to properly prepare your question:
13+
the better you manage to explain what exactly it is you are struggling with,
14+
the more efficient people will be able to help you. Regardless of the platform
15+
you choose in the next step, StackOverflow has a good guide on
16+
[asking good questions](https://stackoverflow.com/help/how-to-ask).
17+
18+
As soon as you have a good idea of what exactly you want to ask, pick one of the
19+
following communication channels:
20+
21+
- The community is most active [in our Discord server](https://manim.community/discord/).
22+
Click the link to join, then pick one of the `#manim-help` channels in the sidebar,
23+
and post your question there. If you are comfortable with using Discord, try to search
24+
for your problem using the search function of our server; perhaps people have been
25+
talking about it before!
26+
- We are also monitoring questions on
27+
[StackOverflow](https://stackoverflow.com/questions/tagged/manim) that are tagged
28+
with `manim`.
29+
- Many people are also active in our [r/manim subreddit](https://reddit.com/r/manim),
30+
feel free to post there if you are an avid Redditor -- but be aware that Discord
31+
or StackOverflow might be better choices.
32+
- And finally, you can also start a new [discussion on GitHub](https://github.com/ManimCommunity/manim/discussions)
33+
if you dislike all other options.
34+
35+
In all of these channels, please make sure to abide by Manim's
36+
{doc}`Code of Conduct </conduct>` -- in short, be *excellent* to one another:
37+
be friendly and patient, considerate, and respectful.
38+
39+
---
40+
41+
## What should I do if nobody answers my question?
42+
43+
Try and see whether your question can be improved: did you include all relevant
44+
information (in case of errors: the full stack trace, the code that you were
45+
rendering, and the command you used to run Manim?). In case you used a very long
46+
example, is it possible to construct a more minimal version that has the same
47+
(faulty) behavior?
48+
49+
If you posted in one of our help channels on Discord and your question got buried,
50+
you are allowed to ping the `@Manim Helper` role to bring it to the attention of
51+
the volunteers who are willing to take a look. Please refrain from pinging the role
52+
immediately when asking your question for the first time, this is considered impolite.
53+
54+
You can also try to post your question to a different channel if you feel that you
55+
are not having any success with your initial choice -- but please do not spam your
56+
question in all of our communication channels (and in particular for Discord:
57+
please don't use multiple help channels at once).
58+
59+
In the end, it is as for most open-source projects: our community members are
60+
volunteers. If you do not receive a quick answer to your question, it may be
61+
because nobody knows the answer, or because your question is not clear enough,
62+
or it could be that everyone who can help you with your problem is busy doing
63+
other things.
64+
65+
---
66+
67+
## The library does not behave as documented, or something broke in a new release. What should I do?
68+
69+
Sounds like you have found a bug. One of the best ways of contributing to the
70+
development of Manim is by reporting it!
71+
72+
Check our list of known issues and feature requests
73+
[in our GitHub repository](https://github.com/ManimCommunity/manim/issues). If the
74+
problem you have found is not listed there yet (use the search function; also check
75+
whether there is a corresponding closed issue, it is possible that your problem
76+
has already been resolved and will be fixed with the next release), please consider
77+
the following steps to submit a new issue.
78+
79+
```{note}
80+
If you are unsure whether or not you should file a new issue for some odd behavior
81+
that you found, feel free to ask the community developers, preferably in one of
82+
our `#manim-dev` channels in [our Discord](https://manim.community/discord/).
83+
```
84+
85+
1. Make sure you are running the latest released version of Manim, your problem
86+
might otherwise already be fixed in a more recent version. Check the
87+
{doc}`/changelog` for a full list of changes between Manim releases.
88+
89+
2. Choose the correct category for your report when
90+
[creating a new issue](https://github.com/ManimCommunity/manim/issues/new/choose).
91+
We have dedicated issue templates for *bug reports*, *feature requests*,
92+
*installation issues*, and *suggestions*. If your report falls into one of these
93+
categories, read the issue template carefully! Instructions are given in the
94+
`<!-- ... -->` sections of the text field.
95+
96+
3. For bug reports: prepare a minimal example that can be used to illustrate the
97+
issue. Examples with hundreds of lines are very inefficient and tedious to debug.
98+
Your problem needs to be reproducible for others, so please make sure to prepare
99+
a suitable example.
100+
101+
4. This is mentioned in the bug report template as well, but it is very important:
102+
if you report that some code raises an error, make sure to include the full
103+
terminal output, from the command you used to run the library up to and including
104+
the last line with the error message. Read carefully: if the message mentions
105+
that there is another relevant log file, include this other file as well!

docs/source/faq/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Frequently Asked Questions
2+
==========================
3+
4+
.. toctree::
5+
:caption: Table of Contents
6+
:maxdepth: 2
7+
:glob:
8+
9+
*

0 commit comments

Comments
 (0)