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 -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'manim-slides'
project = 'Manim Slides'
copyright = '2022, 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
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
:prog: manim-slides

View File

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

View File

@ -501,7 +501,7 @@ def _list_scenes(folder) -> List[str]:
filepath = os.path.join(folder, file)
_ = PresentationConfig.parse_file(filepath)
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
return scenes
@ -529,7 +529,7 @@ def _list_scenes(folder) -> List[str]:
"--resolution",
type=(int, int),
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,
)
@click.option(
@ -558,7 +558,15 @@ def present(
interpolation_flag,
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:
scene_choices = _list_scenes(folder)

View File

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