add @llvm.donothing
[oota-llvm.git] / docs / conf.py
index e44dfc0de6562b8e8b08134a26a2c1e4b0ac75df..de0585ddb006c15b53fdca43d972fd2f62c94438 100644 (file)
@@ -36,7 +36,7 @@ source_suffix = '.rst'
 #source_encoding = 'utf-8-sig'
 
 # The master toctree document.
-master_doc = 'contents'
+master_doc = 'index'
 
 # General information about the project.
 project = u'LLVM'
@@ -47,9 +47,9 @@ copyright = u'2012, LLVM Project'
 # built documents.
 #
 # The short X.Y version.
-version = '3.1'
+version = '3.2'
 # The full version, including alpha/beta/rc tags.
-release = '3.1'
+release = '3.2'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
@@ -119,7 +119,7 @@ html_theme_path = ["."]
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
 # so a file named "default.css" will overwrite the builtin "default.css".
-#html_static_path = ['_static']
+html_static_path = ['_static']
 
 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
 # using the given strftime format.
@@ -134,7 +134,18 @@ html_sidebars = {'index': 'indexsidebar.html'}
 
 # Additional templates that should be rendered to pages, maps page names to
 # template names.
-html_additional_pages = {'index': 'index.html'}
+#
+# We load all the old-school HTML documentation pages into Sphinx here.
+basedir = os.path.dirname(__file__)
+html_additional_pages = {}
+for directory in ('', 'tutorial'):
+    for file in os.listdir(os.path.join(basedir, directory)):
+        if not file.endswith('.html'):
+            continue
+
+        subpath = os.path.join(directory, file)
+        name,_ = os.path.splitext(subpath)
+        html_additional_pages[name] = subpath
 
 # If false, no module index is generated.
 #html_domain_indices = True
@@ -182,7 +193,7 @@ latex_elements = {
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, documentclass [howto/manual]).
 latex_documents = [
-  ('contents', 'LLVM.tex', u'LLVM Documentation',
+  ('index', 'LLVM.tex', u'LLVM Documentation',
    u'LLVM project', 'manual'),
 ]
 
@@ -211,35 +222,42 @@ latex_documents = [
 
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
-man_pages = [
-    ('contents', 'LLVM', u'LLVM Documentation',
-     [u'LLVM project'], 1)
-]
+man_pages = []
+
+# Automatically derive the list of man pages from the contents of the command
+# guide subdirectory.
+man_page_authors = "Maintained by The LLVM Team (http://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:
+        it = iter(f)
+        title = it.next()[:-1]
+        header = it.next()[:-1]
+
+        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
 
-
-# -- Options for Texinfo output ------------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-#  dir menu entry, description, category)
-texinfo_documents = [
-  ('contents', 'LLVM', u'LLVM Documentation',
-   u'LLVM project', 'LLVM', 'One line description of project.',
-   'Miscellaneous'),
-]
-
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
-
-# If false, no module index is generated.
-#texinfo_domain_indices = True
-
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
-
-
 # FIXME: Define intersphinx configration.
 intersphinx_mapping = {}