Skip to content

Commit a8dad95

Browse files
Update documentation for release/0.10
1 parent 1241e27 commit a8dad95

File tree

184 files changed

+4854
-1931
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+4854
-1931
lines changed
Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#
2-
# Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved.
2+
# Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
33
# SPDX-License-Identifier: MIT
44
#
55

66
import os
7+
78
from sphinx.util import logging
89

910
logger = logging.getLogger(__name__)
1011

12+
1113
def update_jupyter_notebook_toc_placeholder(app, docname, source):
1214
"""
1315
Replace THE *.ipynb references by *.rst from @quark_jupyter_notebook_toc_placeholder@ toc when QUARK_SPHINX_BUILD_SKIP_TUTORIALS is set on env var
@@ -21,32 +23,43 @@ def update_jupyter_notebook_toc_placeholder(app, docname, source):
2123
```
2224
"""
2325

24-
jupyter_notebook_index_rst = os.path.join('source', 'jupyter_notebook_index.rst_')
26+
jupyter_notebook_index_rst = os.path.join("source", "jupyter_notebook_index.rst_")
2527
if "READTHEDOCS" in os.environ:
2628
READTHEDOCS_REPOSITORY_PATH = os.environ.get("READTHEDOCS_REPOSITORY_PATH")
27-
jupyter_notebook_index_rst = os.path.join(READTHEDOCS_REPOSITORY_PATH, 'docs', 'source', 'jupyter_notebook_index.rst_')
28-
jupyter_notebook_toc_placeholder = '@quark_jupyter_notebook_toc_placeholder@'
29-
with open(jupyter_notebook_index_rst, 'r') as f:
29+
jupyter_notebook_index_rst = os.path.join(
30+
READTHEDOCS_REPOSITORY_PATH, "docs", "source", "jupyter_notebook_index.rst_"
31+
)
32+
jupyter_notebook_toc_placeholder = "@quark_jupyter_notebook_toc_placeholder@"
33+
with open(jupyter_notebook_index_rst) as f:
3034
quark_jupyter_notebook_toc = f.read().strip()
3135

32-
generate_jupyter_notebook_docs = "QUARK_SPHINX_BUILD_SKIP_TUTORIALS" not in os.environ or os.environ["QUARK_SPHINX_BUILD_SKIP_TUTORIALS"].lower() in ("0", "false", "off")
36+
generate_jupyter_notebook_docs = "QUARK_SPHINX_BUILD_SKIP_TUTORIALS" not in os.environ or os.environ[
37+
"QUARK_SPHINX_BUILD_SKIP_TUTORIALS"
38+
].lower() in ("0", "false", "off")
3339
if not generate_jupyter_notebook_docs:
34-
quark_jupyter_notebook_toc = quark_jupyter_notebook_toc.replace('.ipynb', '.rst')
40+
quark_jupyter_notebook_toc = quark_jupyter_notebook_toc.replace(".ipynb", ".rst")
3541

36-
if jupyter_notebook_toc_placeholder in source[0]: # Only process documents containing `jupyter_notebook_toc_placeholder`
42+
if (
43+
jupyter_notebook_toc_placeholder in source[0]
44+
): # Only process documents containing `jupyter_notebook_toc_placeholder`
3745
source[0] = source[0].replace(jupyter_notebook_toc_placeholder, quark_jupyter_notebook_toc)
38-
if '.rst' in quark_jupyter_notebook_toc:
39-
logger.info(f'Replaced {jupyter_notebook_toc_placeholder} with ReStructuredText tutorials at jupyter_notebook_index_rst and indexed by {docname}.rst')
46+
if ".rst" in quark_jupyter_notebook_toc:
47+
logger.info(
48+
f"Replaced {jupyter_notebook_toc_placeholder} with ReStructuredText tutorials at jupyter_notebook_index_rst and indexed by {docname}.rst"
49+
)
4050
else:
41-
logger.info(f'Replaced {jupyter_notebook_toc_placeholder} with Jupyter Notebook tutorials at jupyter_notebook_index_rst and indexed by {docname}.rst')
51+
logger.info(
52+
f"Replaced {jupyter_notebook_toc_placeholder} with Jupyter Notebook tutorials at jupyter_notebook_index_rst and indexed by {docname}.rst"
53+
)
54+
4255

4356
def setup(app):
4457
"""
4558
Setup Sphinx extension
4659
"""
47-
app.connect('source-read', update_jupyter_notebook_toc_placeholder)
60+
app.connect("source-read", update_jupyter_notebook_toc_placeholder)
4861
return {
49-
'version': '1.0',
50-
'parallel_read_safe': True,
51-
'parallel_write_safe': True,
62+
"version": "1.0",
63+
"parallel_read_safe": True,
64+
"parallel_write_safe": True,
5265
}

docs/source/_ext/quark_version_substitution.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@
77

88
logger = logging.getLogger(__name__)
99

10+
1011
def update_release_placeholder(app, docname, source):
1112
"""
1213
Replace all occurrences of @version@ with actual version number
1314
"""
1415
release_version = app.config.release
15-
if '@version@' in source[0]: # Only process documents containing @version@
16-
source[0] = source[0].replace('@version@', release_version)
17-
logger.info(f'Replaced @version@ placeholder with Quark version {release_version} in {docname}.rst')
16+
if "@version@" in source[0]: # Only process documents containing @version@
17+
source[0] = source[0].replace("@version@", release_version)
18+
logger.info(f"Replaced @version@ placeholder with Quark version {release_version} in {docname}.rst")
19+
1820

1921
def setup(app):
2022
"""
2123
Setup Sphinx extension
2224
"""
23-
app.connect('source-read', update_release_placeholder)
25+
app.connect("source-read", update_release_placeholder)
2426
return {
25-
'version': '1.0',
26-
'parallel_read_safe': True,
27-
'parallel_write_safe': True,
27+
"version": "1.0",
28+
"parallel_read_safe": True,
29+
"parallel_write_safe": True,
2830
}
20.9 KB
51.2 KB
149 KB
566 KB
29 KB
142 KB
641 KB
22 KB

0 commit comments

Comments
 (0)