# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
+needs_sphinx = '1.0'
+
+# prolog for various variable substitutions
+rst_prolog = ''
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
-# source_suffix = ['.rst', '.md']
+# source_suffix = ['.rst']
source_suffix = '.rst'
# The encoding of source files.
# The full version, including alpha/beta/rc tags.
release = u'?.?-?'
+install_prefix_etc = "<install_prefix>"
+
+# extract version information, installation location, other stuff we need to
+# use when building final documents
val = re.compile('^S\["([^"]+)"\]="(.*)"$')
with open('../../config.status', 'r') as cfgstatus:
for ln in cfgstatus.readlines():
if m.group(1) == 'PACKAGE_VERSION':
release = m.group(2)
version = release.split('-')[0]
+ if m.group(1) == 'CFG_SYSCONF':
+ install_prefix_etc = m.group(2)
+
+
+# add substitutions to prolog
+rst_prolog += '''
+.. |INSTALL_PREFIX_ETC| replace:: {}
+.. |PACKAGE_VERSION| replace:: {}
+'''.format(install_prefix_etc, version)
+
+
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.