# Sphinx Prompt
## Initialize
In `conf.py` add `extensions += ['sphinx_prompt']`.
## Syntax
A default prompt can be created using a `prompt` directive:
```rst
.. prompt::
<statements>
```
The prompt can be further customized in one of two ways:
- Using positional arguments:
```rst
.. prompt:: [<language> [<prompts> [<modifiers>]]]
<statements>
```
- Using options:
```rst
.. prompt::
:language: <language>
:prompts: <prompts>
:modifiers: <modifiers>
<statements>
```
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: <http://sbrunner.github.io/sphinx-prompt/>
## 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 <version>
git push origin <version>
```
## Contributing
Install the pre-commit hooks:
```bash
pip install pre-commit
pre-commit install --allow-missing-config
```
Raw data
{
"_id": null,
"home_page": "https://github.com/sbrunner/sphinx-prompt",
"name": "sphinx-prompt",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "sphinx, shell, prompt",
"author": "St\u00e9phane Brunner",
"author_email": "stephane.brunner@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/34/fe/ac4e24f35b5148b31ac717ae7dcc7a2f7ec56eb729e22c7252ed8ad2d9a5/sphinx_prompt-1.9.0.tar.gz",
"platform": null,
"description": "# Sphinx Prompt\n\n## Initialize\n\nIn `conf.py` add `extensions += ['sphinx_prompt']`.\n\n## Syntax\n\nA default prompt can be created using a `prompt` directive:\n\n```rst\n.. prompt::\n\n <statements>\n```\n\nThe prompt can be further customized in one of two ways:\n\n- Using positional arguments:\n\n ```rst\n .. prompt:: [<language> [<prompts> [<modifiers>]]]\n\n <statements>\n ```\n\n- Using options:\n\n ```rst\n .. prompt::\n :language: <language>\n :prompts: <prompts>\n :modifiers: <modifiers>\n\n <statements>\n ```\n\nWhile these constructs generate the same output, the positional\narguments cannot be used if you want to use a prompt that contains\nspaces. This is a limitation of reStructuredText.\n\nPositional arguments can be mixed with options **if** they don\\'t\noverlap (so if you pass prompts using options, you can only pass the\nlanguage using positional arguments):\n\n```rst\n.. prompt:: bash\n :prompts: (cool_project) $\n\n python3 -m pip install --upgrade sphinx-prompt\n```\n\n### Language\n\nSupported language:\n\n- `text` (no pigments, default)\n- `bash`\n- `batch`\n- `powershell`\n- `python`\n- `scala`\n\n### Prompt(s)\n\nIf modifier is auto, a comma-separated list of prompts to find in the\nstatements.\n\nElse the prompt to add on each statements, for Python and Bash language\nthe end `\\` is supported.\n\nDefaults to empty, except for the shell languages listed below:\n\n- `bash` - `$`\n- `batch` - `C:\\>`\n- `powershell` - `PS C:\\>`\n\n## Examples\n\nSee: <http://sbrunner.github.io/sphinx-prompt/>\n\n## Run tests and prospector\n\n```bash\npython3 -m pip install --user --upgrade poetry\npoetry install\npoetry run pytest\npoetry run prospector\n```\n\nThe code should be formatted with `black` add `isort`.\n\n## Create new release\n\n```bash\ngit tag <version>\ngit push origin <version>\n```\n\n## Contributing\n\nInstall the pre-commit hooks:\n\n```bash\npip install pre-commit\npre-commit install --allow-missing-config\n```\n\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Sphinx directive to add unselectable prompt",
"version": "1.9.0",
"project_urls": {
"Homepage": "https://github.com/sbrunner/sphinx-prompt",
"Repository": "https://github.com/sbrunner/sphinx-prompt"
},
"split_keywords": [
"sphinx",
" shell",
" prompt"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7698e90ca466e0ede452d3e5a8d92b8fb68db6de269856e019ed9cab69440522",
"md5": "ff01f7158a91e127e93a92a6eb93e6f4",
"sha256": "fd731446c03f043d1ff6df9f22414495b23067c67011cc21658ea8d36b3575fc"
},
"downloads": -1,
"filename": "sphinx_prompt-1.9.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ff01f7158a91e127e93a92a6eb93e6f4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 7311,
"upload_time": "2024-08-07T15:46:50",
"upload_time_iso_8601": "2024-08-07T15:46:50.329129Z",
"url": "https://files.pythonhosted.org/packages/76/98/e90ca466e0ede452d3e5a8d92b8fb68db6de269856e019ed9cab69440522/sphinx_prompt-1.9.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "34feac4e24f35b5148b31ac717ae7dcc7a2f7ec56eb729e22c7252ed8ad2d9a5",
"md5": "6f8924cb64c87692974d29fbef2a254d",
"sha256": "471b3c6d466dce780a9b167d9541865fd4e9a80ed46e31b06a52a0529ae995a1"
},
"downloads": -1,
"filename": "sphinx_prompt-1.9.0.tar.gz",
"has_sig": false,
"md5_digest": "6f8924cb64c87692974d29fbef2a254d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 5340,
"upload_time": "2024-08-07T15:46:51",
"upload_time_iso_8601": "2024-08-07T15:46:51.428373Z",
"url": "https://files.pythonhosted.org/packages/34/fe/ac4e24f35b5148b31ac717ae7dcc7a2f7ec56eb729e22c7252ed8ad2d9a5/sphinx_prompt-1.9.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-07 15:46:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sbrunner",
"github_project": "sphinx-prompt",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "poetry",
"specs": [
[
"==",
"1.8.3"
]
]
},
{
"name": "poetry-plugin-tweak-dependencies-version",
"specs": [
[
"==",
"1.5.2"
]
]
},
{
"name": "poetry-dynamic-versioning",
"specs": [
[
"==",
"1.4.0"
]
]
},
{
"name": "pip",
"specs": [
[
"==",
"24.2"
]
]
},
{
"name": "poetry-plugin-export",
"specs": [
[
"==",
"1.8.0"
]
]
},
{
"name": "poetry-plugin-drop-python-upper-constraint",
"specs": [
[
"==",
"0.1.0"
]
]
},
{
"name": "certifi",
"specs": [
[
">=",
"2024.7.4"
]
]
},
{
"name": "zipp",
"specs": [
[
">=",
"3.19.1"
]
]
}
],
"lcname": "sphinx-prompt"
}