summaryrefslogtreecommitdiffstats
path: root/docs/conf.py
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-07-05 14:23:59 +0000
committerdim <dim@FreeBSD.org>2015-07-05 14:23:59 +0000
commite7bcad327814a78ecb8d5f5545d2e3df84c67a5c (patch)
treeac719b5984165053bf83d71142e4d96b609b9784 /docs/conf.py
parent9dd834653b811ad20382e98a87dff824980c9916 (diff)
downloadFreeBSD-src-e7bcad327814a78ecb8d5f5545d2e3df84c67a5c.zip
FreeBSD-src-e7bcad327814a78ecb8d5f5545d2e3df84c67a5c.tar.gz
Vendor import of clang trunk r241361:
https://llvm.org/svn/llvm-project/cfe/trunk@241361
Diffstat (limited to 'docs/conf.py')
-rw-r--r--docs/conf.py40
1 files changed, 35 insertions, 5 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 9030c2c..b7ed23a 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -41,7 +41,7 @@ master_doc = 'index'
# General information about the project.
project = u'Clang'
-copyright = u'2007-2014, The Clang Team'
+copyright = u'2007-2015, The Clang Team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -212,10 +212,40 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
-man_pages = [
- ('index', 'clang', u'Clang Documentation',
- [u'The Clang Team'], 1)
-]
+man_pages = []
+
+# Automatically derive the list of man pages from the contents of the command
+# guide subdirectory. This was copied from llvm/docs/conf.py.
+basedir = os.path.dirname(__file__)
+man_page_authors = u'Maintained by the Clang / LLVM Team (<http://clang.llvm.org>)'
+command_guide_subpath = 'CommandGuide'
+command_guide_path = os.path.join(basedir, command_guide_subpath)
+for name in os.listdir(command_guide_path):
+ # Ignore non-ReST files and the index page.
+ if not name.endswith('.rst') or name in ('index.rst',):
+ continue
+
+ # Otherwise, automatically extract the description.
+ file_subpath = os.path.join(command_guide_subpath, name)
+ with open(os.path.join(command_guide_path, name)) as f:
+ title = f.readline().rstrip('\n')
+ header = f.readline().rstrip('\n')
+
+ if len(header) != len(title):
+ print >>sys.stderr, (
+ "error: invalid header in %r (does not match title)" % (
+ file_subpath,))
+ if ' - ' not in title:
+ print >>sys.stderr, (
+ ("error: invalid title in %r "
+ "(expected '<name> - <description>')") % (
+ file_subpath,))
+
+ # Split the name out of the title.
+ name,description = title.split(' - ', 1)
+ man_pages.append((file_subpath.replace('.rst',''), name,
+ description, man_page_authors, 1))
+
# If true, show URL addresses after external links.
#man_show_urls = False
OpenPOWER on IntegriCloud