chore(docs): improve CLI docs (#27)

* chore(docs): cleanup code & docs

* chore(docs): better document present command

* chore(docs): improve gh page
This commit is contained in:
Jérome Eertmans
2022-09-22 18:16:28 +02:00
committed by GitHub
parent cbee6320f5
commit ee92e0aa88
6 changed files with 25 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

View File

@ -6,7 +6,7 @@
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'manim-slides' project = 'Manim Slides'
copyright = '2022, Jérome Eertmans' copyright = '2022, Jérome Eertmans'
author = 'Jérome Eertmans' author = 'Jérome Eertmans'

View File

@ -3,8 +3,17 @@
You can adapt this file completely to your liking, but it should at least You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive. contain the root `toctree` directive.
Welcome to manim-slides's documentation! .. image:: _static/logo.png
======================================== :width: 600
:align: center
:alt: Manim Slide logo
Welcome to Manim Slide's CLI documentation!
===========================================
This page contains an exhaustive list of all the commands available with `manim-slides`.
If you need help installing or using Manim Slide, please refer to the `GitHub README <https://github.com/jeertmans/manim-slides>`_.
.. click:: manim_slides.main:cli .. click:: manim_slides.main:cli
:prog: manim-slides :prog: manim-slides

View File

@ -10,7 +10,6 @@ def config_path_option(function) -> Callable:
return click.option( return click.option(
"-c", "-c",
"--config", "--config",
"config_path",
default=CONFIG_PATH, default=CONFIG_PATH,
type=click.Path(dir_okay=False), type=click.Path(dir_okay=False),
help="Set path to configuration file.", help="Set path to configuration file.",

View File

@ -501,7 +501,7 @@ def _list_scenes(folder) -> List[str]:
filepath = os.path.join(folder, file) filepath = os.path.join(folder, file)
_ = PresentationConfig.parse_file(filepath) _ = PresentationConfig.parse_file(filepath)
scenes.append(os.path.basename(file)[:-5]) scenes.append(os.path.basename(file)[:-5])
except Exception as e: # Could not parse this file as a proper presentation config except Exception: # Could not parse this file as a proper presentation config
pass pass
return scenes return scenes
@ -529,7 +529,7 @@ def _list_scenes(folder) -> List[str]:
"--resolution", "--resolution",
type=(int, int), type=(int, int),
default=(1920, 1080), default=(1920, 1080),
help="Window resolution used if fullscreen is not set. You may manually resize the window afterward.", help="Window resolution WIDTH HEIGHT used if fullscreen is not set. You may manually resize the window afterward.",
show_default=True, show_default=True,
) )
@click.option( @click.option(
@ -558,7 +558,15 @@ def present(
interpolation_flag, interpolation_flag,
record_to, record_to,
): ):
"""Present the different scenes.""" """
Present SCENE(s), one at a time, in order.
Each SCENE parameter must be the name of a Manim scene, with existing SCENE.json config file.
You can present the same SCENE multiple times by repeating the parameter.
Use `manim-slide list-scenes` to list all available scenes in a given folder.
"""
if len(scenes) == 0: if len(scenes) == 0:
scene_choices = _list_scenes(folder) scene_choices = _list_scenes(folder)

View File

@ -38,6 +38,7 @@ def prompt(question: str) -> int:
@click.command() @click.command()
@config_options @config_options
@click.help_option("-h", "--help")
def wizard(config_path, force, merge): def wizard(config_path, force, merge):
"""Launch configuration wizard.""" """Launch configuration wizard."""
return _init(config_path, force, merge, skip_interactive=False) return _init(config_path, force, merge, skip_interactive=False)
@ -45,6 +46,7 @@ def wizard(config_path, force, merge):
@click.command() @click.command()
@config_options @config_options
@click.help_option("-h", "--help")
def init(config_path, force, merge, skip_interactive=False): def init(config_path, force, merge, skip_interactive=False):
"""Initialize a new default configuration file.""" """Initialize a new default configuration file."""
return _init(config_path, force, merge, skip_interactive=True) return _init(config_path, force, merge, skip_interactive=True)