# -*- coding: utf-8 -*-
#
# python_example documentation build configuration file, created by
# sphinx-quickstart on Fri Feb 26 00:29:33 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

from pathlib import Path

with open("index.rst.in") as f:
    stub = f.read()

with open(Path("..") / "README.rst") as f:
    readme = f.read().replace(
        "https://hdembinski.github.io/jacobi/_images/", "_static/"
    )

with open("index.rst", "w") as f:
    f.write(stub + "\n" + readme)

extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.intersphinx",
    "sphinx.ext.autosummary",
    "sphinx.ext.napoleon",
    "sphinx.ext.doctest",
]

autosummary_generate = True

# General information about the project.
project = "Jacobi"
copyright = "2021, Hans Dembinski"
author = "Hans Dembinski"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
with open(Path() / ".." / "src" / "jacobi" / "_version.py") as f:
    d = {}
    exec(f.read(), d)

# The full version, including alpha/beta/rc tags.
release = d["version"]

# The short X.Y version.
version = ".".join(release.split(".")[:2])

language = "en"

exclude_patterns = ["_build"]

pygments_style = "sphinx"

# -- 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_rtd_theme"

html_static_path = ["_static"]
