https://github.com/sbrunner/sphinx-prompt
Sphinx directive to add unselectable prompt
https://github.com/sbrunner/sphinx-prompt
documentation sphinx-extension
Last synced: 3 months ago
JSON representation
Sphinx directive to add unselectable prompt
- Host: GitHub
- URL: https://github.com/sbrunner/sphinx-prompt
- Owner: sbrunner
- License: bsd-3-clause
- Created: 2013-10-13T09:05:43.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-04-14T00:21:14.000Z (about 1 year ago)
- Last Synced: 2024-04-14T14:55:40.861Z (about 1 year ago)
- Topics: documentation, sphinx-extension
- Language: Python
- Homepage:
- Size: 878 KB
- Stars: 46
- Watchers: 4
- Forks: 5
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sphinx Prompt
## Initialize
In `conf.py` add `extensions += ['sphinx_prompt']`.
## Syntax
A default prompt can be created using a `prompt` directive:
```rst
.. prompt::
```The prompt can be further customized in one of two ways:
- Using positional arguments:
```rst
.. prompt:: [ [ []]]
```- Using options:
```rst
.. prompt::
:language:
:prompts:
:modifiers:
```While these constructs generate the same output, the positional
arguments cannot be used if you want to use a prompt that contains
spaces. This is a limitation of reStructuredText.Positional arguments can be mixed with options **if** they don\'t
overlap (so if you pass prompts using options, you can only pass the
language using positional arguments):```rst
.. prompt:: bash
:prompts: (cool_project) $python3 -m pip install --upgrade sphinx-prompt
```### Language
Supported language:
- `text` (no pigments, default)
- `bash`
- `batch`
- `powershell`
- `python`
- `scala`### Prompt(s)
If modifier is auto, a comma-separated list of prompts to find in the
statements.Else the prompt to add on each statements, for Python and Bash language
the end `\` is supported.Defaults to empty, except for the shell languages listed below:
- `bash` - `$`
- `batch` - `C:\>`
- `powershell` - `PS C:\>`## Examples
See:
## Run tests and prospector
```bash
python3 -m pip install --user --upgrade poetry
poetry install
poetry run pytest
poetry run prospector
```The code should be formatted with `black` add `isort`.
## Create new release
```bash
git tag
git push origin
```## Contributing
Install the pre-commit hooks:
```bash
pip install pre-commit
pre-commit install --allow-missing-config
```