copy button

This commit is contained in:
Xi Yan 2024-10-29 16:58:44 -07:00
parent 441ad707cc
commit de791b3e4f
4 changed files with 22 additions and 9 deletions

View file

@ -19,7 +19,7 @@ author = "Meta"
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = ["myst_parser", "sphinx_rtd_theme"]
extensions = ["myst_parser", "sphinx_rtd_theme", "sphinx_copybutton"]
html_theme = "sphinx_rtd_theme"
@ -50,6 +50,18 @@ myst_enable_extensions = [
"tasklist",
]
# Copy button settings
copybutton_prompt_text = "$ " # for bash prompts
copybutton_prompt_is_regexp = True
copybutton_remove_prompts = True
copybutton_line_continuation_character = "\\"
# Source suffix
source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output