# 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": "",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "",
"keywords": "sphinx,shell,prompt",
"author": "St\u00e9phane Brunner",
"author_email": "stephane.brunner@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e7/fb/7a07b8df1ca2418147a6b13e3f6b445071f2565198b45efa631d0d6ef0cd/sphinx_prompt-1.8.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.8.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": "3949f890a2668b7cbf375f5528b549c8d36dd2e801b0fbb7b2b5ef65663ecb6c",
"md5": "b8943d446b2eb1dd888d201528590cc8",
"sha256": "369ecc633f0711886f9b3a078c83264245be1adf46abeeb9b88b5519e4b51007"
},
"downloads": -1,
"filename": "sphinx_prompt-1.8.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b8943d446b2eb1dd888d201528590cc8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 7298,
"upload_time": "2023-09-14T12:46:12",
"upload_time_iso_8601": "2023-09-14T12:46:12.373062Z",
"url": "https://files.pythonhosted.org/packages/39/49/f890a2668b7cbf375f5528b549c8d36dd2e801b0fbb7b2b5ef65663ecb6c/sphinx_prompt-1.8.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e7fb7a07b8df1ca2418147a6b13e3f6b445071f2565198b45efa631d0d6ef0cd",
"md5": "230ff9b62830751ccff231da9240e57e",
"sha256": "47482f86fcec29662fdfd23e7c04ef03582714195d01f5d565403320084372ed"
},
"downloads": -1,
"filename": "sphinx_prompt-1.8.0.tar.gz",
"has_sig": false,
"md5_digest": "230ff9b62830751ccff231da9240e57e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 5121,
"upload_time": "2023-09-14T12:46:13",
"upload_time_iso_8601": "2023-09-14T12:46:13.449044Z",
"url": "https://files.pythonhosted.org/packages/e7/fb/7a07b8df1ca2418147a6b13e3f6b445071f2565198b45efa631d0d6ef0cd/sphinx_prompt-1.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-14 12:46:13",
"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.6.1"
]
]
},
{
"name": "poetry-plugin-tweak-dependencies-version",
"specs": [
[
"==",
"1.5.1"
]
]
},
{
"name": "poetry-dynamic-versioning",
"specs": [
[
"==",
"1.0.1"
]
]
},
{
"name": "pip",
"specs": [
[
"==",
"23.2.1"
]
]
}
],
"lcname": "sphinx-prompt"
}