From 0f61c47abaebb06228f31d9992b1423fd54cdb2e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 14 Mar 2022 15:33:15 -0400 Subject: [PATCH] add sphinx_copybutton Change-Id: I14471e98a876982b4fcfdfab35c3150ab0b18bde --- docs/build/conf.py | 7 +++++++ docs/build/requirements.txt | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/build/conf.py b/docs/build/conf.py index c39e5b22..dd984622 100644 --- a/docs/build/conf.py +++ b/docs/build/conf.py @@ -38,8 +38,15 @@ extensions = [ "sphinx.ext.intersphinx", "changelog", "sphinx_paramlinks", + "sphinx_copybutton", ] +copybutton_prompt_text = ( + r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: " +) +copybutton_prompt_is_regexp = True + + # tags to sort on inside of sections changelog_sections = [ "changed", diff --git a/docs/build/requirements.txt b/docs/build/requirements.txt index 81db1119..2d7081c0 100644 --- a/docs/build/requirements.txt +++ b/docs/build/requirements.txt @@ -5,4 +5,5 @@ python-dateutil # because there's a dependency in pyfiles.py Mako importlib-metadata;python_version<"3.8" -importlib-resources;python_version<"3.9" \ No newline at end of file +importlib-resources;python_version<"3.9" +sphinx_copybutton -- 2.47.2