Skip to content

Commit

Permalink
format command
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Dec 13, 2023
1 parent da60e4b commit d531250
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit d531250

Please sign in to comment.