blob: 896264dd7c1c2249020a3946a50e315961a4dfd6 [file] [log] [blame]
Heinrich Schuchardt4a6023cf2022-12-30 05:05:31 +01001.. SPDX-License-Identifier: GPL-2.0+:
2
3Building documentation
4======================
5
6The U-Boot documentation is based on the Sphinx documentation generator.
7
8HTML documentation
9------------------
10
11The *htmldocs* target is used to build the HTML documentation. It uses the
12`Read the Docs Sphinx theme <https://sphinx-rtd-theme.readthedocs.io/en/stable/>`_.
13
14.. code-block:: bash
15
16 # Create Python environment 'myenv'
17 python3 -m venv myenv
18 # Activate the Python environment
19 . myenv/bin/activate
20 # Install build requirements
21 python3 -m pip install -r doc/sphinx/requirements.txt
22 # Build the documentation
23 make htmldocs
24 # Deactivate the Python environment
25 deactivate
26 # Display the documentation in a graphical web browser
27 x-www-browser doc/output/index.html
28
29Infodoc documentation
30---------------------
31
32The *infodocs* target builds both a texinfo and an info file:
33
34.. code-block:: bash
35
36 # Create Python environment 'myenv'
37 python3 -m venv myenv
38 # Activate the Python environment
39 . myenv/bin/activate
40 # Install build requirements
41 python3 -m pip install -r doc/sphinx/requirements.txt
42 # Build the documentation
43 make infodocs
44 # Deactivate the Python environment
45 deactivate
46 # Display the documentation
47 info doc/output/texinfo/u-boot.info
48
49PDF documentation
50-----------------
51
52The *pdfdocs* target is meant to be used to build PDF documenation.
53As v2023.01 it fails with 'LaTeX Error: Too deeply nested'.
54
55We can use texi2pdf instead:
56
57.. code-block:: bash
58
59 # Create Python environment 'myenv'
60 python3 -m venv myenv
61 # Activate the Python environment
62 . myenv/bin/activate
63 # Install build requirements
64 python3 -m pip install -r doc/sphinx/requirements.txt
65 # Build the documentation
66 make texinfodocs
67 # Deactivate the Python environment
68 deactivate
69 # Convert to PDF
70 texi2pdf doc/output/texinfo/u-boot.texi
71
72Texinfo documentation
73---------------------
74
75To build only the texinfo documentation the *texinfodocs* target is used:
76
77.. code-block:: bash
78
79 # Create Python environment 'myenv'
80 python3 -m venv myenv
81 # Activate the Python environment
82 . myenv/bin/activate
83 # Install build requirements
84 python3 -m pip install -r doc/sphinx/requirements.txt
85 # Build the documentation
86 make texinfodocs
87 # Deactivate the Python environment
88 deactivate
89
90The output is in file *doc/output/texinfo/u-boot.texi*.