-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update docs content and process #999
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ __pycache__/ | |
*.py[cod] | ||
|
||
# Generated docs | ||
docs/ | ||
docs_build/ | ||
|
||
# Build files | ||
/build*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Documentation | ||
|
||
To generate HTML documentation run the `generate_docs.py` script from any sub-dir of the | ||
repository (most likely `build`) or enable and use build target 'docs' (see details below). | ||
|
||
This script will create `./docs_build` sub-directory, where the intermediate and final files | ||
will be created. HTML docs will be in the `./docs_build/generated/html` directory. | ||
|
||
## make docs | ||
|
||
To run documentation generation via build target use CMake commands below. | ||
To enable this target, python executable (in required version) has to be found in the system. | ||
|
||
```bash | ||
$ cmake -B build | ||
$ cmake --build build --target docs | ||
``` | ||
|
||
## Requirements | ||
|
||
Script to generate HTML docs requires: | ||
* [Doxygen](http://www.doxygen.nl/) at least v1.9.1 | ||
* [Python](https://www.python.org/downloads/) at least v3.8 | ||
* and python pip requirements, as defined in `third_party/requirements.txt` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,9 @@ | |
# -- Extension configuration ------------------------------------------------- | ||
|
||
# -- Options for breathe extension ------------------------------------------- | ||
breathe_projects = {project: "../../docs/xml"} | ||
# 'doxyxml' dir is generated with Doxygen; it's supposed to be in a directory | ||
# one above the config directory. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this relation? Can't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't ask me why, I think breathe expects a specific location of these files... probably could be improve somehow (I'm not breathe nor doxygen expert), but we only run this script in CI, for web page... so probaly not worth spending a lot of time |
||
breathe_projects = {project: "../doxyxml"} | ||
breathe_default_project = project | ||
breathe_show_include = False | ||
breathe_default_members = ("members", "undoc-members") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,17 +6,20 @@ | |
""" | ||
|
||
from pathlib import Path | ||
from shutil import rmtree | ||
from shutil import rmtree, copytree | ||
import subprocess # nosec B404 | ||
import time | ||
|
||
|
||
def _check_cwd() -> None: | ||
script_path = Path(__file__).resolve().parent | ||
cwd = Path.cwd() | ||
if script_path != cwd: | ||
include_dir = Path(cwd, "../include") | ||
# Verify if include dir is one level up (as defined in Doxyfile) | ||
if not include_dir.exists(): | ||
print( | ||
f"{__file__} script has to be run from the 'scripts' directory. Terminating..." | ||
f"Include directory {include_dir.resolve()} not found! " | ||
"Please run this script from <repo_root_dir>/build!", | ||
flush=True, | ||
) | ||
exit(1) | ||
|
||
|
@@ -66,8 +69,17 @@ def _generate_html(config_path: Path, docs_path: Path) -> None: | |
|
||
def main() -> None: | ||
_check_cwd() | ||
config_path = Path("docs_config").resolve() | ||
docs_path = Path("..", "docs").resolve() | ||
|
||
script_dir = Path(__file__).resolve().parent | ||
docs_build_path = Path("docs_build").resolve() | ||
|
||
# Sphinx and breathe require access to a Doxygen generated dir ('doxyxml') | ||
# so we copy the whole content of the 'docs' dir to the build dir. | ||
copytree(Path(script_dir), docs_build_path, dirs_exist_ok=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps you could set the Doxygen output directory to docs output directory instead There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I tested a few variants - doxygen needs specific relation to these breathe files, and also to assets and also the the include dir... it was rather compliacted for me, I just tried to describe it a little, perhaps if anyone has a better option we could improve later |
||
|
||
config_path = Path(docs_build_path, "config").resolve() | ||
docs_path = Path(docs_build_path, "generated").resolve() | ||
|
||
start = time.time() | ||
_prepare_docs_dir(docs_path) | ||
_generate_xml(config_path, docs_path) | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, check also the minimum required version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.