|
| 1 | +# Configuration file for the Sphinx documentation builder. |
| 2 | +# Current versions: |
| 3 | +# sphinx 4.2.0 |
| 4 | +# sphinxx-book-theme 1.0.1 |
| 5 | +# python 3.9.7 |
| 6 | +# myst-parser 0.18.1 |
| 7 | +# nbsphinx 0.9.2 |
| 8 | +# sphinxcontrib-bibtex 2.5.0 |
| 9 | +# |
| 10 | +# This file only contains a selection of the most common options. For a full |
| 11 | +# list see the documentation: |
| 12 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 13 | + |
| 14 | +# If you are using notebooks, copy the latest versions into the docs directory so you do not have to |
| 15 | +# keep multiple copies. |
| 16 | +import shutil |
| 17 | +nbdir = '../notebooks' |
| 18 | +docdir = './notebooks' |
| 19 | + |
| 20 | +try: |
| 21 | + shutil.copytree(nbdir,docdir) |
| 22 | +except FileExistsError: |
| 23 | + shutil.rmtree(docdir) |
| 24 | + shutil.copytree(nbdir,docdir) |
| 25 | + |
| 26 | +# -- Path setup -------------------------------------------------------------- |
| 27 | + |
| 28 | +# If extensions (or modules to document with autodoc) are in another directory, |
| 29 | +# add these directories to sys.path here. If the directory is relative to the |
| 30 | +# documentation root, use os.path.abspath to make it absolute, like shown here. |
| 31 | +# |
| 32 | +import os |
| 33 | +import sys |
| 34 | +sys.path.insert(0, os.path.abspath('..')) |
| 35 | + |
| 36 | +# -- Project information ----------------------------------------------------- |
| 37 | +# This template is derived from the projects GDMATE, ASPECT, and Rayleigh |
| 38 | +project = 'Manual Template' |
| 39 | +copyright = '2023 Computational Infrastructure for Geodynamics' |
| 40 | +author = 'Lorraine J. Hwang' |
| 41 | + |
| 42 | + |
| 43 | +# -- General configuration --------------------------------------------------- |
| 44 | + |
| 45 | +# Add any Sphinx extension module names here, as strings. They can be |
| 46 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 47 | +# ones. |
| 48 | +extensions = [ |
| 49 | + "nbsphinx", |
| 50 | + "sphinx.ext.autodoc", |
| 51 | + "sphinx.ext.autosummary", |
| 52 | + "sphinxcontrib.bibtex", |
| 53 | + "myst_parser" |
| 54 | +] |
| 55 | + |
| 56 | +autosummary_imported_members = True |
| 57 | + |
| 58 | +# Add any paths that contain templates here, relative to this directory. |
| 59 | +templates_path = ['_templates'] |
| 60 | + |
| 61 | +# List of patterns, relative to source directory, that match files and |
| 62 | +# directories to ignore when looking for source files. |
| 63 | +# This pattern also affects html_static_path and html_extra_path. |
| 64 | +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 65 | +nbsphinx_allow_errors = True |
| 66 | +nbsphinx_execute = 'never' |
| 67 | + |
| 68 | +# -- Options for HTML output ------------------------------------------------- |
| 69 | + |
| 70 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
| 71 | +# a list of builtin themes. |
| 72 | +# |
| 73 | + |
| 74 | +html_theme = 'sphinx_book_theme' |
| 75 | +html_theme_options = { |
| 76 | + "collapse_navigation": True, |
| 77 | + "navigation_depth": 3, |
| 78 | + "show_toc_level": 3, |
| 79 | + "repository_url": "https://github.com/geodynamics/software_template/", |
| 80 | + "repository_branch": "main", |
| 81 | + "path_to_docs":".", |
| 82 | + "icon_links": [ |
| 83 | + { |
| 84 | + "name": "GitHub", |
| 85 | + "url": "https://github.com/geodynamics/software_template/", |
| 86 | + "icon": "fab fa-github-square", |
| 87 | + }, |
| 88 | + ], |
| 89 | + "show_navbar_depth": 1, |
| 90 | + "use_repository_button": True, |
| 91 | + "use_edit_page_button": True, |
| 92 | + "use_issues_button": True, |
| 93 | + "logo": { |
| 94 | + "text": "My Project Title", |
| 95 | + |
| 96 | + }, |
| 97 | + "home_page_in_toc": True, |
| 98 | + "primary_sidebar_end": "navbar_end.html", |
| 99 | + } |
| 100 | + |
| 101 | +html_logo = "_static/cig_logo_dots.png" |
| 102 | + |
| 103 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 104 | +# relative to this directory. They are copied after the builtin static files, |
| 105 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 106 | +html_static_path = ['_static'] |
| 107 | + |
| 108 | + |
| 109 | +# Add bibtex and generate a bibliography |
| 110 | +bibtex_bibfiles = ["references.bib"] |
| 111 | +bibtex_default_style = "alpha" |
| 112 | +bibtex_reference_style = "author_year" |
| 113 | + |
| 114 | +# If true, figures, tables and code-blocks are automatically numbered if they have a caption. |
| 115 | +numfig = True |
0 commit comments