Skip to content

Commit

Permalink
Standardize documentation for ReadtheDocs (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
samjwu authored Jan 2, 2024
1 parent 9885eeb commit 23d9be8
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
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"
Expand Down
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ tags

# build-in-source directory and documentation artifacts
build/
_build/
_images/
_static/
_templates/
_toc.yml
_doxygen
docBin/

# matrices
*.csr
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ python:
- requirements: docs/sphinx/requirements.txt

build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.8"
6 changes: 6 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_build/
_doxygen/
doxygen/html/
doxygen/xml/
doxygen/*.tag
sphinx/_toc.yml
24 changes: 20 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,26 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

from rocm_docs import ROCmDocs
import re

external_projects_current_project = "hipsparselt"
from rocm_docs import ROCmDocs

docs_core = ROCmDocs("hipSPARSELt Documentation")
docs_core.run_doxygen(doxygen_root="doxygen", doxygen_path="doxygen/docBin/xml")
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"hipSPARSELt {version_number} Documentation"

# for PDF output on Read the Docs
project = "hipSPARSELt Documentation"
author = "Advanced Micro Devices, Inc."
copyright = "Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved."
version = version_number
release = version_number

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()

Expand All @@ -19,6 +33,8 @@

external_toc_path = "./sphinx/_toc.yml"

external_projects_current_project = "hipsparselt"

suppress_warnings = ["etoc.toctree"]

for sphinx_var in ROCmDocs.SPHINX_VARS:
Expand Down
6 changes: 3 additions & 3 deletions 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 @@ -2239,7 +2239,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 Expand Up @@ -2572,4 +2572,4 @@ GENERATE_LEGEND = YES
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.

DOT_CLEANUP = YES
DOT_CLEANUP = YES
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Our documentation is structured as follows:
* :ref:`device-stream-manage`
* :ref:`storage-format`
* :ref:`porting`
* :doc:`API library <../doxygen/docBin/html/index>`
* :doc:`API library <../doxygen/html/index>`

.. card:: :ref:`tutorials-index`

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
2 changes: 1 addition & 1 deletion docs/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ The API reference guide is organized into the following sections:
* :ref:`device-stream-manage`
* :ref:`storage-format`
* :ref:`porting`
* :doc:`API library <../doxygen/docBin/html/index>`
* :doc:`API library <../doxygen/html/index>`
6 changes: 5 additions & 1 deletion docs/sphinx/_toc.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ subtrees:
title: Storage formats
- file: reference/porting.rst
title: Porting from CUDA
- file: doxygen/docBin/html/index
- file: doxygen/html/index
title: API library

- file: tutorials/index.rst
Expand All @@ -33,3 +33,7 @@ subtrees:
- entries:
- file: tutorials/install/linux.rst
title: Installing and building hipSPARSELt for Linux

- caption: About
entries:
- file: license
2 changes: 1 addition & 1 deletion docs/sphinx/requirements.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rocm-docs-core[api_reference]>=0.24.0
rocm-docs-core[api_reference]==0.30.3
15 changes: 12 additions & 3 deletions docs/sphinx/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ idna==3.4
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==7.0.1
# via sphinx
importlib-resources==6.1.1
# via rocm-docs-core
jinja2==3.1.2
# via
# myst-parser
Expand Down Expand Up @@ -101,6 +105,8 @@ pynacl==1.5.0
# via pygithub
pyparsing==3.1.1
# via doxysphinx
pytz==2023.3.post1
# via babel
pyyaml==6.0
# via
# myst-parser
Expand All @@ -110,7 +116,7 @@ requests==2.28.2
# via
# pygithub
# sphinx
rocm-docs-core[api_reference]>=0.24.0
rocm-docs-core[api_reference]==0.30.3
# via -r requirements.in
smmap==5.0.0
# via gitdb
Expand Down Expand Up @@ -139,7 +145,6 @@ sphinx-external-toc==0.3.1
# via rocm-docs-core
sphinx-notfound-page==0.8.3
# via rocm-docs-core
sphinx-tabs
sphinxcontrib-applehelp==1.0.4
# via sphinx
sphinxcontrib-devhelp==1.0.2
Expand All @@ -159,4 +164,8 @@ typing-extensions==4.5.0
urllib3==1.26.15
# via requests
wrapt==1.15.0
# via deprecated
# via deprecated
zipp==3.17.0
# via
# importlib-metadata
# importlib-resources

0 comments on commit 23d9be8

Please sign in to comment.