--- id: sphinx-prompt version: "1.10.2" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # sphinx-prompt — Sphinx directive to add unselectable prompt License: permissive · Maintenance: active · Downloads: 924.7K/mo ## What it is and what it does Sphinx Prompt is a Sphinx extension that adds a `prompt` directive for rendering command-line and code prompts in documentation. It supports multiple languages—bash, batch, PowerShell, Python, Scala, and plain text—and allows you to customize the prompt string, language syntax highlighting, and prompt detection behavior. The rendered prompts are unselectable, making them suitable for copy-paste-friendly documentation where you want users to see the prompt but not accidentally select it. You install it by adding `sphinx_prompt` to your Sphinx `conf.py` extensions list, then use the `.. prompt::` directive in your reStructuredText files. The directive accepts language as a positional argument and supports options like `:prompts:` to specify custom prompt strings and `:modifiers:` to control prompt detection. It depends on standard Sphinx and documentation libraries (docutils, Jinja2, Pygments) and requires Python 3.11 or later. Use it for: - Document shell commands and their expected output in installation or setup guides with styled, unselectable prompts. - Render Python REPL sessions with >>> prompts in tutorial documentation. - Create PowerShell or batch script examples in Windows-focused documentation. - Highlight multiple command-line prompts in a single code block for complex shell workflows. - Maintain consistent prompt styling across large documentation projects using Sphinx. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Sphinx Prompt is a Sphinx extension that renders shell and code prompts in documentation as unselectable, styled text blocks for multiple languages including bash, Python, PowerShell, and batch. Yes. This is a stable, actively maintained Sphinx extension with no known vulnerabilities, permissive licensing, and low install friction. It solves a specific documentation problem—rendering unselectable prompts—cleanly and integrates naturally into Sphinx workflows. Install it if you document shell commands or code examples in Sphinx and want styled, user-friendly prompts. ## Install pip install sphinx-prompt uv add sphinx-prompt poetry add sphinx-prompt ## Installing sphinx-prompt Before you install: Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent release and remains current, depending on standard Sphinx and documentation tooling libraries. License in practice: BSD-3-Clause is a permissive license allowing commercial and private use with minimal restrictions, making this safe to use in most projects. Quickstart: # In conf.py extensions += ['sphinx_prompt'] # In your .rst file .. prompt:: bash :prompts: $ python3 -m pip install sphinx-prompt Requires Python >= 3.11 and an existing Sphinx documentation project. Verify before relying: - Whether the package supports reStructuredText syntax beyond the documented languages (text, bash, batch, powershell, python, scala). - Performance characteristics when rendering large numbers of prompts in a single documentation build. ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 924.7K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags sphinx shell prompt directive, code prompt rendering sphinx, bash prompt documentation, sphinx code block styling, unselectable prompt sphinx, shell command documentation, sphinx language prompts, sphinx-extension, documentation-tooling [View on SkillFed](https://skillfed.io/packages/sphinx-prompt) · [View on PyPI](https://pypi.org/project/sphinx-prompt/)