README.txt 2.4 KB

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