-
Notifications
You must be signed in to change notification settings - Fork 28
/
conf.py
117 lines (88 loc) · 3.14 KB
/
conf.py
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# -*- coding: utf-8 -*-
#
# MongoDB documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 3 09:58:40 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
import sys
import os.path
import datetime
from sphinx.errors import SphinxError
from giza.config.runtime import RuntimeStateConfig
from giza.config.helper import fetch_config, get_versions, get_manual_path
conf = fetch_config(RuntimeStateConfig())
sconf = conf.system.files.data.sphinx_local
sys.path.append(os.path.join(conf.paths.projectroot,
conf.paths.buildsystem, 'sphinxext'))
# -- General configuration ----------------------------------------------------
needs_sphinx = '1.0'
extensions = [
'sphinx.ext.extlinks',
'sphinx.ext.todo',
'mongodb',
'directives',
'intermanual',
'fasthtml'
]
locale_dirs = [os.path.join(conf.paths.projectroot, conf.paths.locale)]
gettext_compact = False
templates_path = ['.templates']
exclude_patterns = []
source_suffix = '.txt'
master_doc = sconf.master_doc
language = 'en'
project = sconf.project
copyright = u'2008-{0}'.format(datetime.date.today().year)
version = conf.version.branch
release = conf.version.release
rst_epilog = '\n'.join([
'.. |branch| replace:: ``{0}``'.format(conf.git.branches.current),
'.. |copy| unicode:: U+000A9',
'.. |year| replace:: {0}'.format(datetime.date.today().year),
'.. |hardlink| replace:: http://docs.mongodb.com/ruby-driver',
])
pygments_style = 'sphinx'
extlinks = {
'manual': ('https://www.mongodb.com/docs/manual%s', ''),
'drivers': ('https://www.mongodb.com/docs/drivers%s', ''),
}
# add `extlinks` for each published version.
for i in conf.git.branches.published:
extlinks[i] = (''.join([conf.project.url, '/', i, '%s']), '')
intersphinx_mapping = {}
intersphinx_mapping = {}
for i in conf.system.files.data.intersphinx:
intersphinx_mapping[i.name] = (i.url, os.path.join(conf.paths.projectroot,
conf.paths.output,
i.path))
languages = []
# -- Options for HTML output ---------------------------------------------------
html_theme = sconf.theme.name
html_theme_path = [os.path.join(conf.paths.buildsystem, 'themes')]
html_title = conf.project.title
htmlhelp_basename = 'MongoDB'
html_logo = ".static/logo-mongodb.png"
html_copy_source = False
html_domain_indices = True
html_use_index = False
html_split_index = False
html_show_sourcelink = False
html_show_sphinx = True
html_show_copyright = True
html_theme_options = {
'branch': conf.git.branches.current,
'manual_path': get_manual_path(conf),
'translations': languages,
'language': language,
'repo_name': sconf.theme.repo,
'jira_project': sconf.theme.jira,
'google_analytics': sconf.theme.google_analytics,
'project': sconf.theme.project,
'version': version,
'version_selector': get_versions(conf),
'active_branches': conf.version.active,
'stable': conf.version.stable,
'sitename': sconf.theme.sitename,
'nav_excluded': sconf.theme.nav_excluded,
}
html_sidebars = sconf.sidebars