From: David Lev <42866208+david-lev@users.noreply.github.com> Date: Fri, 6 Oct 2023 01:21:56 +0000 (+0300) Subject: Remove `$`, `>>>` and other prompt prefixes when code copied from the… (#3884) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/3a2d76c7bcf39e852f3b379b76537d7847ed4225?ds=inline 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 --- diff --git a/docs/conf.py b/docs/conf.py index f7cf1b4..6b64543 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -210,6 +210,13 @@ epub_exclude_files = ["search.html"] 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 --------------------------------------- # Example configuration for intersphinx: refer to the Python standard library.