Heinrich Schuchardt | 4a6023cf | 2022-12-30 05:05:31 +0100 | [diff] [blame^] | 1 | .. SPDX-License-Identifier: GPL-2.0+: |
| 2 | |
| 3 | Building documentation |
| 4 | ====================== |
| 5 | |
| 6 | The U-Boot documentation is based on the Sphinx documentation generator. |
| 7 | |
| 8 | HTML documentation |
| 9 | ------------------ |
| 10 | |
| 11 | The *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 | |
| 29 | Infodoc documentation |
| 30 | --------------------- |
| 31 | |
| 32 | The *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 | |
| 49 | PDF documentation |
| 50 | ----------------- |
| 51 | |
| 52 | The *pdfdocs* target is meant to be used to build PDF documenation. |
| 53 | As v2023.01 it fails with 'LaTeX Error: Too deeply nested'. |
| 54 | |
| 55 | We 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 | |
| 72 | Texinfo documentation |
| 73 | --------------------- |
| 74 | |
| 75 | To 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 | |
| 90 | The output is in file *doc/output/texinfo/u-boot.texi*. |