484 changes: 484 additions & 0 deletions clang/docs/CommandGuide/clang.rst

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions clang/docs/CommandGuide/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Clang "man" pages
-----------------

The following documents are command descriptions for all of the Clang tools.
These pages describe how to use the Clang commands and what their options are.
Note that these pages do not describe all of the options available for all
tools. To get a complete listing, pass the ``--help`` (general options) or
``--help-hidden`` (general and debugging options) arguments to the tool you are
interested in.

Basic Commands
~~~~~~~~~~~~~~

.. toctree::
:maxdepth: 1

clang
1 change: 0 additions & 1 deletion clang/docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
##===----------------------------------------------------------------------===##

CLANG_LEVEL := ..
DIRS := tools

ifdef BUILD_FOR_WEBSITE
PROJ_OBJ_DIR = .
Expand Down
40 changes: 35 additions & 5 deletions clang/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

# 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
Expand Down Expand Up @@ -212,10 +212,40 @@

# 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
Expand Down
1 change: 1 addition & 0 deletions clang/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Using Clang as a Compiler
SafeStack
Modules
MSVCCompatibility
CommandGuide/index
FAQ

Using Clang as a Library
Expand Down
116 changes: 0 additions & 116 deletions clang/docs/tools/Makefile

This file was deleted.

614 changes: 0 additions & 614 deletions clang/docs/tools/clang.pod

This file was deleted.

256 changes: 0 additions & 256 deletions clang/docs/tools/manpage.css

This file was deleted.