2012-04-20 00:31:19 +08:00
|
|
|
LLVM Documentation
|
|
|
|
==================
|
|
|
|
|
2013-01-02 10:31:51 +08:00
|
|
|
LLVM's documentation is written in reStructuredText, a lightweight
|
|
|
|
plaintext markup language (file extension `.rst`). While the
|
|
|
|
reStructuredText documentation should be quite readable in source form, it
|
2013-02-28 02:48:42 +08:00
|
|
|
is mostly meant to be processed by the Sphinx documentation generation
|
2020-03-23 05:42:03 +08:00
|
|
|
system to create HTML pages which are hosted on <https://llvm.org/docs/> and
|
2013-02-28 02:48:42 +08:00
|
|
|
updated after every commit. Manpage output is also supported, see below.
|
2012-04-20 00:31:19 +08:00
|
|
|
|
2013-01-02 10:31:51 +08:00
|
|
|
If you instead would like to generate and view the HTML locally, install
|
|
|
|
Sphinx <http://sphinx-doc.org/> and then do:
|
2012-04-20 00:31:19 +08:00
|
|
|
|
2016-02-07 23:42:12 +08:00
|
|
|
cd <build-dir>
|
|
|
|
cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_HTML=true <src-dir>
|
|
|
|
make -j3 docs-llvm-html
|
|
|
|
$BROWSER <build-dir>/docs//html/index.html
|
2012-04-20 00:31:19 +08:00
|
|
|
|
2013-01-02 10:31:51 +08:00
|
|
|
The mapping between reStructuredText files and generated documentation is
|
2020-03-23 05:42:03 +08:00
|
|
|
`docs/Foo.rst` <-> `<build-dir>/docs//html/Foo.html` <-> `https://llvm.org/docs/Foo.html`.
|
2013-01-02 10:31:51 +08:00
|
|
|
|
|
|
|
If you are interested in writing new documentation, you will want to read
|
|
|
|
`SphinxQuickstartTemplate.rst` which will get you writing documentation
|
|
|
|
very fast and includes examples of the most important reStructuredText
|
|
|
|
markup syntax.
|
2013-02-28 02:48:42 +08:00
|
|
|
|
|
|
|
Manpage Output
|
|
|
|
===============
|
|
|
|
|
|
|
|
Building the manpages is similar to building the HTML documentation. The
|
|
|
|
primary difference is to use the `man` makefile target, instead of the
|
|
|
|
default (which is `html`). Sphinx then produces the man pages in the
|
2016-02-07 23:42:12 +08:00
|
|
|
directory `<build-dir>/docs/man/`.
|
2013-02-28 02:48:42 +08:00
|
|
|
|
2016-02-07 23:42:12 +08:00
|
|
|
cd <build-dir>
|
|
|
|
cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_MAN=true <src-dir>
|
|
|
|
make -j3 docs-llvm-man
|
|
|
|
man -l >build-dir>/docs/man/FileCheck.1
|
2013-02-28 02:48:42 +08:00
|
|
|
|
|
|
|
The correspondence between .rst files and man pages is
|
2016-02-07 23:42:12 +08:00
|
|
|
`docs/CommandGuide/Foo.rst` <-> `<build-dir>/docs//man/Foo.1`.
|
2013-02-28 02:48:42 +08:00
|
|
|
These .rst files are also included during HTML generation so they are also
|
|
|
|
viewable online (as noted above) at e.g.
|
2020-03-23 05:42:03 +08:00
|
|
|
`https://llvm.org/docs/CommandGuide/Foo.html`.
|
2014-04-23 05:47:53 +08:00
|
|
|
|
2017-06-25 04:13:32 +08:00
|
|
|
Checking links
|
2014-04-23 05:47:53 +08:00
|
|
|
==============
|
|
|
|
|
2015-08-13 07:56:50 +08:00
|
|
|
The reachability of external links in the documentation can be checked by
|
2014-04-23 05:47:53 +08:00
|
|
|
running:
|
|
|
|
|
|
|
|
cd docs/
|
|
|
|
make -f Makefile.sphinx linkcheck
|
2017-04-28 01:23:53 +08:00
|
|
|
|
|
|
|
Doxygen page Output
|
|
|
|
==============
|
|
|
|
|
|
|
|
Install doxygen <http://www.stack.nl/~dimitri/doxygen/download.html> and dot2tex <https://dot2tex.readthedocs.io/en/latest>.
|
|
|
|
|
|
|
|
cd <build-dir>
|
|
|
|
cmake -DLLVM_ENABLE_DOXYGEN=On <llvm-top-src-dir>
|
|
|
|
make doxygen-llvm # for LLVM docs
|
|
|
|
make doxygen-clang # for clang docs
|
|
|
|
|
|
|
|
It will generate html in
|
2019-06-07 06:07:14 +08:00
|
|
|
|
2017-04-28 01:23:53 +08:00
|
|
|
<build-dir>/docs/doxygen/html # for LLVM docs
|
|
|
|
<build-dir>/tools/clang/docs/doxygen/html # for clang docs
|