summaryrefslogtreecommitdiffstats
path: root/scripts/external_libs/dpkt-1.8.6.2/docs/conf.py
blob: 6dfc9fc483c54426566a7b1adeaa6a3ee62684da (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# encoding: utf-8

"""dpkt documentation build configuration file"""

from __future__ import unicode_literals

import os
import re
import sys
import types
import mock


def get_version(filename):
    init_py = open(filename).read()
    metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py))
    return metadata['version']


# -- Workarounds to have autodoc generate API docs ----------------------------

sys.path.insert(0, os.path.abspath('..'))


# Mock any objects that we might need to
foo = mock.Mock()
foo.__version__ = '0.1.1'
sys.modules['foo'] = foo


# -- General configuration ----------------------------------------------------
needs_sphinx = '1.0'
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.extlinks',
    'sphinx.ext.intersphinx',
    'sphinx.ext.viewcode',
    'sphinx.ext.autosummary',
    'sphinxcontrib.napoleon'
]

templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'

project = 'dpkt'
copyright = '2009-2015 Dug Song and contributors'

release = get_version('../dpkt/__init__.py')
version = '.'.join(release.split('.')[:2])

exclude_patterns = ['_build']

pygments_style = 'sphinx'

modindex_common_prefix = ['dpkt.']

autodoc_default_flags = ['members', 'undoc-members', 'show-inheritance']
autodoc_member_order = 'bysource'


# -- Options for HTML output --------------------------------------------------
html_theme = 'default'
html_static_path = ['_static']

html_use_modindex = True
html_use_index = True
html_split_index = False
html_show_sourcelink = True

htmlhelp_basename = 'dpkt'

# -- Options for extlink extension --------------------------------------------
extlinks = {
    'issue': ('https://github.com/kbandla/dpkt/issues/%s', '#'),
}