| 1 |
# |
| 2 |
# Configuration file for the Sphinx documentation builder. |
| 3 |
# |
| 4 |
# This file does only contain a selection of the most common options. For a |
| 5 |
# full list see the documentation: |
| 6 |
# http://www.sphinx-doc.org/en/master/config |
| 7 |
|
| 8 |
# -- Path setup -------------------------------------------------------------- |
| 9 |
|
| 10 |
# If extensions (or modules to document with autodoc) are in another directory, |
| 11 |
# add these directories to sys.path here. If the directory is relative to the |
| 12 |
# documentation root, use os.path.abspath to make it absolute, like shown here. |
| 13 |
# |
| 14 |
# import os |
| 15 |
# import sys |
| 16 |
# sys.path.insert(0, os.path.abspath('.')) |
| 17 |
|
| 18 |
|
| 19 |
# -- Project information ----------------------------------------------------- |
| 20 |
|
| 21 |
project = "Sphinx Copybutton" |
| 22 |
copyright = "2018, Executable Books Project" |
| 23 |
author = "Executable Books Project" |
| 24 |
|
| 25 |
# The short X.Y version |
| 26 |
version = "" |
| 27 |
# The full version, including alpha/beta/rc tags |
| 28 |
release = "" |
| 29 |
|
| 30 |
|
| 31 |
# -- General configuration --------------------------------------------------- |
| 32 |
|
| 33 |
# If your documentation needs a minimal Sphinx version, state it here. |
| 34 |
# |
| 35 |
# needs_sphinx = '1.0' |
| 36 |
|
| 37 |
# Add any Sphinx extension module names here, as strings. They can be |
| 38 |
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 39 |
# ones. |
| 40 |
extensions = [ |
| 41 |
"sphinx_copybutton", |
| 42 |
"sphinx_examples", |
| 43 |
"IPython.sphinxext.ipython_directive", |
| 44 |
"myst_nb", |
| 45 |
] |
| 46 |
|
| 47 |
# Add any paths that contain templates here, relative to this directory. |
| 48 |
templates_path = ["_templates"] |
| 49 |
|
| 50 |
# The suffix(es) of source filenames. |
| 51 |
# You can specify multiple suffix as a list of string: |
| 52 |
# |
| 53 |
# source_suffix = ['.rst', '.md'] |
| 54 |
source_suffix = ".rst" |
| 55 |
|
| 56 |
# The master toctree document. |
| 57 |
master_doc = "index" |
| 58 |
|
| 59 |
# The language for content autogenerated by Sphinx. Refer to documentation |
| 60 |
# for a list of supported languages. |
| 61 |
# |
| 62 |
# This is also used if you do content translation via gettext catalogs. |
| 63 |
# Usually you set "language" from the command line for these cases. |
| 64 |
language = None |
| 65 |
|
| 66 |
# List of patterns, relative to source directory, that match files and |
| 67 |
# directories to ignore when looking for source files. |
| 68 |
# This pattern also affects html_static_path and html_extra_path . |
| 69 |
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
| 70 |
|
| 71 |
# The name of the Pygments (syntax highlighting) style to use. |
| 72 |
pygments_style = "sphinx" |
| 73 |
|
| 74 |
|
| 75 |
# -- Options for HTML output ------------------------------------------------- |
| 76 |
|
| 77 |
# The theme to use for HTML and HTML Help pages. See the documentation for |
| 78 |
# a list of builtin themes. |
| 79 |
# |
| 80 |
html_theme = "sphinx_book_theme" |
| 81 |
# html_theme = "alabaster" |
| 82 |
# html_theme = "sphinx_rtd_theme" |
| 83 |
# html_theme = "furo" |
| 84 |
|
| 85 |
# Theme options are theme-specific and customize the look and feel of a theme |
| 86 |
# further. For a list of options available for each theme, see the |
| 87 |
# documentation. |
| 88 |
# |
| 89 |
html_theme_options = { |
| 90 |
"repository_url": "https://github.com/executablebooks/sphinx-copybutton", |
| 91 |
"use_repository_button": True, |
| 92 |
} |
| 93 |
|
| 94 |
# Add any paths that contain custom static files (such as style sheets) here, |
| 95 |
# relative to this directory. They are copied after the builtin static files, |
| 96 |
# so a file named "default.css" will overwrite the builtin "default.css". |
| 97 |
html_static_path = ["_static"] |
| 98 |
html_logo = "../sphinx_copybutton/_static/copy-button.svg" |
| 99 |
html_title = "Sphinx Copybutton" |
| 100 |
|
| 101 |
# Custom sidebar templates, must be a dictionary that maps document names |
| 102 |
# to template names. |
| 103 |
# |
| 104 |
# The default sidebars (for documents that don't match any pattern) are |
| 105 |
# defined by theme itself. Builtin themes are using these templates by |
| 106 |
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', |
| 107 |
# 'searchbox.html']``. |
| 108 |
# |
| 109 |
# html_sidebars = {} |
| 110 |
|
| 111 |
myst_enable_extensions = ["colon_fence"] |
| 112 |
|
| 113 |
# CopyButton configuration |
| 114 |
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: " |
| 115 |
copybutton_prompt_is_regexp = True |
| 116 |
copybutton_line_continuation_character = "\\" |
| 117 |
copybutton_here_doc_delimiter = "EOT" |
| 118 |
copybutton_selector = "div:not(.no-copybutton) > div.highlight > pre" |
| 119 |
|
| 120 |
# Switches for testing but shouldn't be activated in the live docs |
| 121 |
# copybutton_only_copy_prompt_lines = False |
| 122 |
# copybutton_remove_prompts = False |
| 123 |
# copybutton_image_path = "_static/clipboard.svg" # DEPRECATED: remove after next release # noqa: E501 |
| 124 |
# copybutton_image_svg = """ |
| 125 |
# <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-clipboard" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#000000" fill="none" stroke-linecap="round" stroke-linejoin="round"> # noqa: E501 |
| 126 |
# <path stroke="none" d="M0 0h24v24H0z" fill="none"/> |
| 127 |
# <path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" /> # noqa: E501 |
| 128 |
# <rect x="9" y="3" width="6" height="4" rx="2" /> |
| 129 |
# </svg> |
| 130 |
# """ |
| 131 |
|
| 132 |
|
| 133 |
# -- Options for HTMLHelp output --------------------------------------------- |
| 134 |
|
| 135 |
# Output file base name for HTML help builder. |
| 136 |
htmlhelp_basename = "SphinxCopybuttondoc" |
| 137 |
|
| 138 |
|
| 139 |
# -- Options for LaTeX output ------------------------------------------------ |
| 140 |
|
| 141 |
latex_elements = { |
| 142 |
# The paper size ('letterpaper' or 'a4paper'). |
| 143 |
# |
| 144 |
# 'papersize': 'letterpaper', |
| 145 |
# The font size ('10pt', '11pt' or '12pt'). |
| 146 |
# |
| 147 |
# 'pointsize': '10pt', |
| 148 |
# Additional stuff for the LaTeX preamble. |
| 149 |
# |
| 150 |
# 'preamble': '', |
| 151 |
# Latex figure (float) alignment |
| 152 |
# |
| 153 |
# 'figure_align': 'htbp', |
| 154 |
} |
| 155 |
|
| 156 |
# Grouping the document tree into LaTeX files. List of tuples |
| 157 |
# (source start file, target name, title, |
| 158 |
# author, documentclass [howto, manual, or own class]). |
| 159 |
latex_documents = [ |
| 160 |
( |
| 161 |
master_doc, |
| 162 |
"SphinxCopybutton.tex", |
| 163 |
"Sphinx Copybutton Documentation", |
| 164 |
"Executable Books Project", |
| 165 |
"manual", |
| 166 |
) |
| 167 |
] |
| 168 |
|
| 169 |
|
| 170 |
# -- Options for manual page output ------------------------------------------ |
| 171 |
|
| 172 |
# One entry per manual page. List of tuples |
| 173 |
# (source start file, name, description, authors, manual section). |
| 174 |
man_pages = [ |
| 175 |
(master_doc, "sphinxcopybutton", "Sphinx Copybutton Documentation", [author], 1) |
| 176 |
] |
| 177 |
|
| 178 |
|
| 179 |
# -- Options for Texinfo output ---------------------------------------------- |
| 180 |
|
| 181 |
# Grouping the document tree into Texinfo files. List of tuples |
| 182 |
# (source start file, target name, title, author, |
| 183 |
# dir menu entry, description, category) |
| 184 |
texinfo_documents = [ |
| 185 |
( |
| 186 |
master_doc, |
| 187 |
"SphinxCopybutton", |
| 188 |
"Sphinx Copybutton Documentation", |
| 189 |
author, |
| 190 |
"SphinxCopybutton", |
| 191 |
"One line description of project.", |
| 192 |
"Miscellaneous", |
| 193 |
) |
| 194 |
] |
| 195 |
|
| 196 |
|
| 197 |
def setup(app): |
| 198 |
app.add_css_file("custom.css") |