# 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 os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

# Sinon l'ajouter dans PYTHONPATH
# set PYTHONPATH=c:\chemin\vers\doc
# import pathlib
# import sys
# sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix())

import os
import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, '/opt/wapt')
print(sys.path)

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

project = 'WAPT Setuphelpers'
copyright = '2023, Tranquil IT'
author = 'Tranquil IT'

# The full version, including alpha/beta/rc tags
version = '2.6.1.17870'
release = '2.6.1.17870'


# -- 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_rtd_theme',
    "sphinx.ext.doctest",
    "sphinx.ext.viewcode",
    "sphinx.ext.autodoc",
    "sphinx_copybutton",
    "autodocsumm",
]

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

# 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 = []


# 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']


language = "en"
locale_dirs = ["locale/"]
gettext_compact = False

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

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []

# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False

# If true, `todo` and `todoList` produce output, else they produce nothing.
# todo_include_todos = True

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

try:
    import sphinx_rtd_theme

    html_theme = "sphinx_rtd_theme"
    html_favicon = "_static/favicon.ico"
    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
    html_context = {
        "css_files": [
            "_static/css/custom.css",  # overrides for wide tables in RTD theme
            "_static/css/ribbon.css",
            "_static/css/navbar.css",
            "_static/theme_overrides.css",  # override wide tables in RTD theme
        ],
    }


except ImportError as e:
    print("there was some error : %s" % e)
    #html_theme = "alabaster"
    html_theme = "sphinx_rtd_theme"
    html_theme_path = []