sphinx-dynamic-command-builder
Interactive command builders for Sphinx documentation.
sphinx-dynamic-command-builder adds a dynamic-command directive that renders a small selector UI from YAML and updates a generated command in the browser. It is useful for docs that need to show command-line examples assembled from several independent choices.
Demo: GitHub Pages
Install
pip install sphinx-dynamic-command-builder
Then enable the extension in conf.py:
extensions = [
"sphinx_dynamic_command_builder",
]
Usage
```{dynamic-command}
base: python -m sglang.launch_server --model-path [model_path]
format:
line_break: options
indent: " "
options:
- label: Topology
key: nodes
default: single
choices:
- label: Single node
value: single
args: --host 0.0.0.0 --port 30000
- label: Multi node
value: multi
args: --host 0.0.0.0 --port 30000 --disaggregation-ib-device mlx5_1
```
Rendered result:
Each option group is rendered as one selector row. Selecting a choice updates the generated command.
Set multiple: true on a group when choices should toggle independently
instead of behaving as a single-select control.
YAML schema
See Configuration for the full field reference and formatting rules.
base: base command string.command_label: optional output label. Defaults toGenerated command.format.line_break: optional command wrapping mode. Useoptionsto put each--optiongroup on its own shell-continuation line, ornoneto render a single line. Defaults tooptions.format.indent: optional indentation for continuation lines. Defaults to two spaces.options: list of option groups.options[].label: visible group label.options[].key: stable group key.options[].multiple: optional boolean. Usetruefor multi-select groups. Defaults tofalse.options[].default: optional default choice value. Single-select groups use a string and default to the first choice. Multi-select groups use a string or list of strings and default to no selected choices.options[].choices: list of choices.choices[].label: visible choice label.choices[].value: stable choice value.choices[].env: optional text prepended before the base command.choices[].args: optional text appended after the base command.choices[].base: optional replacement base command for this choice.
Development
uv venv
uv pip install -e ".[test,docs]"
pytest
sphinx-build -M html docs docs/_build
Metadata
Release files for sphinx-dynamic-command-builder 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sphinx_dynamic_command_builder-0.3.0.tar.gz | 27.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sphinx_dynamic_command_builder-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.1 kB
Release files / sphinx_dynamic_command_builder-0.3.0.tar.gz
| Download URL | sphinx_dynamic_command_builder-0.3.0.tar.gz |
|---|---|
| Size | 27.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9d0d4b902a33079e48444725f9cbe76fe8c5c2c9528f204d686611ada3fe9b2
|
|
BLAKE2b-256 checksum How to use checksums |
66902b48160f13b093cb67ec8d21bc3eb9daac9539599b90487564ab7e630128
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 18, 2026.
Transparency logRelease files / sphinx_dynamic_command_builder-0.3.0-py3-none-any.whl
| Download URL | sphinx_dynamic_command_builder-0.3.0-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c006ea45ebb2b18dca6396a2c67db5f0da16331eb1e0b133ffc7e08e34d14847
|
|
BLAKE2b-256 checksum How to use checksums |
a47398a409ed81f4bc38e10bface58600364f9915ae271c7cbd136027cba1e0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 18, 2026.
Transparency log