# -*- coding: utf-8 -*-
#
# 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.

import inspect
import os
import shutil
import sys

from sphinx_gallery.sorting import FileNameSortKey

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

# -- 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.intersphinx",
    "sphinx.ext.todo",
    "sphinx.ext.viewcode",
    "sphinx.ext.coverage",
    "sphinx.ext.doctest",
    "sphinx.ext.ifconfig",
    "sphinx.ext.mathjax",
    "sphinx.ext.napoleon",
    "sphinx_gallery.gen_gallery",
    "autoapi.extension",
]

autoapi_dirs = ["../osl_dynamics"]

sphinx_gallery_conf = {
    "examples_dirs": "tutorials",        # Contains source .py files
    "gallery_dirs": "tutorials_build",   # Where to output rendered gallery
    "filename_pattern": r".*\.py",       # Include all .py files, can specific a particular set tutorials, e.g. r"1-.*\.py" for 1-*.py tutorials
    "run_stale_examples": True,          # Force re-run when building
    "within_subsection_order": FileNameSortKey,  # Build in alphabetical order of the filenames
}

# The suffix of source filenames.
source_suffix = ".rst"

# The master toctree document.
master_doc = "index"

# General information about the project.
project = "osl-dynamics"
copyright = "2020, OHBA Methods Group, University of Oxford"
author = "OHBA Methods Group, University of Oxford"

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

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

html_theme = "pydata_sphinx_theme"

html_title = "osl-dynamics"
html_short_title = "osl-dynamics"

html_logo = "https://avatars.githubusercontent.com/u/15248840?s=200&v=4"

htmlhelp_basename = "osl-dynamics-doc"

html_theme_options = {
    "gitlab_url": "https://github.com/OHBA-analysis/osl-dynamics",
    "show_nav_level": 2,
    "logo": {"text": "OSL Dynamics"},
}

# Remove "Section Navigation"
html_sidebars = {
    "install": [],
    "documentation": [],
    "tutorials_build/*": [],
    "faq": [],
}

# Remove "This Page; Show Source"
html_show_sourcelink = False
