aboutsummaryrefslogtreecommitdiff
path: root/docs/sphinx/conf.py.in
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@kde.org>2014-04-10 21:38:09 +0100
committerAlex Merry <alex.merry@kde.org>2014-04-11 21:12:58 +0100
commitc20d22c951e61a06701f6c2201add7c11915e7c5 (patch)
treea8f375967eaeeceffac6da5098700b4563bf2306 /docs/sphinx/conf.py.in
parentddd33b850bb519174511a34eeda40af69a1f7144 (diff)
downloadextra-cmake-modules-c20d22c951e61a06701f6c2201add7c11915e7c5.tar.gz
extra-cmake-modules-c20d22c951e61a06701f6c2201add7c11915e7c5.tar.bz2
Add documentation generation using Sphinx
This is deliberately modelled very closely on CMake's documentation system. It's a hefty patch, because it involved changing all the documentation to be in reStructuredText format. I also cleaned up the copyright/license statements at the same time. Note that the find modules contain the full license, due to the fact that ecm_use_find_module() copies them out of the ECM distribution.
Diffstat (limited to 'docs/sphinx/conf.py.in')
-rw-r--r--docs/sphinx/conf.py.in63
1 files changed, 63 insertions, 0 deletions
diff --git a/docs/sphinx/conf.py.in b/docs/sphinx/conf.py.in
new file mode 100644
index 00000000..24ba82c8
--- /dev/null
+++ b/docs/sphinx/conf.py.in
@@ -0,0 +1,63 @@
+#=============================================================================
+# CMake - Cross Platform Makefile Generator
+# Copyright 2000-2013 Kitware, Inc., Insight Software Consortium
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+import sys
+import os
+import re
+import glob
+
+sys.path.insert(0, r'@conf_path@')
+
+source_suffix = '.rst'
+master_doc = 'index'
+
+project = 'Extra CMake Modules'
+copyright = 'KDE Developers'
+version = '@conf_version@' # feature version
+release = '@conf_release@' # full version string
+
+primary_domain = 'ecm'
+
+exclude_patterns = []
+
+extensions = ['ecm']
+templates_path = ['@conf_path@/templates']
+
+ecm_manuals = sorted(glob.glob(r'@conf_docs@/manual/*.rst'))
+ecm_manual_description = re.compile('^\.\. ecm-manual-description:(.*)$')
+man_pages = []
+for fpath in ecm_manuals:
+ try:
+ name, sec, rst = os.path.basename(fpath).split('.')
+ desc = None
+ f = open(fpath, 'r')
+ for l in f:
+ m = ecm_manual_description.match(l)
+ if m:
+ desc = m.group(1).strip()
+ break
+ f.close()
+ if desc:
+ man_pages.append(('manual/%s.%s' % (name, sec),
+ name, desc, [], int(sec)))
+ else:
+ sys.stderr.write("ERROR: No ecm-manual-description in '%s'\n" % fpath)
+ except Exception, e:
+ sys.stderr.write("ERROR: %s\n" % str(e))
+man_show_urls = False
+
+html_show_sourcelink = True
+html_static_path = ['@conf_path@/static']
+html_style = 'ecm.css'
+html_theme = 'default'
+html_title = 'Extra CMake Modules %s Documentation' % release
+html_short_title = '%s Documentation' % release
+html_favicon = '@conf_path@/kde-favicon.ico'