diff --git a/lld/docs/sphinx_intro.rst b/lld/docs/sphinx_intro.rst --- a/lld/docs/sphinx_intro.rst +++ b/lld/docs/sphinx_intro.rst @@ -41,7 +41,8 @@ Linux Use your distribution's standard package management tool to install it, - i.e., ``apt-get install easy_install`` or ``yum install easy_install``. + i.e., ``apt-get install pip, ``apt-get install easy_install`` or``yum + install easy_install``. macOS All modern macOS systems come with ``easy_install`` as part of the base @@ -55,7 +56,7 @@ .. _building_the_documentation: Building the documentation -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~ In order to build the documentation need to add ``-DLLVM_ENABLE_SPHINX=ON`` to your ``cmake`` command. Once you do this you can build the docs using diff --git a/llvm/cmake/modules/AddSphinxTarget.cmake b/llvm/cmake/modules/AddSphinxTarget.cmake --- a/llvm/cmake/modules/AddSphinxTarget.cmake +++ b/llvm/cmake/modules/AddSphinxTarget.cmake @@ -84,7 +84,7 @@ if(NOT LLVM_ENABLE_IDE) add_llvm_install_targets("install-${SPHINX_TARGET_NAME}" - DEPENDS ${SPHINX_TARGET_NAME} + DEPENDS "${SPHINX_TARGET_NAME}" COMPONENT "${project}-sphinx-man") endif() elseif (builder STREQUAL html) @@ -92,12 +92,9 @@ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DATADIR}/doc/${project}/html" CACHE STRING "HTML documentation install directory for ${project}") - # '/.' indicates: copy the contents of the directory directly into - # the specified destination, without recreating the last component - # of ${SPHINX_BUILD_DIR} implicitly. - install(DIRECTORY "${SPHINX_BUILD_DIR}/." + install(DIRECTORY "${SPHINX_BUILD_DIR}/" # Slash indicates contents of COMPONENT "${project}-sphinx-html" - DESTINATION "${${project_upper}_INSTALL_SPHINX_HTML_DIR}") + DESTINATION "$CACHE{${project_upper}_INSTALL_SPHINX_HTML_DIR}") if(NOT LLVM_ENABLE_IDE) add_llvm_install_targets("install-${SPHINX_TARGET_NAME}" diff --git a/llvm/docs/CMakeLists.txt b/llvm/docs/CMakeLists.txt --- a/llvm/docs/CMakeLists.txt +++ b/llvm/docs/CMakeLists.txt @@ -159,9 +159,9 @@ add_dependencies(ocaml_doc ${doc_targets}) if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - # ./ suffix is needed to copy the contents of html directory without + # / suffix is needed to copy the contents of html directory without # appending html/ into LLVM_INSTALL_OCAMLDOC_HTML_DIR. - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html/. + install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html/" COMPONENT ocamldoc-html DESTINATION "${LLVM_INSTALL_OCAMLDOC_HTML_DIR}") endif() diff --git a/llvm/docs/README.txt b/llvm/docs/README.txt --- a/llvm/docs/README.txt +++ b/llvm/docs/README.txt @@ -14,10 +14,15 @@ cd cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_HTML=true make -j3 docs-llvm-html - $BROWSER /docs//html/index.html + $BROWSER /docs/html/index.html -The mapping between reStructuredText files and generated documentation is -`docs/Foo.rst` <-> `/docs//html/Foo.html` <-> `https://llvm.org/docs/Foo.html`. +The correspondence between reStructuredText files and generated HTML pages is: + +LLVM project + `llvm/docs/Foo.rst` <-> `/docs/html/Foo.html` <-> `/share/doc/llvm/html/Foo.html` <-> `https://llvm.org/docs/Foo.html` + +Other projects + `/docs/Foo.rst` <-> `/tools//docs/html/Foo.html` <-> `/share/doc//html/Foo.html`<-> `https://.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 @@ -25,7 +30,7 @@ markup syntax. 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 @@ -35,13 +40,24 @@ cd cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_MAN=true make -j3 docs-llvm-man - man -l >build-dir>/docs/man/FileCheck.1 + man -l /docs/man/FileCheck.1 + +The correspondence between reStructuredText files and generated man pages is: + +LLVM project + `llvm/docs/CommandGuide/Foo.rst` <-> `/docs/man/Foo.1` <-> `/share/man/man1/Foo.1` + +Other projects + `/docs/CommandGuide/Foo.rst` <-> `/tools//docs/man/Foo.1` <-> `/share/man/man1/Foo.1` -The correspondence between .rst files and man pages is -`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. -`https://llvm.org/docs/CommandGuide/Foo.html`. +viewable online: + +LLVM project + `https://llvm.org/docs/CommandGuide/Foo.html` + +Other projects + `https://.llvm.org/docs/CommandGuide/Foo.html` Checking links ============== @@ -53,7 +69,7 @@ make -f Makefile.sphinx linkcheck Doxygen page Output -============== +=================== Install doxygen and dot2tex . diff --git a/openmp/docs/README.txt b/openmp/docs/README.txt --- a/openmp/docs/README.txt +++ b/openmp/docs/README.txt @@ -1,5 +1,5 @@ OpenMP LLVM Documentation -================== +========================= OpenMP LLVM's documentation is written in reStructuredText, a lightweight plaintext markup language (file extension `.rst`). While the @@ -14,11 +14,15 @@ cd cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_HTML=true make - $BROWSER /projects/openmp/docs//html/index.html + $BROWSER /projects/openmp/docs/html/index.html -The mapping between reStructuredText files and generated documentation is -`docs/Foo.rst` <-> `/projects/openmp/docs//html/Foo.html` <-> -`https://openmp.llvm.org/docs/Foo.html`. +The correspondence between reStructuredText files and generated HTML pages is: + +LLVM project + `llvm/docs/Foo.rst` <-> `/docs/html/Foo.html` <-> `/share/doc/llvm/html/Foo.html` <-> `https://llvm.org/docs/Foo.html` + +Other projects (such as openmp) + `/docs/Foo.rst` <-> `/tools//docs/html/Foo.html` <-> `/share/doc//html/Foo.html`<-> `https://.llvm.org/docs/Foo.html` If you are interested in writing new documentation, you will want to read `llvm/docs/SphinxQuickstartTemplate.rst` which will get you writing @@ -26,7 +30,7 @@ reStructuredText markup syntax. 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 @@ -36,10 +40,21 @@ cd cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_MAN=true make - man -l >build-dir>/docs/man/FileCheck.1 + man -l /tools/openmp/docs/man/openmp.1 + +The correspondence between reStructuredText files and generated man pages is: + +LLVM project + `llvm/docs/CommandGuide/Foo.rst` <-> `/docs/man/Foo.1` <-> `/share/man/man1/Foo.1` + +Other projects (such as openmp) + `/docs/CommandGuide/Foo.rst` <-> `/tools//docs/man/Foo.1` <-> `/share/man/man1/Foo.1` -The correspondence between .rst files and man pages is -`docs/CommandGuide/Foo.rst` <-> `/projects/openmp/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. -`https://openmp.llvm.org/docs/CommandGuide/Foo.html`. +viewable online: + +LLVM project + `https://openmp.llvm.org/docs/CommandGuide/Foo.html` + +Other projects (such as openmp) + `https://.llvm.org/docs/CommandGuide/Foo.html`