Interactive command builders for Sphinx documentation
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sphinx_dynamic_command_builder-0.3.0.tar.gz.
File metadata
- Download URL: sphinx_dynamic_command_builder-0.3.0.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9d0d4b902a33079e48444725f9cbe76fe8c5c2c9528f204d686611ada3fe9b2
|
|
| MD5 |
a851f148e2f451a3897372c296dea447
|
|
| BLAKE2b-256 |
66902b48160f13b093cb67ec8d21bc3eb9daac9539599b90487564ab7e630128
|
Provenance
The following attestation bundles were made for sphinx_dynamic_command_builder-0.3.0.tar.gz:
Publisher:
publish.yml on Aionw/sphinx-dynamic-command-builder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_dynamic_command_builder-0.3.0.tar.gz -
Subject digest:
f9d0d4b902a33079e48444725f9cbe76fe8c5c2c9528f204d686611ada3fe9b2 - Sigstore transparency entry: 1858084327
- Sigstore integration time:
-
Permalink:
Aionw/sphinx-dynamic-command-builder@9f70ce8a5a9dffb02a262bf17fa07dabf020f85b -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/Aionw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9f70ce8a5a9dffb02a262bf17fa07dabf020f85b -
Trigger Event:
release
-
Statement type:
File details
Details for the file sphinx_dynamic_command_builder-0.3.0-py3-none-any.whl.
File metadata
- Download URL: sphinx_dynamic_command_builder-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c006ea45ebb2b18dca6396a2c67db5f0da16331eb1e0b133ffc7e08e34d14847
|
|
| MD5 |
07b416cbe2506f62a1652c318a971be3
|
|
| BLAKE2b-256 |
a47398a409ed81f4bc38e10bface58600364f9915ae271c7cbd136027cba1e0e
|
Provenance
The following attestation bundles were made for sphinx_dynamic_command_builder-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on Aionw/sphinx-dynamic-command-builder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_dynamic_command_builder-0.3.0-py3-none-any.whl -
Subject digest:
c006ea45ebb2b18dca6396a2c67db5f0da16331eb1e0b133ffc7e08e34d14847 - Sigstore transparency entry: 1858084335
- Sigstore integration time:
-
Permalink:
Aionw/sphinx-dynamic-command-builder@9f70ce8a5a9dffb02a262bf17fa07dabf020f85b -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/Aionw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9f70ce8a5a9dffb02a262bf17fa07dabf020f85b -
Trigger Event:
release
-
Statement type: