From f203422a1f69341b2506d0cf06d96384634b7d6e Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Sun, 7 Feb 2016 15:42:12 +0000 Subject: [PATCH] [docs] Update the docs to describe how to build the docs with cmake llvm-svn: 260035 --- docs/CMake.rst | 12 +++++++----- docs/README.txt | 20 +++++++++++--------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/docs/CMake.rst b/docs/CMake.rst index e2515f473a2..12d74ace161 100644 --- a/docs/CMake.rst +++ b/docs/CMake.rst @@ -362,10 +362,12 @@ LLVM-specific variables Define the maximum number of concurrent link jobs. **LLVM_BUILD_DOCS**:BOOL - Enables all enabled documentation targets (i.e. Doxgyen and Sphinx targets) to - be built as part of the normal build. If the ``install`` target is run then - this also enables all built documentation targets to be installed. Defaults to - OFF. + Adds all *enabled* documentation targets (i.e. Doxgyen and Sphinx targets) as + dependencies of the default build targets. This results in all of the (enabled) + documentation targets being as part of a normal build. If the ``install`` + target is run then this also enables all built documentation targets to be + installed. Defaults to OFF. To enable a particular documentation target, see + see LLVM_ENABLE_SPHINX and LLVM_ENABLE_DOXYGEN. **LLVM_ENABLE_DOXYGEN**:BOOL Enables the generation of browsable HTML documentation using doxygen. @@ -417,7 +419,7 @@ LLVM-specific variables Defaults to OFF. **LLVM_ENABLE_SPHINX**:BOOL - If enabled CMake will search for the ``sphinx-build`` executable and will make + If specified, CMake will search for the ``sphinx-build`` executable and will make the ``SPHINX_OUTPUT_HTML`` and ``SPHINX_OUTPUT_MAN`` CMake options available. Defaults to OFF. diff --git a/docs/README.txt b/docs/README.txt index 31764b2951b..6c6e5b90ecf 100644 --- a/docs/README.txt +++ b/docs/README.txt @@ -11,12 +11,13 @@ updated after every commit. Manpage output is also supported, see below. If you instead would like to generate and view the HTML locally, install Sphinx and then do: - cd docs/ - make -f Makefile.sphinx - $BROWSER _build/html/index.html + cd + cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_HTML=true + make -j3 docs-llvm-html + $BROWSER /docs//html/index.html The mapping between reStructuredText files and generated documentation is -`docs/Foo.rst` <-> `_build/html/Foo.html` <-> `http://llvm.org/docs/Foo.html`. +`docs/Foo.rst` <-> `/docs//html/Foo.html` <-> `http://llvm.org/docs/Foo.html`. If you are interested in writing new documentation, you will want to read `SphinxQuickstartTemplate.rst` which will get you writing documentation @@ -29,14 +30,15 @@ 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 -directory `_build/man/`. +directory `/docs/man/`. - cd docs/ - make -f Makefile.sphinx man - man -l _build/man/FileCheck.1 + cd + cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_MAN=true + make -j3 docs-llvm-man + man -l >build-dir>/docs/man/FileCheck.1 The correspondence between .rst files and man pages is -`docs/CommandGuide/Foo.rst` <-> `_build/man/Foo.1`. +`docs/CommandGuide/Foo.rst` <-> `/docs//man/Foo.1`. These .rst files are also included during HTML generation so they are also viewable online (as noted above) at e.g. `http://llvm.org/docs/CommandGuide/Foo.html`.