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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
## Licensed under the Apache License, Version 2.0 (the "License"); you may not
## use this file except in compliance with the License. You may obtain a copy of
## the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
## License for the specific language governing permissions and limitations under
## the License.
import datetime
import os
import re
import sys
sys.path.insert(0, os.path.abspath('../ext'))
extensions = ["sphinx.ext.todo", "sphinx.ext.extlinks", 'github',
'httpdomain', 'configdomain']
_info = {}
_regex = re.compile('m4_define\(\[(.+)\],\s+\[(.+)\]\)')
_acinclude_m4 = '../../../acinclude.m4'
_acinclude_m4_in = '../../../acinclude.m4.in'
if os.path.exists(_acinclude_m4):
_source = _acinclude_m4
elif os.path.exists(_acinclude_m4_in):
_source = _acinclude_m4_in
else:
_source = None
if _source is not None:
_info = dict(_regex.findall(open(_source).read()))
else:
raise ValueError('''Project information source wasn't found. We're assume
that it's located within "acinclude.m4" file at the root of the project, but
looks like there is no such file there.''')
source_suffix = ".rst"
nitpicky = True
version = '.'.join([
_info['LOCAL_VERSION_MAJOR'],
_info['LOCAL_VERSION_MINOR']
])
release = '.'.join([
_info['LOCAL_VERSION_MAJOR'],
_info['LOCAL_VERSION_MINOR'],
_info['LOCAL_VERSION_REVISION']
])
if _info.get('LOCAL_VERSION_RELEASE') == '.%revision%':
release += '-dev'
elif _info.get('LOCAL_VERSION_RELEASE'):
# jenkins hack, the release name is too long or uses
# characters that cause pain down the road. Example:
# 1.6.0+build.jenkins-ERLANG_VERSION=R14B04,label=Mac-OS-10-8-2-832-76-g2996574
# which breaks the LaTeX PDF build. Let’s strip this
# down to the git hash at the end.
if 'jenkins' in _info['LOCAL_VERSION_RELEASE']:
release += _info['LOCAL_VERSION_RELEASE'][-9:]
else: # regular case
release += _info['LOCAL_VERSION_STAGE'] + _info['LOCAL_VERSION_RELEASE']
project = _info['LOCAL_PACKAGE_NAME']
copyright = '%d, %s' % (
datetime.datetime.now().year,
_info['LOCAL_PACKAGE_AUTHOR_NAME']
)
highlight_language = "json"
primary_domain = "http"
pygments_style = "sphinx"
html_theme = "couchdb"
html_theme_path = ['../templates']
templates_path = ["../templates"]
html_static_path = ["../static"]
html_title = ' '.join([
project,
version,
'Documentation'
])
html_style = "rtd.css"
html_logo = "../images/logo.png"
html_favicon = "../images/favicon.ico"
html_use_index = False
html_additional_pages = {
'download': 'pages/download.html',
'index': 'pages/index.html'
}
html_context = {
"ga_code": "UA-658988-6"
}
html_sidebars = {
"**": [
"searchbox.html",
"localtoc.html",
"relations.html",
"utilities.html",
"help.html",
"tracking.html",
]
}
text_newlines = "native"
latex_documents = [(
"contents",
"CouchDB.tex",
project,
"",
"manual",
True
)]
latex_elements = {
"papersize": "a4paper"
}
texinfo_documents = [(
"contents",
"CouchDB",
project,
"",
"CouchDB",
"The Apache CouchDB database",
"Databases",
True
)]
extlinks = {
'issue': ('%s-%%s' % _info['LOCAL_BUG_URI'], 'COUCHDB-'),
'commit': ('https://git-wip-us.apache.org/repos/asf?p=couchdb.git;a=commit;h=%s', '#')
}
github_project = 'apache/couchdb'
html_context['git_branch'] = github_branch = 'master'
github_docs_path = 'share/doc/src'
del _info, _regex, _acinclude_m4, _acinclude_m4_in, _source
|