Remove $, >>> and other prompt prefixes when code copied from the… (#3884)

Adding configurations for sphinx-copybutton in conf.py
https://sphinx-copybutton.readthedocs.io/en/latest/use.html#using-regexp-prompt-identifiers
This commit is contained in:
David Lev 2023-10-06 04:21:56 +03:00 committed by GitHub
parent 27c05e1e24
commit 3a2d76c7bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -210,6 +210,13 @@ def make_pypi_svg(version: str) -> None:
autodoc_member_order = "bysource" autodoc_member_order = "bysource"
# -- sphinx-copybutton configuration ----------------------------------------
copybutton_prompt_text = (
r">>> |\.\.\. |> |\$ |\# | In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
)
copybutton_prompt_is_regexp = True
copybutton_remove_prompts = True
# -- Options for intersphinx extension --------------------------------------- # -- Options for intersphinx extension ---------------------------------------
# Example configuration for intersphinx: refer to the Python standard library. # Example configuration for intersphinx: refer to the Python standard library.