<filename>docs/sphinx/conf.py
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import sys
from pathlib import Path
from typing import Any, Dict
import toml

WORKING_DIR = Path.cwd()
SERVICE_DIR = WORKING_DIR / Path("../../morpho").resolve()
ROOT_DIR = SERVICE_DIR.parent
TOML_DIR = ROOT_DIR

sys.path.append(str(ROOT_DIR.absolute()))
sys.path.append(str(SERVICE_DIR.absolute()))

def setup(app):
    app.add_css_file('css/main.css')


# -- Project information -----------------------------------------------------

# config = ConfigParser()
with Path(Path(TOML_DIR) / Path("pyproject.toml")).open("r") as file:
    toml_config: Dict[str, Any] = toml.load(file)

tool = toml_config["tool"]["poetry"]
project = tool["name"]
author = tool["authors"][0].split()[0]
copyright = "2020, {}".format(author)
version = tool["version"]


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.viewcode",
    "sphinx.ext.todo",
    "sphinx.ext.napoleon",
    "sphinxcontrib.spelling",
    "sphinxcontrib.openapi",
    "sphinx_issues"
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_material"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

html_css_files = [
    "css/main.css"
]

pygments_style = "solarized-light"


# -- HTML theme settings -----------------------------------------------------

html_show_sourcelink = True
html_sidebars = {
    "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
}

# -- Extension configuration -------------------------------------------------

# -- Sphinx Issues options

# GitHub repo
issues_github_path = "B4rtware/morpho"

# -- Material theme options (see theme.conf for more information)
html_theme_options = {

    # Set the name of the project to appear in the navigation.
    'nav_title': 'Morpho',

    # Set you GA account ID to enable tracking
    # 'google_analytics_account': '<KEY>',

    # Specify a base_url used to generate sitemap.xml. If not
    # specified, then no sitemap will be built.
    # 'base_url': 'https://bashtage.github.io/sphinx-material/',
    "html_prettify": False,

    # Include the master document at the top of the page in the breadcrumb bar.
    # You must also set this to true if you want to override the rootrellink block, in which
    # case the content of the overridden block will appear
    "master_doc": False,

    # Set the color and the accent color
    'color_primary': 'teal',
    'color_accent': 'light-teal',

    # Set the repo location to get a badge with stats
    'repo_url': 'https://github.com/B4rtware/morpho',
    "repo_type": "github",
    'repo_name': 'B4rtware/morpho',

    # disable heros
    "heroes": [],

    # Visible levels of the global TOC; -1 means unlimited
    'globaltoc_depth': 2,
    # If False, expand all TOC entries
    # 'globaltoc_collapse': False,
    # If True, show hidden TOC entries
    # 'globaltoc_includehidden': False,
}

# -- Options for todo extension ----------------------------------------------

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
<filename>docs/sphinx/conf.py
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import sys
from pathlib import Path
from typing import Any, Dict
import toml

WORKING_DIR = Path.cwd()
SERVICE_DIR = WORKING_DIR / Path("../../morpho").resolve()
ROOT_DIR = SERVICE_DIR.parent
TOML_DIR = ROOT_DIR

sys.path.append(str(ROOT_DIR.absolute()))
sys.path.append(str(SERVICE_DIR.absolute()))

def setup(app):
    app.add_css_file('css/main.css')


# -- Project information -----------------------------------------------------

# config = ConfigParser()
with Path(Path(TOML_DIR) / Path("pyproject.toml")).open("r") as file:
    toml_config: Dict[str, Any] = toml.load(file)

tool = toml_config["tool"]["poetry"]
project = tool["name"]
author = tool["authors"][0].split()[0]
copyright = "2020, {}".format(author)
version = tool["version"]


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.viewcode",
    "sphinx.ext.todo",
    "sphinx.ext.napoleon",
    "sphinxcontrib.spelling",
    "sphinxcontrib.openapi",
    "sphinx_issues"
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_material"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

html_css_files = [
    "css/main.css"
]

pygments_style = "solarized-light"


# -- HTML theme settings -----------------------------------------------------

html_show_sourcelink = True
html_sidebars = {
    "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
}

# -- Extension configuration -------------------------------------------------

# -- Sphinx Issues options

# GitHub repo
issues_github_path = "B4rtware/morpho"

# -- Material theme options (see theme.conf for more information)
html_theme_options = {

    # Set the name of the project to appear in the navigation.
    'nav_title': 'Morpho',

    # Set you GA account ID to enable tracking
    # 'google_analytics_account': '<KEY>',

    # Specify a base_url used to generate sitemap.xml. If not
    # specified, then no sitemap will be built.
    # 'base_url': 'https://bashtage.github.io/sphinx-material/',
    "html_prettify": False,

    # Include the master document at the top of the page in the breadcrumb bar.
    # You must also set this to true if you want to override the rootrellink block, in which
    # case the content of the overridden block will appear
    "master_doc": False,

    # Set the color and the accent color
    'color_primary': 'teal',
    'color_accent': 'light-teal',

    # Set the repo location to get a badge with stats
    'repo_url': 'https://github.com/B4rtware/morpho',
    "repo_type": "github",
    'repo_name': 'B4rtware/morpho',

    # disable heros
    "heroes": [],

    # Visible levels of the global TOC; -1 means unlimited
    'globaltoc_depth': 2,
    # If False, expand all TOC entries
    # 'globaltoc_collapse': False,
    # If True, show hidden TOC entries
    # 'globaltoc_includehidden': False,
}

# -- Options for todo extension ----------------------------------------------

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # -- Project information ----------------------------------------------------- # config = ConfigParser() # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. # Add any paths that contain templates here, relative to this directory. # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages.  See the documentation for # a list of builtin themes. # # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". # -- HTML theme settings ----------------------------------------------------- # -- Extension configuration ------------------------------------------------- # -- Sphinx Issues options # GitHub repo # -- Material theme options (see theme.conf for more information) # Set the name of the project to appear in the navigation. # Set you GA account ID to enable tracking # 'google_analytics_account': '<KEY>', # Specify a base_url used to generate sitemap.xml. If not # specified, then no sitemap will be built. # 'base_url': 'https://bashtage.github.io/sphinx-material/', # Include the master document at the top of the page in the breadcrumb bar. # You must also set this to true if you want to override the rootrellink block, in which # case the content of the overridden block will appear # Set the color and the accent color # Set the repo location to get a badge with stats # disable heros # Visible levels of the global TOC; -1 means unlimited # If False, expand all TOC entries # 'globaltoc_collapse': False, # If True, show hidden TOC entries # 'globaltoc_includehidden': False, # -- Options for todo extension ---------------------------------------------- # If true, `todo` and `todoList` produce output, else they produce nothing.