summaryrefslogtreecommitdiff
path: root/share/doc/src/conf.py
diff options
context:
space:
mode:
authorAlexander Shorin <kxepal@apache.org>2013-08-25 13:40:48 +0400
committerAlexander Shorin <kxepal@apache.org>2013-09-27 22:01:30 +0400
commit1e23d25e875d2c6d7d026c863bc2ecd9b4bb0a35 (patch)
tree7f62e3e94eabb72d5399ff77a1e35d1d624fb9d0 /share/doc/src/conf.py
parent1eb6047fd6ac8ab0deeff28cfc4012f0d867a081 (diff)
downloadcouchdb-1e23d25e875d2c6d7d026c863bc2ecd9b4bb0a35.tar.gz
Use acinclude.m4 as single source of project information.
There is no reason to edit two files to make the release.
Diffstat (limited to 'share/doc/src/conf.py')
-rw-r--r--share/doc/src/conf.py47
1 files changed, 41 insertions, 6 deletions
diff --git a/share/doc/src/conf.py b/share/doc/src/conf.py
index 2e5234a27..960621322 100644
--- a/share/doc/src/conf.py
+++ b/share/doc/src/conf.py
@@ -10,26 +10,55 @@
## 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']
+_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"
master_doc = "index"
nitpicky = True
-version = "1.4"
+version = '.'.join([
+ _info['LOCAL_VERSION_MAJOR'],
+ _info['LOCAL_VERSION_MINOR']
+])
-release = "1.4.0"
+release = '.'.join([
+ _info['LOCAL_VERSION_MAJOR'],
+ _info['LOCAL_VERSION_MINOR'],
+ _info['LOCAL_VERSION_REVISION']
+]) + _info['LOCAL_VERSION_STAGE'] + '' + _info['LOCAL_VERSION_RELEASE']
-project = u"Apache CouchDB"
+project = _info['LOCAL_PACKAGE_NAME']
-copyright = u"2013, The Apache Software Foundation"
+copyright = '%d, %s' % (
+ datetime.datetime.now().year,
+ _info['LOCAL_PACKAGE_AUTHOR_NAME']
+)
highlight_language = "json"
@@ -41,7 +70,11 @@ templates_path = ["../templates"]
html_static_path = ["../static"]
-html_title = "Apache CouchDB " + version + " Manual"
+html_title = ' '.join([
+ project,
+ version,
+ 'Manual'
+])
html_style = "rtd.css"
@@ -88,7 +121,7 @@ texinfo_documents = [(
)]
extlinks = {
- 'issue': ('https://issues.apache.org/jira/browse/COUCHDB-%s', 'COUCHDB-'),
+ 'issue': ('%s-%%s' % _info['LOCAL_BUG_URI'], 'COUCHDB-'),
'commit': ('https://git-wip-us.apache.org/repos/asf?p=couchdb.git;a=commit;h=%s', '#')
}
@@ -97,3 +130,5 @@ github_project = 'apache/couchdb'
github_branch = 'master'
github_docs_path = 'share/doc/src'
+
+del _info, _regex, _acinclude_m4, _acinclude_m4_in, _source