blob: 31764b2951b2f9d5b04dba8340bc757e8c8a7391 [file] [log] [blame]
Daniel Dunbar09b8c0f2012-04-19 16:31:19 +00001LLVM Documentation
2==================
3
Sean Silvae3c5e482013-01-02 02:31:51 +00004LLVM's documentation is written in reStructuredText, a lightweight
5plaintext markup language (file extension `.rst`). While the
6reStructuredText documentation should be quite readable in source form, it
Sean Silvaf8e58012013-02-27 18:48:42 +00007is mostly meant to be processed by the Sphinx documentation generation
8system to create HTML pages which are hosted on <http://llvm.org/docs/> and
9updated after every commit. Manpage output is also supported, see below.
Daniel Dunbar09b8c0f2012-04-19 16:31:19 +000010
Sean Silvae3c5e482013-01-02 02:31:51 +000011If you instead would like to generate and view the HTML locally, install
12Sphinx <http://sphinx-doc.org/> and then do:
Daniel Dunbar09b8c0f2012-04-19 16:31:19 +000013
Sean Silvae3c5e482013-01-02 02:31:51 +000014 cd docs/
15 make -f Makefile.sphinx
16 $BROWSER _build/html/index.html
Daniel Dunbar09b8c0f2012-04-19 16:31:19 +000017
Sean Silvae3c5e482013-01-02 02:31:51 +000018The mapping between reStructuredText files and generated documentation is
19`docs/Foo.rst` <-> `_build/html/Foo.html` <-> `http://llvm.org/docs/Foo.html`.
20
21If you are interested in writing new documentation, you will want to read
22`SphinxQuickstartTemplate.rst` which will get you writing documentation
23very fast and includes examples of the most important reStructuredText
24markup syntax.
Sean Silvaf8e58012013-02-27 18:48:42 +000025
26Manpage Output
27===============
28
29Building the manpages is similar to building the HTML documentation. The
30primary difference is to use the `man` makefile target, instead of the
31default (which is `html`). Sphinx then produces the man pages in the
32directory `_build/man/`.
33
34 cd docs/
35 make -f Makefile.sphinx man
36 man -l _build/man/FileCheck.1
37
38The correspondence between .rst files and man pages is
39`docs/CommandGuide/Foo.rst` <-> `_build/man/Foo.1`.
40These .rst files are also included during HTML generation so they are also
41viewable online (as noted above) at e.g.
42`http://llvm.org/docs/CommandGuide/Foo.html`.
Sean Silva3feb6902014-04-22 21:47:53 +000043
44Checking links
45==============
46
Steve Kinga20803a2015-08-12 23:56:50 +000047The reachability of external links in the documentation can be checked by
Sean Silva3feb6902014-04-22 21:47:53 +000048running:
49
50 cd docs/
51 make -f Makefile.sphinx linkcheck