Skip to content

Commit

Permalink
Better align docs description of configuration with the updated format
Browse files Browse the repository at this point in the history
  • Loading branch information
3b1b committed Dec 11, 2024
1 parent 4d7f609 commit 1794e4d
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 86 deletions.
48 changes: 20 additions & 28 deletions docs/source/documentation/constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,35 @@ they are only used inside manim.
Frame and pixel shape
---------------------

These values will be determined based on the ``camera`` configuration in default_config.yml or custom_config.yml

.. code-block:: python
ASPECT_RATIO = 16.0 / 9.0
FRAME_HEIGHT = 8.0
FRAME_WIDTH = FRAME_HEIGHT * ASPECT_RATIO
FRAME_Y_RADIUS = FRAME_HEIGHT / 2
FRAME_X_RADIUS = FRAME_WIDTH / 2
ASPECT_RATIO
FRAME_HEIGHT
FRAME_WIDTH
FRAME_Y_RADIUS
FRAME_X_RADIUS
DEFAULT_PIXEL_HEIGHT = 1080
DEFAULT_PIXEL_WIDTH = 1920
DEFAULT_FPS = 30
DEFAULT_PIXEL_HEIGHT
DEFAULT_PIXEL_WIDTH
DEFAULT_FPS
Buffs
-----

.. code-block:: python
SMALL_BUFF = 0.1
MED_SMALL_BUFF = 0.25
MED_LARGE_BUFF = 0.5
LARGE_BUFF = 1
These values will be determined based on the ``size`` configuration in default_config.yml or custom_config.yml

DEFAULT_MOBJECT_TO_EDGE_BUFF = MED_LARGE_BUFF # Distance between object and edge
DEFAULT_MOBJECT_TO_MOBJECT_BUFF = MED_SMALL_BUFF # Distance between objects
Run times
---------

.. code-block:: python
DEFAULT_POINTWISE_FUNCTION_RUN_TIME = 3.0
DEFAULT_WAIT_TIME = 1.0
SMALL_BUFF
MED_SMALL_BUFF
MED_LARGE_BUFF
LARGE_BUFF
DEFAULT_MOBJECT_TO_EDGE_BUFF
DEFAULT_MOBJECT_TO_MOBJECT_BUFF
Coordinates
-----------
Expand Down Expand Up @@ -89,16 +86,11 @@ Text
OBLIQUE = "OBLIQUE"
BOLD = "BOLD"
Stroke width
------------

.. code-block:: python
DEFAULT_STROKE_WIDTH = 4
Colours
-------

Color constants are determined based on the ``color`` configuration in default_config.yml or custom_config.yml

Here are the preview of default colours. (Modified from
`elteoremadebeethoven <https://elteoremadebeethoven.github.io/manim_3feb_docs.github.io/html/_static/colors/colors.html>`_)

Expand Down
135 changes: 77 additions & 58 deletions docs/source/documentation/custom_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ custom_config
running file under the ``output`` path, and save the output (``images/``
or ``videos/``) in it.

- ``base``
The root directory that will hold files, such as video files manim renders,
or image resources that it pulls from

- ``output``
Output file path, the videos will be saved in the ``videos/`` folder under it,
and the pictures will be saved in the ``images/`` folder under it.
Expand Down Expand Up @@ -66,92 +70,107 @@ custom_config
The directory for storing sound files to be used in ``Scene.add_sound()`` (
including ``.wav`` and ``.mp3``).

- ``temporary_storage``
- ``cache``
The directory for storing temporarily generated cache files, including
``Tex`` cache, ``Text`` cache and storage of object points.

``tex``
-------

- ``executable``
The executable program used to compile LaTeX (``latex`` or ``xelatex -no-pdf``
is recommended)
``window``
----------

- ``template_file``
LaTeX template used, in ``manimlib/tex_templates``
- ``position_string``
The relative position of the playback window on the display (two characters,
the first character means upper(U) / middle(O) / lower(D), the second character
means left(L) / middle(O) / right(R)).

- ``intermediate_filetype``
The type of intermediate vector file generated after compilation (``dvi`` if
``latex`` is used, ``xdv`` if ``xelatex`` is used)

- ``text_to_replace``
The text to be replaced in the template (needn't to change)
- ``monitor_index``
If using multiple monitors, which one should the window show up in?

``universal_import_line``
-------------------------
- ``full_screen``
Should the preview window be full screen. If not, it defaults to half the screen

Import line that need to execute when entering interactive mode directly.
- ``position``
This is an option to more manually set the default window position, in pixel
coordinates, e.g. (500, 300)

``style``
---------
- ``size``
Option to more manually set the default window size, in pixel coordinates,
e.g. (1920, 1080)

- ``font``
Default font of Text

- ``text_alignment``
Default text alignment for LaTeX
``camera``
----------

- ``background_color``
Default background color
- ``resolution``
Resolution to render at, e.g. (1920, 1080)

``window_position``
-------------------
- ``background_color``
Default background color of scenes

The relative position of the playback window on the display (two characters,
the first character means upper(U) / middle(O) / lower(D), the second character
means left(L) / middle(O) / right(R)).
- ``fps``
Framerate

``window_monitor``
------------------
- ``background_opacity``
Opacity of the background

The number of the monitor you want the preview window to pop up on. (default is 0)

``full_screen``
``file_writer``
---------------
Configuration specifying how files are written, e.g. what ffmpeg parameters to use

Whether open the window in full screen. (default is false)

``break_into_partial_movies``
-----------------------------
``scene``
-------
Some default configuration for the Scene class

If this is set to ``True``, then many small files will be written corresponding
to each ``Scene.play`` and ``Scene.wait`` call, and these files will then be combined
to form the full scene.

Sometimes video-editing is made easier when working with the broken up scene, which
effectively has cuts at all the places you might want.
``text``
-------

``camera_resolutions``
----------------------
- ``font``
Default font of Text

Export resolutions
- ``text_alignment``
Default text alignment for LaTeX

- ``low``
Low resolutions (default is 480p)
``tex``
-------

- ``medium``
Medium resolutions (default is 720p)
- ``template``
Which configuration from the manimlib/tex_template.yml file should be used
to determine the latex compiler to use, and what preamble to include for
rendering tex.

- ``high``
High resolutions (default is 1080p)

- ``ultra_high``
Ultra high resolutions (default is 4K)
``sizes``
---------

- ``default_resolutions``
Default resolutions (one of the above four, default is high)
Valuess for various constants used in manimm to specify distances, like the height
of the frame, the value of SMALL_BUFF, LARGE_BUFF, etc.

``fps``
-------

Export frame rate. (default is 30)
``colors``
----------

Color pallete to use, determining values of color constants like RED, BLUE_E, TEAL, etc.

``loglevel``
------------

Can be DEBUG / INFO / WARNING / ERROR / CRITICAL


``universal_import_line``
-------------------------

Import line that need to execute when entering interactive mode directly.


``ignore_manimlib_modules_on_reload``
-------------------------------------

When calling ``reload`` during the interactive mode, imported modules are
by default reloaded, in case the user writing a scene which pulls from various
other files they have written. By default, modules withinn the manim library will
be ignored, but one developing manim may want to set this to be False so that
edits to the library are reloaded as well.

0 comments on commit 1794e4d

Please sign in to comment.