Skip to content

Commit

Permalink
Standardize documentation for ReadtheDocs (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
samjwu authored Jan 15, 2024
1 parent 5644fac commit 4c32768
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 23 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: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ build*/
### clangd. ###
/.cache

### Docs dirs ###
doc/html/
doc/xml/
doc/latex/
doc/*.tag

# Created by https://www.gitignore.io/api/c++,cmake

### C++ ###
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ formats: [htmlzip, pdf, epub]

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

build:
os: ubuntu-22.04
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ To build our documentation locally, use the following code:
cd rocPRIM; cd docs

# Install Python dependencies
python3 -m pip install -r .sphinx/requirements.txt
python3 -m pip install -r sphinx/requirements.txt

# Build the documentation
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
Expand Down
11 changes: 4 additions & 7 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/_build/
/_doxygen/
/_images/
/_static/
/_templates/
/.doxygen/docBin
/.doxygen/rocPRIM.tag
/.sphinx/_toc.yml
/api
/doxygen/html
/doxygen/xml
/doxygen/*.tag
/sphinx/_toc.yml
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,12 +4,32 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import re

from rocm_docs import ROCmDocs

docs_core = ROCmDocs("rocPRIM Documentation")
docs_core.run_doxygen()
with open('../CMakeLists.txt', encoding='utf-8') as f:
match = re.search(r'.*\bset\(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"rocPRIM {version_number} Documentation"

# for PDF output on Read the Docs
project = "rocPRIM 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 = "rocprim"

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

Expand Down
2 changes: 1 addition & 1 deletion 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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.txt
3 changes: 3 additions & 0 deletions docs/.sphinx/_toc.yml.in → docs/sphinx/_toc.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ subtrees:
- file: iterators
- file: intrinsics
- file: glossary
- 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 4c32768

Please sign in to comment.