Skip to content

Commit

Permalink
docs: Use sphinx-copybutton prompt regex to fully capture examples (#…
Browse files Browse the repository at this point in the history
…1617)

* Add copybutton_prompt_text regex support to allow for the prompt character to be `>>>`, `$`, or `...` to handle newlines
   - c.f. https://sphinx-copybutton.readthedocs.io/en/latest/#strip-and-configure-input-prompts-for-code-cells
* Add support for HERE-document syntax with $ prompt
* Update minimum required version of sphinx-copybutton to v0.3.2 to ensure HERE-document support
  • Loading branch information
matthewfeickert authored Oct 6, 2021
1 parent 6db5223 commit 7ecaa63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ def setup(app):
htmlhelp_basename = 'pyhfdoc'

# sphinx-copybutton configuration
copybutton_prompt_text = ">>> "
copybutton_prompt_text = r">>> |\.\.\. |\$ "
copybutton_prompt_is_regexp = True
copybutton_here_doc_delimiter = "EOF"

# -- Options for LaTeX output ---------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
'nbsphinx',
'ipywidgets',
'sphinx-issues',
'sphinx-copybutton>0.2.9',
'sphinx-copybutton>=0.3.2',
]
)
)
Expand Down

0 comments on commit 7ecaa63

Please sign in to comment.