Skip to content

Commit

Permalink
Documentation - Standardize Sphinx documentation and add doxygen inte…
Browse files Browse the repository at this point in the history
…gration via doxysphinx (#243)

* Standardize Sphinx documentation and add doxygen integration via doxysphinx

Relates to ROCm/rocm-docs-core#330

* Include api_reference in requirements.in for doxysphinx
  • Loading branch information
samjwu authored Oct 29, 2023
1 parent fc203eb commit 992c552
Show file tree
Hide file tree
Showing 12 changed files with 2,860 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = "RPP"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "V1.3.0"
PROJECT_NUMBER = "V1.5.0"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/docs/.sphinx" # Location of package manifests
directory: "/docs/sphinx" # Location of package manifests
open-pull-requests-limit: 10
schedule:
interval: "daily"
target-branch: "develop"
labels:
- "documentation"
- "dependencies"
- "noCI"
- "ci:docs-only"
reviewers:
- "samjwu"
6 changes: 2 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ formats: [htmlzip, pdf, epub]

python:
install:
- requirements: docs/.sphinx/requirements.txt
- requirements: docs/sphinx/requirements.txt

build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.8"
apt_packages:
- "doxygen"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ AMD ROCm Performance Primitives (**RPP**) library is a comprehensive high-perfor

Run the steps below to build documentation locally.

* sphinx documentation
* Sphinx documentation
```bash
cd docs
pip3 install -r .sphinx/requirements.txt
pip3 install -r sphinx/requirements.txt
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
```

Expand Down
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
doxygen/html/
doxygen/latex/
doxygen/xml/
1 change: 0 additions & 1 deletion docs/.sphinx/requirements.in

This file was deleted.

25 changes: 22 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,32 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import re

from rocm_docs import ROCmDocs

with open('../CMakeLists.txt', encoding='utf-8') as f:
match = re.search(r'.*\bset\(VERSION\s+\"?([0-9.]+)[^0-9.]+', f.read())
if not match:
raise ValueError("VERSION not found!")
version_number = match[1]
left_nav_title = f"RPP {version_number} Documentation"

# for PDF output on Read the Docs
project = "RPP Documentation"
author = "Advanced Micro Devices, Inc."
copyright = "Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved."

Check warning on line 43 in docs/conf.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docs/conf.py#L43

Redefining built-in 'copyright'
version = version_number
release = version_number

external_toc_path = "./sphinx/_toc.yml"

docs_core = ROCmDocs(left_nav_title)
docs_core.run_doxygen(doxygen_root="doxygen", doxygen_path="doxygen/xml")
docs_core.enable_api_reference()
docs_core.setup()

external_projects_current_project = "rpp"

docs_core = ROCmDocs("RPP Documentation")
docs_core.setup()

for sphinx_var in ROCmDocs.SPHINX_VARS:
globals()[sphinx_var] = getattr(docs_core, sphinx_var)
Loading

0 comments on commit 992c552

Please sign in to comment.