Commit 004b3062 authored by Sam Wu's avatar Sam Wu
Browse files

Standardize documentation for ReadtheDocs

Relates to https://github.com/RadeonOpenCompute/rocm-docs-core/issues/330
parent 6aa6c954
......@@ -6,4 +6,4 @@
!*.ini
!/tools/*.sh
!/test/onnx/.onnxrt-commit
!/docs/.sphinx/*.txt
!/docs/sphinx/*.txt
......@@ -6,9 +6,11 @@
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
schedule:
interval: "daily"
labels:
- "documentation"
- package-ecosystem: "pip"
directory: "/tools/accuracy"
schedule:
......
......@@ -69,8 +69,9 @@ docs/_build
docs/_images
docs/_static
docs/_templates
docs/.doxygen/docBin
docs/.doxygen/DoxygenWarningLog.txt
docs/doxygen/DoxygenWarningLog.txt
docs/doxygen/html/
docs/doxygen/xml/
docs/_doxygen
docs/html
/_readthedocs
......
......@@ -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"
......@@ -92,7 +92,7 @@ RUN test -f /usr/local/hash || exit 1
RUN pip3 install yapf==0.28.0
# Install doc requirements
ADD docs/.sphinx/requirements.txt /doc-requirements.txt
ADD docs/sphinx/requirements.txt /doc-requirements.txt
RUN pip3 install -r /doc-requirements.txt
# Install latest ccache version
......
......@@ -213,10 +213,10 @@ Documentation is built using [Doxygen](http://www.stack.nl/~dimitri/doxygen/down
Run the steps below to build documentation locally.
```
```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
```
......
......@@ -24,14 +24,37 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import re
from rocm_docs import ROCmDocs
html_theme_options = {"flavor": "list"}
templates_path = ["."] # Use the current folder for templates
setting_all_article_info = True
all_article_info_os = ["linux"]
docs_core = ROCmDocs("AMD MIGraphX Documentation")
docs_core.run_doxygen()
with open('../CMakeLists.txt', encoding='utf-8') as f:
match = re.search(r'.*\brocm_setup_version\(VERSION\s+([0-9.]+)[^0-9.]+', f.read())
if not match:
raise ValueError("VERSION not found!")
version_number = match[1]
left_nav_title = f"AMD MIGraphX {version_number} Documentation"
# for PDF output on Read the Docs
project = "AMD MIGraphX 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.setup()
external_projects_current_project = "amdmigraphx"
for sphinx_var in ROCmDocs.SPHINX_VARS:
globals()[sphinx_var] = getattr(docs_core, sphinx_var)
......@@ -26,7 +26,7 @@ INPUT = ../../src
MACRO_EXPANSION = YES
OUTPUT_DIRECTORY = docBin
OUTPUT_DIRECTORY = .
PREDEFINED = DOXYGEN
......
# License
```{include} ../LICENSE
```
......@@ -8,3 +8,6 @@ subtrees:
- file: cpp_user_guide
- file: driver
- file: contributor_guide
- caption: About
entries:
- file: license
rocm-docs-core==0.29.0
# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile requirements.in
#
accessible-pygments==0.0.4
# via pydata-sphinx-theme
alabaster==0.7.13
......@@ -41,6 +46,10 @@ idna==3.4
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==6.8.0
# via sphinx
importlib-resources==6.1.1
# via rocm-docs-core
jinja2==3.1.2
# via
# myst-parser
......@@ -75,11 +84,11 @@ 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
# via babel
pyyaml==6.0
# via
# myst-parser
......@@ -89,7 +98,7 @@ requests==2.28.2
# via
# pygithub
# sphinx
rocm-docs-core==0.28.0
rocm-docs-core==0.29.0
# via -r requirements.in
smmap==5.0.0
# via gitdb
......@@ -136,3 +145,7 @@ urllib3==1.26.18
# via requests
wrapt==1.15.0
# via deprecated
zipp==3.17.0
# via
# importlib-metadata
# importlib-resources
......@@ -46,7 +46,7 @@ ENV LANG=C.UTF-8
RUN pip3 install yapf==0.28.0
# Install doc requirements
ADD docs/.sphinx/requirements.txt /doc-requirements.txt
ADD docs/sphinx/requirements.txt /doc-requirements.txt
RUN pip3 install -r /doc-requirements.txt
# Install dependencies
......
......@@ -39,7 +39,7 @@ ENV LANG=C.UTF-8
RUN pip3 install yapf==0.28.0
# Install doc requirements
# ADD docs/.sphinx/requirements.txt /doc-requirements.txt
# ADD docs/sphinx/requirements.txt /doc-requirements.txt
# RUN pip3 install -r /doc-requirements.txt
# Install dependencies
......
......@@ -87,7 +87,7 @@ RUN test -f /usr/local/hash || exit 1
RUN pip3 install yapf==0.28.0
# Install doc requirements
ADD docs/.sphinx/requirements.txt /doc-requirements.txt
ADD docs/sphinx/requirements.txt /doc-requirements.txt
RUN pip3 install -r /doc-requirements.txt
# Install latest ccache version
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment