]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
pin sphinx-copybutton and change config
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Feb 2023 17:05:47 +0000 (12:05 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Feb 2023 17:07:12 +0000 (12:07 -0500)
sphinx-copybutton introduced a new feature
in 0.5.1 which includes a default configuration
that breaks the regexp prompt matching scheme.

set copybutton_exclude to not include ".gp" as that's the class
where we exactly look for the prompts we are matching.
While we're there, use this new feature to exclude our sql
styles, even though this is not strictly necessary in our case.

pin sphinx-copybutton at 0.5.1 to avoid future problems.

Change-Id: I8eaeab13995c032b9ee3afd1f08dae5929009d45
References: https://github.com/executablebooks/sphinx-copybutton/issues/185

doc/build/conf.py
doc/build/requirements.txt

index c8db935da1d3227e207ab05dc013be3a21dd706d..443b7d3a298f7c4479d964cfbcf4c48ba147d0c4 100644 (file)
@@ -53,6 +53,12 @@ copybutton_prompt_text = (
 )
 copybutton_prompt_is_regexp = True
 
+# workaround
+# https://sphinx-copybutton-exclude-issue.readthedocs.io/en/v0.5.1-go/
+# https://github.com/executablebooks/sphinx-copybutton/issues/185
+# while we're at it, add our SQL css classes to also not be copied
+copybutton_exclude = ".linenos .show_sql .show_sql_print .popup_sql"
+
 nitpicky = False
 
 # The suffix of source filenames.
index eccea8b182d7e1f822aa29a83e9466c62d60baed..9b9bffd36e53eb1a9e6a91193f06c19de28de7cf 100644 (file)
@@ -1,6 +1,6 @@
 git+https://github.com/sqlalchemyorg/changelog.git#egg=changelog
 git+https://github.com/sqlalchemyorg/sphinx-paramlinks.git#egg=sphinx-paramlinks
 git+https://github.com/sqlalchemyorg/zzzeeksphinx.git#egg=zzzeeksphinx
-sphinx-copybutton
+sphinx-copybutton==0.5.1
 sphinx-autobuild
 typing-extensions