|
13 | 13 | # All configuration values have a default; values that are commented out |
14 | 14 | # serve to show the default. |
15 | 15 |
|
| 16 | +# Attempt to import the version dynamically from GitHub tag. |
| 17 | +try: |
| 18 | + fullversion = version("diffpy.pdfgui") |
| 19 | +except Exception: |
| 20 | + fullversion = "No version found. The correct version will appear in the released version." # noqa: E501 |
| 21 | + |
16 | 22 | import sys |
17 | 23 | import time |
18 | 24 | from importlib.metadata import version |
|
42 | 48 | "sphinx.ext.todo", |
43 | 49 | "sphinx.ext.viewcode", |
44 | 50 | "sphinx.ext.intersphinx", |
| 51 | + "sphinx_copybutton", |
45 | 52 | "sphinx_rtd_theme", |
46 | 53 | "m2r", |
47 | 54 | ] |
|
64 | 71 | project = "diffpy.pdfgui" |
65 | 72 | copyright = "%Y, The Trustees of Columbia University in the City of New York" |
66 | 73 |
|
| 74 | +# For sphinx_copybutton extension. |
| 75 | +# Do not copy "$" for shell commands in code-blocks. |
| 76 | +copybutton_prompt_text = r"^\$ " |
| 77 | +copybutton_prompt_is_regexp = True |
| 78 | + |
67 | 79 | # The version info for the project you're documenting, acts as replacement for |
68 | 80 | # |version| and |release|, also used in various other places throughout the |
69 | 81 | # built documents. |
|
123 | 135 | # |
124 | 136 | html_theme = "sphinx_rtd_theme" |
125 | 137 |
|
| 138 | +html_context = { |
| 139 | + "display_github": True, |
| 140 | + "github_user": "diffpy", |
| 141 | + "github_repo": "diffpy.pdfgui", |
| 142 | + "github_version": "main", |
| 143 | + "conf_py_path": "/doc/source/", |
| 144 | +} |
| 145 | + |
126 | 146 | # Theme options are theme-specific and customize the look and feel of a theme |
127 | 147 | # further. For a list of options available for each theme, see the |
128 | 148 | # documentation. |
|
158 | 178 | # Add any extra paths that contain custom files (such as robots.txt or |
159 | 179 | # .htaccess) here, relative to this directory. These files are copied |
160 | 180 | # directly to the root of the documentation. |
161 | | -html_extra_path = ["../manual"] |
| 181 | +html_extra_path = [] |
162 | 182 |
|
163 | 183 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
164 | 184 | # using the given strftime format. |
|
221 | 241 | # (source start file, target name, title, |
222 | 242 | # author, documentclass [howto, manual, or own class]). |
223 | 243 | latex_documents = [ |
224 | | - ("index", "diffpy.pdfgui.tex", "diffpy.pdfgui Documentation", ab_authors, "manual"), |
| 244 | + ( |
| 245 | + "index", |
| 246 | + "diffpy.pdfgui.tex", |
| 247 | + "diffpy.pdfgui Documentation", |
| 248 | + ab_authors, |
| 249 | + "manual", |
| 250 | + ), |
225 | 251 | ] |
226 | 252 |
|
227 | 253 | # The name of an image file (relative to this directory) to place at the top of |
|
249 | 275 |
|
250 | 276 | # One entry per manual page. List of tuples |
251 | 277 | # (source start file, name, description, authors, manual section). |
252 | | -man_pages = [("index", "diffpy.pdfgui", "diffpy.pdfgui Documentation", ab_authors, 1)] |
| 278 | +man_pages = [ |
| 279 | + ( |
| 280 | + "index", |
| 281 | + "diffpy.pdfgui", |
| 282 | + "diffpy.pdfgui Documentation", |
| 283 | + ab_authors, |
| 284 | + 1, |
| 285 | + ) |
| 286 | +] |
253 | 287 |
|
254 | 288 | # If true, show URL addresses after external links. |
255 | 289 | # man_show_urls = False |
|
0 commit comments