#
# coding=utf-8
"""conf - Sphinx configuration information"""
# Copyright © 2010, 2011, 2012, 2013  James Rowe <jnrowe@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

import os
import sys

from subprocess import (CalledProcessError, check_output)

root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.insert(0, root_dir)

import hubugs

extensions = \
    ["sphinx.ext.%s" % ext for ext in ['autodoc', 'intersphinx', ]] \
    + ["sphinxcontrib.%s" % ext for ext in ['cheeseshop']]

master_doc = 'index'
source_suffix = '.rst'

project = u'hubugs'
copyright = hubugs.__copyright__

version = ".".join(map(str, hubugs._version.tuple[:2]))
release = hubugs._version.dotted

pygments_style = 'sphinx'
html_theme_options = {
    "externalrefs": True,
}
try:
    html_last_updated_fmt = check_output(['git', 'log',
                                          "--pretty=format:'%ad [%h]'",
                                          '--date=short', '-n1'])
except CalledProcessError:
    pass

man_pages = [
    ('hubugs.1', 'hubugs', u'hubugs Documentation', [u'James Rowe'], 1)
]

intersphinx_mapping = {
    'jinja': ('http://jinja.pocoo.org/docs/',
              os.getenv('SPHINX_JINJA_OBJECTS')),
    'python': ('http://docs.python.org/', os.getenv('SPHINX_PYTHON_OBJECTS')),
}
