xref: /aosp_15_r20/external/llvm/docs/README.txt (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard WorkerLLVM Documentation
2*9880d681SAndroid Build Coastguard Worker==================
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard WorkerLLVM's documentation is written in reStructuredText, a lightweight
5*9880d681SAndroid Build Coastguard Workerplaintext markup language (file extension `.rst`). While the
6*9880d681SAndroid Build Coastguard WorkerreStructuredText documentation should be quite readable in source form, it
7*9880d681SAndroid Build Coastguard Workeris mostly meant to be processed by the Sphinx documentation generation
8*9880d681SAndroid Build Coastguard Workersystem to create HTML pages which are hosted on <http://llvm.org/docs/> and
9*9880d681SAndroid Build Coastguard Workerupdated after every commit. Manpage output is also supported, see below.
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard WorkerIf you instead would like to generate and view the HTML locally, install
12*9880d681SAndroid Build Coastguard WorkerSphinx <http://sphinx-doc.org/> and then do:
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker    cd <build-dir>
15*9880d681SAndroid Build Coastguard Worker    cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_HTML=true <src-dir>
16*9880d681SAndroid Build Coastguard Worker    make -j3 docs-llvm-html
17*9880d681SAndroid Build Coastguard Worker    $BROWSER <build-dir>/docs//html/index.html
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard WorkerThe mapping between reStructuredText files and generated documentation is
20*9880d681SAndroid Build Coastguard Worker`docs/Foo.rst` <-> `<build-dir>/docs//html/Foo.html` <-> `http://llvm.org/docs/Foo.html`.
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard WorkerIf you are interested in writing new documentation, you will want to read
23*9880d681SAndroid Build Coastguard Worker`SphinxQuickstartTemplate.rst` which will get you writing documentation
24*9880d681SAndroid Build Coastguard Workervery fast and includes examples of the most important reStructuredText
25*9880d681SAndroid Build Coastguard Workermarkup syntax.
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard WorkerManpage Output
28*9880d681SAndroid Build Coastguard Worker===============
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard WorkerBuilding the manpages is similar to building the HTML documentation. The
31*9880d681SAndroid Build Coastguard Workerprimary difference is to use the `man` makefile target, instead of the
32*9880d681SAndroid Build Coastguard Workerdefault (which is `html`). Sphinx then produces the man pages in the
33*9880d681SAndroid Build Coastguard Workerdirectory `<build-dir>/docs/man/`.
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Worker    cd <build-dir>
36*9880d681SAndroid Build Coastguard Worker    cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_MAN=true <src-dir>
37*9880d681SAndroid Build Coastguard Worker    make -j3 docs-llvm-man
38*9880d681SAndroid Build Coastguard Worker    man -l >build-dir>/docs/man/FileCheck.1
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard WorkerThe correspondence between .rst files and man pages is
41*9880d681SAndroid Build Coastguard Worker`docs/CommandGuide/Foo.rst` <-> `<build-dir>/docs//man/Foo.1`.
42*9880d681SAndroid Build Coastguard WorkerThese .rst files are also included during HTML generation so they are also
43*9880d681SAndroid Build Coastguard Workerviewable online (as noted above) at e.g.
44*9880d681SAndroid Build Coastguard Worker`http://llvm.org/docs/CommandGuide/Foo.html`.
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard WorkerChecking links
47*9880d681SAndroid Build Coastguard Worker==============
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard WorkerThe reachability of external links in the documentation can be checked by
50*9880d681SAndroid Build Coastguard Workerrunning:
51*9880d681SAndroid Build Coastguard Worker
52*9880d681SAndroid Build Coastguard Worker    cd docs/
53*9880d681SAndroid Build Coastguard Worker    make -f Makefile.sphinx linkcheck
54