sphinx-prompt

Homepage:

https://github.com/sbrunner/sphinx-prompt/

sphinx-prompt is useful to show commands outputs, Python REPL scripts and more. It allows you to show a prompt on each line but making it unselectable, so the reader can just copy and paste your script without worry about modifying it to remove the prompt.

Example

import datetime
datetime.now()
datetime.datetime.now()
datetime.datetime(2020, 3, 29, 16, 13, 30, 100129)

Installation

pip install sphinx-prompt

Configuration

# conf.py
extensions = [
    '...',
    'sphinx-prompt'
]