#!/usr/bin/env python3
# aiomas documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 15 17:39:34 2015.
#
# 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 datetime
import os
import sys

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd:
    import sphinx_rtd_theme

# 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('..', 'src')))

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

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.autosummary',
    'sphinx.ext.intersphinx',
    'sphinx.ext.viewcode',
]

templates_path = ['_templates']

source_suffix = '.rst'

master_doc = 'index'

authors = ['Stefan Scherfke']
project = 'aiomas'
copyright = '2014-%s, %s' % (datetime.datetime.now().year, ', '.join(authors))

version = '1.0'
release = '1.0.0'

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

pygments_style = 'sphinx'


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

if on_rtd:
    html_theme = 'default'
else:
    html_theme = 'sphinx_rtd_theme'
    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

html_static_path = ['_static']

# Output file base name for HTML help builder.
htmlhelp_basename = 'aiomasdoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
    'papersize': 'a4paper',
    'pointsize': '11pt',
    # 'preamble': '',
}

latex_documents = [
    (master_doc, 'aiomas.tex', 'aiomas Documentation',
     ''.join(authors), 'manual'),
]


# -- Options for manual page output ---------------------------------------

man_pages = [
    (master_doc, 'aiomas', 'aiomas Documentation',
     authors, 1)
]


# -- Options for Texinfo output -------------------------------------------

texinfo_documents = [
    (master_doc, 'aiomas', 'aiomas Documentation',
     ''.join(authors), 'aiomas', 'One line description of project.',
     'Miscellaneous'),
]


# Intersphinx
intersphinx_mapping = {
    'python': ('http://docs.python.org/3/', None),
    'arrow': ('https://arrow.readthedocs.org/en/latest/', None),
}

# Autodoc
autodoc_member_order = 'bysource'
