Skip to content

Commit 15acaad

Browse files
[doc] added section on generating the html doc
Added a new section on generating the html documentation from the rst/md sources to our documentation. Background: I wanted to check what my documenation changes would look like on the website and had a hard time finding how to do that. So I wanted to save other folks the effort. Differential Revision: https://reviews.llvm.org/D107460
1 parent e8d60e7 commit 15acaad

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

llvm/docs/MarkdownQuickstartTemplate.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,7 @@ integration documentation can be found in the [recommonmark docs].
155155

156156
[Common Mark spec]: http://spec.commonmark.org/0.28/
157157
[recommonmark docs]: http://recommonmark.readthedocs.io/en/latest/index.html
158+
159+
## Generating the documentation
160+
161+
see [Sphinx Quickstart Template](SphinxQuickstartTemplate.html#generating-the-documentation)

llvm/docs/SphinxQuickstartTemplate.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,32 @@ without any syntax highlighting like this:
165165
...
166166

167167

168+
Generating the documentation
169+
============================
170+
171+
You can generate the HTML documentation from the sources locally if you want to
172+
see what they would look like. In addition to the normal
173+
`build tools <docs/GettingStarted.html>`_
174+
you need to install `Sphinx`_ and the
175+
`recommonmark <https://recommonmark.readthedocs.io/en/latest/>`_ extension.
176+
177+
On Debian you can install these with:
178+
179+
.. code-block:: console
180+
181+
sudo apt install -y sphinx-doc python-recommonmark-doc
182+
183+
Then run cmake to build the documentation inside the ``llvm-project`` checkout:
184+
185+
.. code-block:: console
186+
187+
mkdir build
188+
cd build
189+
cmake -DLLVM_ENABLE_SPHINX=On ../llvm
190+
cmake --build . --target docs-llvm-html
191+
192+
In case you already have the Cmake build set up and want to reuse that,
193+
just set the CMake variable ``LLVM_ENABLE_SPHINX=On``.
194+
195+
After that you find the generated documentation in ``build/docs/html``
196+
folder.

0 commit comments

Comments
 (0)