mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Make building C++ API docs optional
If Doxygen isn't found then the C++ API reference page won't be included in the built docs.
This commit is contained in:
+3
-1
@@ -2,11 +2,13 @@
|
||||
|
||||
This directory contains documentation for libloot and LOOT's metadata syntax. It does not include Rust API reference documentation: that is generated using `cargo doc`.
|
||||
|
||||
To build the documentation, install [Doxygen](https://www.doxygen.nl/), Python and [uv](https://docs.astral.sh/uv/getting-started/installation/) and make sure they're accessible from your `PATH`, then run:
|
||||
To build the documentation, install Python and [uv](https://docs.astral.sh/uv/getting-started/installation/) and make sure they're accessible from your `PATH`, then run:
|
||||
|
||||
```
|
||||
cd ../docs
|
||||
uv run -- sphinx-build -b html . build/html
|
||||
```
|
||||
|
||||
If [Doxygen](https://www.doxygen.nl/) is also installed and accessible from your `PATH`, the C++ API's reference documentation will also be included.
|
||||
|
||||
The documentation files for dependency licenses and copyright notices are auto-generated using [cargo-attribution](https://github.com/ameknite/cargo-attribution): to regenerate them run `py scripts/licenses.py`. The script is hardcoded to generate files for the C++ wrapper's dependencies, but in practice that doesn't add any content over doing the same for just the core libloot Rust library.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
*************
|
||||
API Reference
|
||||
*************
|
||||
*****************
|
||||
C++ API Reference
|
||||
*****************
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
@@ -0,0 +1,6 @@
|
||||
******************
|
||||
Rust API Reference
|
||||
******************
|
||||
|
||||
To view the Rust API reference, run ``cargo doc --open`` from the root directory
|
||||
of a copy of the libloot source code repository.
|
||||
+19
-11
@@ -20,13 +20,7 @@
|
||||
# import sys
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
import subprocess, os
|
||||
|
||||
doxygen_output_directory = os.path.join('..', 'cpp', 'build', 'docs')
|
||||
if not os.path.exists(doxygen_output_directory):
|
||||
os.makedirs(doxygen_output_directory)
|
||||
|
||||
subprocess.call(['doxygen', 'Doxyfile'], cwd='../cpp')
|
||||
import shutil, subprocess, os
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
@@ -348,9 +342,23 @@ texinfo_documents = [
|
||||
#
|
||||
# texinfo_no_detailmenu = False
|
||||
|
||||
found_doxygen = shutil.which('doxygen')
|
||||
|
||||
breathe_projects = {
|
||||
'loot':'../cpp/build/docs/xml/',
|
||||
}
|
||||
if found_doxygen:
|
||||
doxygen_output_directory = os.path.join('..', 'cpp', 'build', 'docs')
|
||||
if not os.path.exists(doxygen_output_directory):
|
||||
os.makedirs(doxygen_output_directory)
|
||||
|
||||
breathe_default_project = 'loot'
|
||||
subprocess.call(['doxygen', 'Doxyfile'], cwd='../cpp')
|
||||
|
||||
extensions.append('breathe')
|
||||
|
||||
breathe_projects = {
|
||||
'loot':'../cpp/build/docs/xml/',
|
||||
}
|
||||
|
||||
breathe_default_project = 'loot'
|
||||
else:
|
||||
# This causes Sphinx to log a warning, but it's unavoidable without
|
||||
# modifying index.rst at runtime.
|
||||
exclude_patterns.append('api/cpp_api_reference.rst')
|
||||
|
||||
+2
-1
@@ -8,7 +8,8 @@ libloot
|
||||
|
||||
api/introduction
|
||||
api/sorting
|
||||
api/reference
|
||||
api/rust_api_reference
|
||||
api/cpp_api_reference
|
||||
api/licenses/index
|
||||
api/changelog
|
||||
|
||||
|
||||
Reference in New Issue
Block a user