You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2013/08/26 18:22:18 UTC
[2/6] git commit: updated refs/heads/1781-reorganize-and-improve-docs
to 26d9c02
Use acinclude.m4 as single source of project information.
There is no reason to edit two files to make the release.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/93076643
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/93076643
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/93076643
Branch: refs/heads/1781-reorganize-and-improve-docs
Commit: 930766433c59926bc577960c063448dff44ba94d
Parents: 419262f
Author: Alexander Shorin <kx...@apache.org>
Authored: Sun Aug 25 13:40:48 2013 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Sun Aug 25 13:40:48 2013 +0400
----------------------------------------------------------------------
share/doc/src/conf.py | 47 ++++++++++++++++++++++++++++++++++++++++------
1 file changed, 41 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/93076643/share/doc/src/conf.py
----------------------------------------------------------------------
diff --git a/share/doc/src/conf.py b/share/doc/src/conf.py
index 1ae44ae..9606213 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.3"
+version = '.'.join([
+ _info['LOCAL_VERSION_MAJOR'],
+ _info['LOCAL_VERSION_MINOR']
+])
-release = "1.3.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