History

Copyedited Documentation (#2640)

* Copyedited Documentation Changelog / Overview Reviewed tutorials\configurations.rst. Edited simple mistakes such as Manim not being capitalized and commas. Motivation and Explanation: Why and how do your changes improve the library? My motivation was to start getting involved in the open source community. This improves the library as it increases readability and professionalism. Links to added or changed documentation pages Further Information and Comments Closes #1401 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Apply suggestions from code review Co-authored-by: Darylgolden <darylgolden@gmail.com> Co-authored-by: Luca <30503695+tameTNT@users.noreply.github.com>

Bailey Powers committed 4 years ago

Commit 3413ca21 parent b6311091 file · +24 −24Browse files

Showing the changes to docs/source/tutorials (1 of 1 file). Show all

Unified · Split

docs/source/tutorials/configuration.rst+24−24
@@ -8,7 +8,7 @@ can be configured programmatically via `the ManimConfig class`_, at the time · 7 unmodified lines
8of command invocation via `command-line arguments`_, or at the time the library8of command invocation via `command-line arguments`_, or at the time the library
9is first imported via `the config files`_.9is first imported via `the config files`_.
10 10
11The most common, simplest and recommended way to set the configure Manim is11The most common, simplest, and recommended way to configure Manim is
12via the command-line interface (CLI), which is described directly below.12via the command-line interface (CLI), which is described directly below.
13 13
14Command-line arguments14Command-line arguments
@@ -21,7 +21,7 @@ It is used with the following arguments: · 6 unmodified lines
21.. program-output:: manim render --help21.. program-output:: manim render --help
22 :ellipsis: 922 :ellipsis: 9
23 23
24However, since manim defaults to the :code:`render` command whenever no command24However, since Manim defaults to the :code:`render` command whenever no command
25is specified, the following form is far more common and can be used instead:25is specified, the following form is far more common and can be used instead:
26 26
27.. code-block:: bash27.. code-block:: bash
@@ -34,7 +34,7 @@ An example of using the above form is: · 6 unmodified lines
34 34
35 manim -qm file.py SceneOne35 manim -qm file.py SceneOne
36 36
37This asks manim to search for a Scene class called :code:`SceneOne` inside the37This asks Manim to search for a Scene class called :code:`SceneOne` inside the
38file ``file.py`` and render it with medium quality (specified by the ``-qm`` flag).38file ``file.py`` and render it with medium quality (specified by the ``-qm`` flag).
39 39
40Another frequently used flag is ``-p`` ("preview"), which makes manim40Another frequently used flag is ``-p`` ("preview"), which makes manim
@@ -74,7 +74,7 @@ A list of all CLI flags · 33 unmodified lines
74The ManimConfig class74The ManimConfig class
75*********************75*********************
76 76
77The most direct way of configuring manim is through the global ``config`` object,77The most direct way of configuring Manim is through the global ``config`` object,
78which is an instance of :class:`.ManimConfig`. Each property of this class is78which is an instance of :class:`.ManimConfig`. Each property of this class is
79a config option that can be accessed either with standard attribute syntax or79a config option that can be accessed either with standard attribute syntax or
80with dict-like syntax:80with dict-like syntax:
@@ -139,22 +139,22 @@ rendered in our documentation with a reference frame. · 58 unmodified lines
139The config files139The config files
140****************140****************
141 141
142As the last example shows, executing manim from the command-line may involve142As the last example shows, executing Manim from the command line may involve
143using many flags at the same time. This may become a nuisance if you must143using many flags simultaneously. This may become a nuisance if you must
144execute the same script many times in a short time period, for example when144execute the same script many times in a short time period, for example, when
145making small incremental tweaks to your scene script. For this reason, manim145making small incremental tweaks to your scene script. For this reason, Manim
146can also be configured using a configuration file. A configuration file is a146can also be configured using a configuration file. A configuration file is a
147file ending with the suffix ``.cfg``.147file ending with the suffix ``.cfg``.
148 148
149To use a local configuration file when rendering your scene, you must create a149To use a local configuration file when rendering your scene, you must create a
150file with name ``manim.cfg`` in the same directory as your scene code.150file with the name ``manim.cfg`` in the same directory as your scene code.
151 151
152.. warning:: The config file **must** be named ``manim.cfg``. Currently, manim152.. warning:: The config file **must** be named ``manim.cfg``. Currently, Manim
153 does not support config files with any other name.153 does not support config files with any other name.
154 154
155The config file must start with the section header ``[CLI]``. The155The config file must start with the section header ``[CLI]``. The
156configuration options under this header have the same name as the CLI flags,156configuration options under this header have the same name as the CLI flags
157and serve the same purpose. Take for example the following config file.157and serve the same purpose. Take, for example, the following config file.
158 158
159.. code-block:: ini159.. code-block:: ini
160 160
@@ -188,8 +188,8 @@ is in the same directory as <file.py>, · 27 unmodified lines
188 188
189Since config files are meant to replace CLI flags, all CLI flags can be set via189Since config files are meant to replace CLI flags, all CLI flags can be set via
190a config file. Moreover, any config option can be set via a config file,190a config file. Moreover, any config option can be set via a config file,
191whether or not it has an associated CLI flag. For a list of all CLI flags and191whether or not it has an associated CLI flag. See the bottom of this document
192all config options, see the bottom of this document.192for a list of all CLI flags and config options.
193 193
194Manim will look for a ``manim.cfg`` config file in the same directory as the194Manim will look for a ``manim.cfg`` config file in the same directory as the
195file being rendered, and **not** in the directory of execution. For example,195file being rendered, and **not** in the directory of execution. For example,
@@ -215,7 +215,7 @@ As explained in the previous section, a :code:`manim.cfg` config file only · 19 unmodified lines
215affects the scene scripts in its same folder. However, the user may also215affects the scene scripts in its same folder. However, the user may also
216create a special config file that will apply to all scenes rendered by that216create a special config file that will apply to all scenes rendered by that
217user. This is referred to as the **user-wide** config file, and it will apply217user. This is referred to as the **user-wide** config file, and it will apply
218regardless of where manim is executed from, and regardless of where the scene218regardless of where Manim is executed from, and regardless of where the scene
219script is stored.219script is stored.
220 220
221The user-wide config file lives in a special folder, depending on the operating221The user-wide config file lives in a special folder, depending on the operating
@@ -235,14 +235,14 @@ Here, :code:`UserDirectory` is the user's home folder. · 13 unmodified lines
235.. warning:: Do not store scene scripts in the same folder as the user-wide235.. warning:: Do not store scene scripts in the same folder as the user-wide
236 config file. In this case, the behavior is undefined.236 config file. In this case, the behavior is undefined.
237 237
238Whenever you use manim from anywhere in the system, manim will look for a238Whenever you use Manim from anywhere in the system, Manim will look for a
239user-wide config file and read its configuration.239user-wide config file and read its configuration.
240 240
241 241
242Cascading config files242Cascading config files
243======================243======================
244 244
245What happens if you execute manim and it finds both a folder-wide config file245What happens if you execute Manim and it finds both a folder-wide config file
246and a user-wide config file? Manim will read both files, but if they are246and a user-wide config file? Manim will read both files, but if they are
247incompatible, **the folder-wide file takes precedence**.247incompatible, **the folder-wide file takes precedence**.
248 248
@@ -280,7 +280,7 @@ executing · 31 unmodified lines
280 280
281 manim -o myscene -c RED <file.py> SceneName281 manim -o myscene -c RED <file.py> SceneName
282 282
283There is also a **library-wide** config file that determines manim's default283There is also a **library-wide** config file that determines Manim's default
284behavior and applies to every user of the library. It has the least284behavior and applies to every user of the library. It has the least
285precedence, so any config options in the user-wide and any folder-wide files285precedence, so any config options in the user-wide and any folder-wide files
286will override the library-wide file. This is referred to as the *cascading*286will override the library-wide file. This is referred to as the *cascading*
@@ -301,19 +301,19 @@ Order of operations · 14 unmodified lines
301 301
302 302
303 303
304With so many different ways of configuring manim, it can be difficult to know304With so many different ways of configuring Manim, it can be difficult to know
305when each config option is being set. In fact, this will depend on how manim305when each config option is being set. In fact, this will depend on how Manim
306is being used.306is being used.
307 307
308If manim is imported from a module, then the configuration system will follow308If Manim is imported from a module, then the configuration system will follow
309these steps:309these steps:
310 310
3111. The library-wide config file is loaded.3111. The library-wide config file is loaded.
3122. The user-wide and folder-wide files are loaded, if they exist.3122. The user-wide and folder-wide files are loaded if they exist.
3133. All files found in the previous two steps are parsed in a single3133. All files found in the previous two steps are parsed in a single
314 :class:`ConfigParser` object, called ``parser``. This is where *cascading*314 :class:`ConfigParser` object, called ``parser``. This is where *cascading*
315 happens.315 happens.
3164. :class:`logging.Logger` is instantiated to create manim's global ``logger``3164. :class:`logging.Logger` is instantiated to create Manim's global ``logger``
317 object. It is configured using the "logger" section of the parser,317 object. It is configured using the "logger" section of the parser,
318 i.e. ``parser['logger']``.318 i.e. ``parser['logger']``.
3195. :class:`ManimConfig` is instantiated to create the global ``config`` object.3195. :class:`ManimConfig` is instantiated to create the global ``config`` object.
@@ -321,7 +321,7 @@ these steps: · 1 unmodified line
321 :meth:`ManimConfig.digest_parser`.321 :meth:`ManimConfig.digest_parser`.
3227. Both ``logger`` and ``config`` are exposed to the user.3227. Both ``logger`` and ``config`` are exposed to the user.
323 323
324If manim is being invoked from the command-line, all of the previous steps324If Manim is being invoked from the command line, all of the previous steps
325happen, and are complemented by:325happen, and are complemented by:
326 326
3278. The CLI flags are parsed and fed into ``config`` via3278. The CLI flags are parsed and fed into ``config`` via