File: conf.py

package info (click to toggle)
django-tables 1.14.2-1~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 1,260 kB
  • sloc: python: 7,277; makefile: 124
file content (54 lines) | stat: -rw-r--r-- 1,359 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# coding: utf-8
import os
import re
import sys

import sphinx_rtd_theme

from recommonmark.parser import CommonMarkParser

os.environ['DJANGO_SETTINGS_MODULE'] = 'example.settings'

# import project
sys.path.insert(0, os.path.abspath('../'))

project = 'django-tables2'
with open('../django_tables2/__init__.py', 'rb') as f:
    release = re.search('__version__ = \'(.+?)\'', f.read().decode('UTF8')).group(1)
version = release.rpartition('.')[0]


default_role = 'py:obj'

# allow markdown to be able to include the CHANGELOG.md
source_parsers = {
    '.md': CommonMarkParser,
}
source_suffix = ['.rst', '.md']

# symlink CHANGELOG.md from repo root to the pages dir.
basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
filename = 'CHANGELOG.md'
target = os.path.join(basedir, 'docs', 'pages', filename)
if not os.path.islink(target):
    os.symlink(os.path.join(basedir, filename), target)

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

intersphinx_mapping = {
    'python': ('/usr/share/doc/python2.7-doc/html', None),
    'django': ('/usr/share/doc/python-django-doc/html', None),
}


master_doc = 'index'

html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_static_path = ['_static']