--- id: sphinx-toggleprompt version: "0.6.0" license: MIT License license_treatment: permissive maintenance: aging --- # sphinx-toggleprompt — Add a python prompt toggle to each code cell. License: permissive · Maintenance: aging · Downloads: 192.4K/mo ## What it is and what it does sphinx-toggleprompt is a Sphinx extension that enhances Python code examples in documentation by adding an interactive button to toggle the >>> prompts and output lines. This allows readers to view the same code in two forms: with prompts and output (as it appears in a Python REPL), or as clean, copyable code without prompts. The extension depends only on sphinx and integrates directly into your Sphinx conf.py configuration. It's designed for documentation projects that include Python code examples and want to give readers control over how they view those examples. The extension works alongside other Sphinx tools like sphinx-copybutton to provide a complete code-viewing experience. Since it's copied from the official Python docs theme, it follows established patterns for documentation code presentation. Use it for: - Tutorial documentation where showing both REPL interactions and clean code snippets adds clarity. - API documentation with Python examples that benefit from toggling between interactive and copyable formats. - Educational materials that teach Python by showing both the prompt and the resulting output. - Mixed documentation where some readers want to copy code directly and others want to see execution context. - Projects using sphinx-copybutton that want complementary prompt-hiding functionality. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds a button to Python code blocks in Sphinx documentation that toggles >>> prompts and removes output lines for cleaner code display. Yes, if you maintain Sphinx documentation with Python code examples and want readers to toggle between REPL-style and clean code views. The low install friction, permissive license, and lack of known vulnerabilities make it a safe addition. The aging maintenance status (553 days since release) is a minor concern, but the repository remains active and the extension is simple enough to be stable. Install it if prompt toggling improves your documentation's usability. ## Install pip install sphinx-toggleprompt uv add sphinx-toggleprompt poetry add sphinx-toggleprompt ## Installing sphinx-toggleprompt Before you install: Low friction installation with a single runtime dependency on sphinx. The package is aging (553 days since last release) but the repository remains active with a recent commit in September 2025, suggesting maintenance continues despite infrequent releases. License in practice: MIT License permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects. Quickstart: pip install sphinx-toggleprompt In conf.py: extensions = [ 'sphinx_toggleprompt', ] Requires Python 3.9 or later and an existing Sphinx documentation project. Verify before relying: - Whether the toggle button works reliably across all Sphinx themes and versions. - Compatibility with recent Sphinx releases and any breaking changes in the Sphinx extension API. - Performance impact on documentation builds with many code blocks. ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 192.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sphinx code block prompt toggle, hide python prompts documentation, sphinx interactive code examples, remove >>> from code blocks, sphinx documentation code formatting, toggle python repl prompts, sphinx copyable code blocks, sphinx-extension, documentation-tools [View on SkillFed](https://skillfed.io/packages/sphinx-toggleprompt) · [View on PyPI](https://pypi.org/project/sphinx-toggleprompt/)