"...pruning/git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "e773dfcceed9719a6ce8afa0cff35561060f0cc6"
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 @@ ...@@ -6,4 +6,4 @@
!*.ini !*.ini
!/tools/*.sh !/tools/*.sh
!/test/onnx/.onnxrt-commit !/test/onnx/.onnxrt-commit
!/docs/.sphinx/*.txt !/docs/sphinx/*.txt
...@@ -6,9 +6,11 @@ ...@@ -6,9 +6,11 @@
version: 2 version: 2
updates: updates:
- package-ecosystem: "pip" # See documentation for possible values - package-ecosystem: "pip" # See documentation for possible values
directory: "/docs/.sphinx" # Location of package manifests directory: "/docs/sphinx" # Location of package manifests
schedule: schedule:
interval: "daily" interval: "daily"
labels:
- "documentation"
- package-ecosystem: "pip" - package-ecosystem: "pip"
directory: "/tools/accuracy" directory: "/tools/accuracy"
schedule: schedule:
......
...@@ -69,8 +69,9 @@ docs/_build ...@@ -69,8 +69,9 @@ docs/_build
docs/_images docs/_images
docs/_static docs/_static
docs/_templates docs/_templates
docs/.doxygen/docBin docs/doxygen/DoxygenWarningLog.txt
docs/.doxygen/DoxygenWarningLog.txt docs/doxygen/html/
docs/doxygen/xml/
docs/_doxygen docs/_doxygen
docs/html docs/html
/_readthedocs /_readthedocs
......
...@@ -6,13 +6,13 @@ version: 2 ...@@ -6,13 +6,13 @@ version: 2
sphinx: sphinx:
configuration: docs/conf.py configuration: docs/conf.py
formats: [htmlzip] formats: [htmlzip, pdf, epub]
python: python:
install: install:
- requirements: docs/.sphinx/requirements.txt - requirements: docs/sphinx/requirements.txt
build: build:
os: ubuntu-20.04 os: ubuntu-22.04
tools: tools:
python: "3.8" python: "3.8"
...@@ -92,7 +92,7 @@ RUN test -f /usr/local/hash || exit 1 ...@@ -92,7 +92,7 @@ RUN test -f /usr/local/hash || exit 1
RUN pip3 install yapf==0.28.0 RUN pip3 install yapf==0.28.0
# Install doc requirements # 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 RUN pip3 install -r /doc-requirements.txt
# Install latest ccache version # Install latest ccache version
......
...@@ -213,10 +213,10 @@ Documentation is built using [Doxygen](http://www.stack.nl/~dimitri/doxygen/down ...@@ -213,10 +213,10 @@ Documentation is built using [Doxygen](http://www.stack.nl/~dimitri/doxygen/down
Run the steps below to build documentation locally. Run the steps below to build documentation locally.
``` ```bash
cd docs 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 python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
``` ```
......
...@@ -24,14 +24,37 @@ ...@@ -24,14 +24,37 @@
# list see the documentation: # list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html # https://www.sphinx-doc.org/en/master/usage/configuration.html
import re
from rocm_docs import ROCmDocs from rocm_docs import ROCmDocs
html_theme_options = {"flavor": "list"}
templates_path = ["."] # Use the current folder for templates
setting_all_article_info = True setting_all_article_info = True
all_article_info_os = ["linux"] all_article_info_os = ["linux"]
docs_core = ROCmDocs("AMD MIGraphX Documentation") with open('../CMakeLists.txt', encoding='utf-8') as f:
docs_core.run_doxygen() 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() docs_core.setup()
external_projects_current_project = "amdmigraphx"
for sphinx_var in ROCmDocs.SPHINX_VARS: for sphinx_var in ROCmDocs.SPHINX_VARS:
globals()[sphinx_var] = getattr(docs_core, sphinx_var) globals()[sphinx_var] = getattr(docs_core, sphinx_var)
...@@ -26,7 +26,7 @@ INPUT = ../../src ...@@ -26,7 +26,7 @@ INPUT = ../../src
MACRO_EXPANSION = YES MACRO_EXPANSION = YES
OUTPUT_DIRECTORY = docBin OUTPUT_DIRECTORY = .
PREDEFINED = DOXYGEN PREDEFINED = DOXYGEN
......
# License
```{include} ../LICENSE
```
...@@ -8,3 +8,6 @@ subtrees: ...@@ -8,3 +8,6 @@ subtrees:
- file: cpp_user_guide - file: cpp_user_guide
- file: driver - file: driver
- file: contributor_guide - 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 accessible-pygments==0.0.4
# via pydata-sphinx-theme # via pydata-sphinx-theme
alabaster==0.7.13 alabaster==0.7.13
...@@ -41,6 +46,10 @@ idna==3.4 ...@@ -41,6 +46,10 @@ idna==3.4
# via requests # via requests
imagesize==1.4.1 imagesize==1.4.1
# via sphinx # via sphinx
importlib-metadata==6.8.0
# via sphinx
importlib-resources==6.1.1
# via rocm-docs-core
jinja2==3.1.2 jinja2==3.1.2
# via # via
# myst-parser # myst-parser
...@@ -75,11 +84,11 @@ pygments==2.15.0 ...@@ -75,11 +84,11 @@ pygments==2.15.0
# pydata-sphinx-theme # pydata-sphinx-theme
# sphinx # sphinx
pyjwt[crypto]==2.6.0 pyjwt[crypto]==2.6.0
# via # via pygithub
# pygithub
# pyjwt
pynacl==1.5.0 pynacl==1.5.0
# via pygithub # via pygithub
pytz==2023.3.post1
# via babel
pyyaml==6.0 pyyaml==6.0
# via # via
# myst-parser # myst-parser
...@@ -89,7 +98,7 @@ requests==2.28.2 ...@@ -89,7 +98,7 @@ requests==2.28.2
# via # via
# pygithub # pygithub
# sphinx # sphinx
rocm-docs-core==0.28.0 rocm-docs-core==0.29.0
# via -r requirements.in # via -r requirements.in
smmap==5.0.0 smmap==5.0.0
# via gitdb # via gitdb
...@@ -136,3 +145,7 @@ urllib3==1.26.18 ...@@ -136,3 +145,7 @@ urllib3==1.26.18
# via requests # via requests
wrapt==1.15.0 wrapt==1.15.0
# via deprecated # via deprecated
zipp==3.17.0
# via
# importlib-metadata
# importlib-resources
...@@ -46,7 +46,7 @@ ENV LANG=C.UTF-8 ...@@ -46,7 +46,7 @@ ENV LANG=C.UTF-8
RUN pip3 install yapf==0.28.0 RUN pip3 install yapf==0.28.0
# Install doc requirements # 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 RUN pip3 install -r /doc-requirements.txt
# Install dependencies # Install dependencies
......
...@@ -39,7 +39,7 @@ ENV LANG=C.UTF-8 ...@@ -39,7 +39,7 @@ ENV LANG=C.UTF-8
RUN pip3 install yapf==0.28.0 RUN pip3 install yapf==0.28.0
# Install doc requirements # 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 # RUN pip3 install -r /doc-requirements.txt
# Install dependencies # Install dependencies
......
...@@ -87,7 +87,7 @@ RUN test -f /usr/local/hash || exit 1 ...@@ -87,7 +87,7 @@ RUN test -f /usr/local/hash || exit 1
RUN pip3 install yapf==0.28.0 RUN pip3 install yapf==0.28.0
# Install doc requirements # 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 RUN pip3 install -r /doc-requirements.txt
# Install latest ccache version # 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