0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 LLVM Documentation
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 ==================
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 LLVM's documentation is written in reStructuredText, a lightweight
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 plaintext markup language (file extension `.rst`). While the
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 reStructuredText documentation should be quite readable in source form, it
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 is mostly meant to be processed by the Sphinx documentation generation
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 system to create HTML pages which are hosted on <http://llvm.org/docs/> and
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 updated after every commit. Manpage output is also supported, see below.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 If you instead would like to generate and view the HTML locally, install
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 Sphinx <http://sphinx-doc.org/> and then do:
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13
|
120
|
14 cd <build-dir>
|
|
15 cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_HTML=true <src-dir>
|
|
16 make -j3 docs-llvm-html
|
|
17 $BROWSER <build-dir>/docs//html/index.html
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 The mapping between reStructuredText files and generated documentation is
|
120
|
20 `docs/Foo.rst` <-> `<build-dir>/docs//html/Foo.html` <-> `http://llvm.org/docs/Foo.html`.
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 If you are interested in writing new documentation, you will want to read
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 `SphinxQuickstartTemplate.rst` which will get you writing documentation
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 very fast and includes examples of the most important reStructuredText
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 markup syntax.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 Manpage Output
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 ===============
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 Building the manpages is similar to building the HTML documentation. The
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 primary difference is to use the `man` makefile target, instead of the
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 default (which is `html`). Sphinx then produces the man pages in the
|
120
|
33 directory `<build-dir>/docs/man/`.
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34
|
120
|
35 cd <build-dir>
|
|
36 cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_MAN=true <src-dir>
|
|
37 make -j3 docs-llvm-man
|
|
38 man -l >build-dir>/docs/man/FileCheck.1
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 The correspondence between .rst files and man pages is
|
120
|
41 `docs/CommandGuide/Foo.rst` <-> `<build-dir>/docs//man/Foo.1`.
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 These .rst files are also included during HTML generation so they are also
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 viewable online (as noted above) at e.g.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 `http://llvm.org/docs/CommandGuide/Foo.html`.
|
77
|
45
|
|
46 Checking links
|
|
47 ==============
|
|
48
|
95
|
49 The reachability of external links in the documentation can be checked by
|
77
|
50 running:
|
|
51
|
|
52 cd docs/
|
|
53 make -f Makefile.sphinx linkcheck
|
121
|
54
|
|
55 Doxygen page Output
|
|
56 ==============
|
|
57
|
|
58 Install doxygen <http://www.stack.nl/~dimitri/doxygen/download.html> and dot2tex <https://dot2tex.readthedocs.io/en/latest>.
|
|
59
|
|
60 cd <build-dir>
|
|
61 cmake -DLLVM_ENABLE_DOXYGEN=On <llvm-top-src-dir>
|
|
62 make doxygen-llvm # for LLVM docs
|
|
63 make doxygen-clang # for clang docs
|
|
64
|
|
65 It will generate html in
|
|
66
|
|
67 <build-dir>/docs/doxygen/html # for LLVM docs
|
|
68 <build-dir>/tools/clang/docs/doxygen/html # for clang docs
|