From d531250e9a3ab1166825f88c23e886976f2c6acd Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Wed, 13 Dec 2023 09:10:58 -0500 Subject: [PATCH] format command --- docs/source/conf.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/source/conf.py b/docs/source/conf.py index 01ae984b..1ecd0013 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -115,12 +115,16 @@ def _add_formatting_to_string(line: str) -> str: def process_description(app: Sphinx, ctx: Context, lines: List[str]): """Add custom formatting to sphinx-click autodoc descriptions. + * remove :param: :return: etc * add fixed-width (code) font to certain words * add code block formatting to example shell commands Because we have to modify the lines list in place, we have to make multiple passes through it to format everything correctly. """ + if not lines: + return + # chop off params param_boundary = None for i, line in enumerate(lines): @@ -153,6 +157,8 @@ def process_description(app: Sphinx, ctx: Context, lines: List[str]): lines.insert(i, "") lines.insert(i, ".. code-block:: console") + lines.append(".. rubric:: Command") + def process_option(app: Sphinx, ctx: Context, lines: List[str]): """Add fixed-width formatting to strings in sphinx-click autodoc options."""