Skip to content

Commit

Permalink
Standardize documentation for ReadtheDocs (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
samjwu authored Jan 12, 2024
1 parent 60946a3 commit 630f396
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 24 deletions.
8 changes: 7 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
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"
labels:
- "documentation"
- "dependencies"
- "ci:docs-only"
reviewers:
- "samjwu"
10 changes: 0 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,3 @@ build*
\#*\#
*~
*.log

# documentation artifacts
build/
_build/
_images/
_static/
_templates/
_toc.yml
docBin/
_doxygen/
6 changes: 3 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ version: 2
sphinx:
configuration: docs/conf.py

formats: [htmlzip]
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"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ To build our documentation locally, use the following commands.
```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 Expand Up @@ -769,7 +769,7 @@ The HIP runtime compilation (hipRTC) environment allows simultaneous compilation
running of device code on AMD GPUs. The rocWMMA library is compatible with hipRTC, so you can
leverage it for runtime-generated kernels. A simple GEMM sample is included to demonstrate
compatibility. For more information, refer to the
[HIP API reference](https://rocm.docs.amd.com/projects/HIP/en/latest/.doxygen/docBin/html/index.html).
[HIP API reference](https://rocm.docs.amd.com/projects/HIP/en/latest/doxygen/html/index.html).
```important
The `rocwmma::bfloat16_t` data type is not currently supported in hipRTC.
Expand Down
6 changes: 6 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# documentation artifacts
_build/
_doxygen/
sphinx/_toc.yml
doxygen/html/
doxygen/xml/
1 change: 0 additions & 1 deletion docs/.sphinx/requirements.in

This file was deleted.

24 changes: 22 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,31 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import re

from rocm_docs import ROCmDocs

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

# for PDF output on Read the Docs
project = "rocWMMA Documentation"
author = "Advanced Micro Devices, Inc."
copyright = "Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved."
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.setup()

external_projects_current_project = "rocwmma"

for sphinx_var in ROCmDocs.SPHINX_VARS:
globals()[sphinx_var] = getattr(docs_core, sphinx_var)
4 changes: 2 additions & 2 deletions docs/.doxygen/Doxyfile → docs/doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = docBin
OUTPUT_DIRECTORY = .

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down Expand Up @@ -957,7 +957,7 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.

USE_MDFILE_AS_MAINPAGE = ../README.md
USE_MDFILE_AS_MAINPAGE =

#---------------------------------------------------------------------------
# Configuration options related to source browsing
Expand Down
4 changes: 4 additions & 0 deletions docs/license.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
License
=======

.. include:: ../LICENSE.md
4 changes: 4 additions & 0 deletions docs/.sphinx/_toc.yml.in → docs/sphinx/_toc.yml.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Anywhere {branch} is used, the branch name will be substituted.
# These comments will also be removed.
root: index
subtrees:
- caption: About
entries:
- file: license
1 change: 1 addition & 0 deletions docs/sphinx/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rocm-docs-core==0.30.3
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ pygments==2.15.0
# pydata-sphinx-theme
# sphinx
pyjwt[crypto]==2.6.0
# via
# pygithub
# pyjwt
# via pygithub
pynacl==1.5.0
# via pygithub
pytz==2023.3.post1
Expand Down

0 comments on commit 630f396

Please sign in to comment.