From e79d57c91af2673d3c8b6a97431416172e8c9be6 Mon Sep 17 00:00:00 2001 From: Jordan Cook Date: Sun, 6 Nov 2022 22:43:15 -0600 Subject: [PATCH] Add sphinx-copybutton back --- pages/conf.py | 6 +++++- requirements.txt | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pages/conf.py b/pages/conf.py index 29b72b3..08b0834 100644 --- a/pages/conf.py +++ b/pages/conf.py @@ -16,6 +16,7 @@ templates_path = ['_templates'] extensions = [ 'sphinx.ext.autosummary', 'sphinx.ext.extlinks', + 'sphinx_copybutton', 'sphinx_design', 'myst_parser', 'notfound.extension', @@ -30,6 +31,10 @@ myst_enable_extensions = [ 'smartquotes', ] +# Strip prompt text when copying code blocks with copy button +copybutton_prompt_text = r'>>> |\.\.\. |\$ ' +copybutton_prompt_is_regexp = True + # HTML general settings # html_favicon = join('../assets', 'favicon.ico') html_css_files = [ @@ -89,4 +94,3 @@ html_theme_options = { # bg3 #665c54 # bg4 #7c6f64 # gray #928374 - diff --git a/requirements.txt b/requirements.txt index c9ea28c..95a795f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,6 @@ linkify-it-py>=2.0 myst-parser>=0.17 sphinx~=5.3.0 sphinx-autobuild>=2021.3 +sphinx-copybutton>=0.5 sphinx-design>=0.2 sphinx-notfound-page>=0.8