mirror of
https://github.com/ROCm/ROCm.git
synced 2026-01-09 06:38:00 -05:00
Set environment variables for RTD builds (#113)
* Format conf.py with black and isort * Set env vars for RTD builds * Define html_context * Use rocm-stg for canonical url
This commit is contained in:
45
docs/conf.py
45
docs/conf.py
@@ -4,9 +4,10 @@
|
||||
# list see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
import shutil
|
||||
import jinja2
|
||||
import os
|
||||
import shutil
|
||||
|
||||
import jinja2
|
||||
|
||||
# Environment to process Jinja templates.
|
||||
jinja_env = jinja2.Environment(loader=jinja2.FileSystemLoader("."))
|
||||
@@ -18,10 +19,10 @@ templates = []
|
||||
# For example: 'install.md.jinja' becomes 'install.md'.
|
||||
for template in templates:
|
||||
rendered = jinja_env.get_template(template).render()
|
||||
with open(os.path.splitext(template)[0], 'w') as file:
|
||||
with open(os.path.splitext(template)[0], "w") as file:
|
||||
file.write(rendered)
|
||||
|
||||
shutil.copy2('../RELEASE.md','./about/release-notes.md')
|
||||
shutil.copy2("../RELEASE.md", "./about/release-notes.md")
|
||||
|
||||
latex_engine = "xelatex"
|
||||
latex_elements = {
|
||||
@@ -44,24 +45,15 @@ all_article_info_author = ""
|
||||
|
||||
# pages with specific settings
|
||||
article_pages = [
|
||||
{
|
||||
"file":"about/release-notes",
|
||||
"os":["linux", "windows"],
|
||||
"date":"2024-06-04"
|
||||
},
|
||||
{
|
||||
"file":"about/changelog",
|
||||
"os":["linux", "windows"],
|
||||
"date":"2024-06-04"
|
||||
},
|
||||
|
||||
{"file":"how-to/deep-learning-rocm", "os":["linux"]},
|
||||
{"file":"how-to/gpu-enabled-mpi", "os":["linux"]},
|
||||
{"file":"how-to/system-debugging", "os":["linux"]},
|
||||
{"file":"how-to/tuning-guides", "os":["linux", "windows"]},
|
||||
{"file": "about/release-notes", "os": ["linux", "windows"], "date": "2024-06-04"},
|
||||
{"file": "about/changelog", "os": ["linux", "windows"], "date": "2024-06-04"},
|
||||
{"file": "how-to/deep-learning-rocm", "os": ["linux"]},
|
||||
{"file": "how-to/gpu-enabled-mpi", "os": ["linux"]},
|
||||
{"file": "how-to/system-debugging", "os": ["linux"]},
|
||||
{"file": "how-to/tuning-guides", "os": ["linux", "windows"]},
|
||||
]
|
||||
|
||||
exclude_patterns = ['temp']
|
||||
exclude_patterns = ["temp"]
|
||||
|
||||
external_toc_path = "./sphinx/_toc.yml"
|
||||
|
||||
@@ -69,6 +61,11 @@ extensions = ["rocm_docs", "sphinx_reredirects"]
|
||||
|
||||
external_projects_current_project = "rocm"
|
||||
|
||||
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "https://rocm-stg.amd.com")
|
||||
html_context = {}
|
||||
if os.environ.get("READTHEDOCS", "") == "True":
|
||||
html_context["READTHEDOCS"] = True
|
||||
|
||||
html_theme = "rocm_docs_theme"
|
||||
html_theme_options = {"flavor": "rocm-docs-home"}
|
||||
|
||||
@@ -77,10 +74,6 @@ html_css_files = ["rocm_custom.css"]
|
||||
|
||||
html_title = "ROCm Documentation"
|
||||
|
||||
html_theme_options = {
|
||||
"link_main_doc": False
|
||||
}
|
||||
html_theme_options = {"link_main_doc": False}
|
||||
|
||||
redirects = {
|
||||
"reference/openmp/openmp": "../../about/compatibility/openmp.html"
|
||||
}
|
||||
redirects = {"reference/openmp/openmp": "../../about/compatibility/openmp.html"}
|
||||
|
||||
Reference in New Issue
Block a user