Skip to content

Commit

Permalink
SWDEV-428554 - Standardize HIP Documentation
Browse files Browse the repository at this point in the history
Relates to ROCm/rocm-docs-core#330

Change-Id: I87468935a1aefa60158b8c07e3911845b3e8da36
  • Loading branch information
samjwu committed Nov 7, 2023
1 parent 885e3f0 commit 29a532b
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 43 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"
6 changes: 3 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ 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"
apt_packages:
Expand Down
5 changes: 4 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
/_doxygen
/_images
/_static
/_templates
/_templates
/doxygen/html
/doxygen/xml
/sphinx/_toc.yml
1 change: 0 additions & 1 deletion docs/.sphinx/requirements.in

This file was deleted.

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

from rocm_docs import ROCmDocs
import re
from typing import Any, Dict, List

docs_core = ROCmDocs("HIP Documentation")
docs_core.run_doxygen()
from rocm_docs import ROCmDocs

version_numbers = []
version_file = open("../VERSION", "r")
lines = version_file.readlines()
for line in lines:
if line[0] == '#':
continue
version_numbers.append(line.strip())
version_number = ".".join(version_numbers)
left_nav_title = f"HIP {version_number} Documentation"

# for PDF output on Read the Docs
project = "HIP Documentation"
author = "Advanced Micro Devices, Inc."
copyright = "Copyright (c) 2023 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.enable_api_reference()
docs_core.setup()

external_projects_current_project = "hip"

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

# rocm-docs-core might or might not have changed these yet (depending on version),
# and we don't want to wipe their settings if they did
if not "html_theme_options" in globals():
html_theme_options: Dict[str, Any] = {}
if not "exclude_patterns" in globals():
exclude_patterns: List[str] = []

html_theme_options["show_navbar_depth"] = 2
exclude_patterns.append(".doxygen/mainpage.md")
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 @@ -2237,7 +2237,7 @@ TAGFILES =
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.

GENERATE_TAGFILE = docBin/html/tagfile.xml
GENERATE_TAGFILE = html/tagfile.xml

# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
# the class index. If set to NO, only the inherited external classes will be
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ portable applications for AMD and NVIDIA GPUs from single source code.
:::

:::{grid-item-card} Reference
- {doc}`/.doxygen/docBin/html/index`
- {doc}`/.doxygen/docBin/html/modules`
- {doc}`/doxygen/html/index`
- {doc}`/doxygen/html/modules`
- {doc}`/reference/kernel_language`
- {doc}`/reference/math_api`
- {doc}`/reference/terms`
Expand All @@ -34,4 +34,4 @@ portable applications for AMD and NVIDIA GPUs from single source code.
- {doc}`/developer_guide/contributing`
:::

::::
::::
4 changes: 4 additions & 0 deletions docs/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License

```{include} ../LICENSE.txt
```
7 changes: 5 additions & 2 deletions docs/.sphinx/_toc.yml.in → docs/sphinx/_toc.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ subtrees:
- file: how_to_guides/debugging.md
- caption: Reference
entries:
- file: .doxygen/docBin/html/index
- file: doxygen/html/index
- file: reference/kernel_language
- file: reference/math_api
- file: reference/terms
Expand All @@ -23,4 +23,7 @@ subtrees:
entries:
- file: developer_guide/build
- file: developer_guide/logging
- file: developer_guide/contributing.md
- file: developer_guide/contributing.md
- 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[api_reference]==0.26.0
29 changes: 12 additions & 17 deletions docs/.sphinx/requirements.txt → docs/sphinx/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile requirements.in
Expand Down Expand Up @@ -41,7 +41,7 @@ docutils==0.16
# myst-parser
# pydata-sphinx-theme
# sphinx
doxysphinx==3.2.1
doxysphinx==3.3.7
# via rocm-docs-core
fastjsonschema==2.16.2
# via rocm-docs-core
Expand All @@ -53,18 +53,12 @@ idna==3.3
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==5.1.0
# via sphinx
importlib-resources==5.10.4
# via rocm-docs-core
jinja2==3.1.2
# via
# myst-parser
# sphinx
json5==0.9.11
libsass==0.22.0
# via doxysphinx
linkify-it-py==1.0.3
# via myst-parser
lxml==4.9.2
# via doxysphinx
markdown-it-py==2.1.0
Expand All @@ -77,7 +71,9 @@ mdit-py-plugins==0.3.5
# via myst-parser
mdurl==0.1.2
# via markdown-it-py
myst-parser[linkify]==1.0.0
mpire==2.8.0
# via doxysphinx
myst-parser==1.0.0
# via rocm-docs-core
packaging==21.3
# via
Expand All @@ -94,8 +90,11 @@ pygithub==1.58.2
pygments==2.12.0
# via
# accessible-pygments
# mpire
# pydata-sphinx-theme
# sphinx
pyjson5==1.6.4
# via doxysphinx
pyjwt[crypto]==2.6.0
# via pygithub
pynacl==1.5.0
Expand All @@ -115,7 +114,7 @@ requests==2.28.1
# via
# pygithub
# sphinx
rocm-docs-core[api_reference]==0.11.0
rocm-docs-core[api_reference]==0.26.0
# via -r requirements.in
smmap==5.0.0
# via gitdb
Expand Down Expand Up @@ -156,15 +155,11 @@ sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
tqdm==4.66.1
# via mpire
typing-extensions==4.4.0
# via pydata-sphinx-theme
uc-micro-py==1.0.1
# via linkify-it-py
urllib3==1.26.11
# via requests
wrapt==1.15.0
# via deprecated
zipp==3.11.0
# via
# importlib-metadata
# importlib-resources

0 comments on commit 29a532b

Please sign in to comment.