# fastcan documentation build configuration file, created by
# `sphinx-quickstart doc` on Mon Dec 11 14:00:01 2023.
#
# 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.

import importlib.metadata
from datetime import datetime

# project root
# sys.path.insert(0, os.path.abspath(".."))
# General information about the project.
project = "fastcan"
copyright = f"{datetime.now().year}, fastcan developers (MIT License)"

# 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.
#

# The full version, including alpha/beta/rc tags.
release = importlib.metadata.version(project)

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

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
    "sphinx.ext.doctest",
    # Core Sphinx library for auto html doc generation from docstrings
    "sphinx.ext.autodoc",
    # Create neat summary tables for modules/classes/methods etc
    "sphinx.ext.autosummary",
    # Support for NumPy and Google style docstrings
    "sphinx.ext.napoleon",
    # Link to other project's documentation (see mapping below)
    "sphinx.ext.intersphinx",
]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]

autodoc_default_options = {"members": True, "inherited-members": True}

# generate autosummary even if no references
autosummary_generate = True

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
# Third-party theme: pip install furo
html_theme = "furo"
html_static_path = ["images"]


# intersphinx configuration
intersphinx_mapping = {
    "sklearn": ("https://scikit-learn.org/stable", None),
}

# add substitutions that should be available in every file
rst_prolog = """
.. |numpy_dtype| replace:: numpy data type
.. _numpy_dtype: https://numpy.org/doc/stable/user/basics.types.html

.. |sklearn_cython_dtype| replace:: sklearn cython data type
.. _sklearn_cython_dtype: https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/utils/_typedefs.pxd

.. |sphinx_link| replace:: rst Markup Spec
.. _sphinx_link: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html
"""
