Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ sources/_generated/
.tasks/
venv/
_repos/
_static/ascend_config.json
26 changes: 24 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,40 @@ ASCEND_CONFIG := _static/ascend_config.json
# Fetch script
FETCH_SCRIPT := scripts/fetch_ascend_data.py

# Official ONNX Runtime CANN EP quick start source
ONNXRUNTIME_CANN_MD_URL := https://raw.githubusercontent.com/microsoft/onnxruntime/gh-pages/docs/execution-providers/community-maintained/CANN-ExecutionProvider.md
ONNXRUNTIME_CANN_MD_LOCAL := sources/_generated/sources/onnxruntime/quick_start.md

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile copy-docs clean-submodules fetch-config
.PHONY: help Makefile copy-docs clean-submodules fetch-config sync-onnxruntime-doc

# Fetch ascend config (always run to ensure freshness)
.PHONY: $(ASCEND_CONFIG)
fetch-config:
@echo "Fetching ascend configuration data..."
@python3 $(FETCH_SCRIPT)

# Sync latest ONNX Runtime CANN EP doc from official gh-pages branch
sync-onnxruntime-doc:
@echo "Syncing ONNX Runtime CANN quick start from upstream..."
@mkdir -p $(dir $(ONNXRUNTIME_CANN_MD_LOCAL))
@curl -fsSL "$(ONNXRUNTIME_CANN_MD_URL)" -o "$(ONNXRUNTIME_CANN_MD_LOCAL).tmp"
@awk 'BEGIN{in_fm=0} \
{sub(/\r$$/, "", $$0)} \
NR==1 && $$0=="---" {in_fm=1; next} \
in_fm && $$0=="---" {in_fm=0; next} \
in_fm {next} \
$$0 ~ /^##[[:space:]]+Contents[[:space:]]*$$/ {next} \
$$0 ~ /^\{:[[:space:]]*\.no_toc[[:space:]]*\}$$/ {next} \
$$0 ~ /^\{:[[:space:]]*toc[[:space:]]*\}$$/ {next} \
$$0 ~ /^\*[[:space:]]*TOC[[:space:]]+placeholder[[:space:]]*$$/ {next} \
{print}' "$(ONNXRUNTIME_CANN_MD_LOCAL).tmp" > "$(ONNXRUNTIME_CANN_MD_LOCAL)"
@rm -f "$(ONNXRUNTIME_CANN_MD_LOCAL).tmp"
@echo "Synced to $(ONNXRUNTIME_CANN_MD_LOCAL)"

# Initialize submodules if not exists (use pinned commits for reproducibility)
_repos/verl _repos/VeOmni _repos/LLaMA-Factory _repos/ms-swift:
@echo "Initializing submodules..."
Expand Down Expand Up @@ -65,7 +87,7 @@ clean-submodules:
@git submodule deinit -f _repos/*

# Explicit build targets with prerequisites
html dirhtml singlehtml latex pdf: fetch-config copy-docs
html dirhtml singlehtml latex pdf: fetch-config copy-docs sync-onnxruntime-doc
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# Catch-all target for other Sphinx targets (clean, help, etc.)
Expand Down
39 changes: 39 additions & 0 deletions _static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,45 @@
margin-bottom: 5%;
}

body.onnxruntime-quickstart-page .rst-content {
color: #27384a;
font-size: 16px;
line-height: 1.75;
}

body.onnxruntime-quickstart-page .rst-content h1,
body.onnxruntime-quickstart-page .rst-content h2,
body.onnxruntime-quickstart-page .rst-content h3 {
color: #1f4b8f;
}

body.onnxruntime-quickstart-page .rst-content h1 {
border-bottom: 1px solid #d8e3f2;
padding-bottom: 8px;
}

body.onnxruntime-quickstart-page .rst-content a {
color: #1f63d8;
}

body.onnxruntime-quickstart-page .rst-content table.docutils {
border: 1px solid #d8e3f2;
}

body.onnxruntime-quickstart-page .rst-content table.docutils th {
background: #f2f7ff;
}

body.onnxruntime-quickstart-page .rst-content table.docutils tr:nth-child(even) td {
background: #f9fbff;
}

body.onnxruntime-quickstart-page .rst-content .highlight {
background: #f7faff;
border: 1px solid #d8e3f2;
border-radius: 6px;
}

.box .flex-grow {
flex-grow: 1; /* 让文本内容占据剩余空间 */
}
Expand Down
14 changes: 14 additions & 0 deletions _static/onnxruntime_quickstart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(function () {
function isQuickstartPage() {
var pathname = window.location.pathname.toLowerCase();
return pathname.indexOf('onnxruntime') !== -1 && pathname.indexOf('quick_start') !== -1;
}

document.addEventListener('DOMContentLoaded', function () {
if (!isQuickstartPage()) {
return;
}

document.body.classList.add('onnxruntime-quickstart-page');
});
})();
1 change: 1 addition & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def setup(app):
app.add_css_file('custom.css')
app.add_js_file('package_info.js')
app.add_js_file('statistics.js')
app.add_js_file('onnxruntime_quickstart.js')

# Generate ascend_config.json if it doesn't exist (for RTD/CI builds)
import os.path
Expand Down
2 changes: 1 addition & 1 deletion index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
<div class="project-card">
<div class="card-top"><div class="card-icon" style="background-image: url('_static/images/onnxruntime.png')"></div><h3 class="card-title">onnxruntime</h3></div>
<p class="card-desc">跨平台高性能推理加速器,v1.13.1 起支持昇腾。</p>
<div class="card-footer"><a href="https://github.com/microsoft/onnxruntime">官方链接</a><span class="split">|</span><a href="sources/onnxruntime/install.html">安装指南</a><span class="split">|</span><a href="sources/onnxruntime/quick_start.html">快速上手</a></div>
<div class="card-footer"><a href="https://github.com/microsoft/onnxruntime">官方链接</a><span class="split">|</span><a href="sources/onnxruntime/install.html">安装指南</a><span class="split">|</span><a href="sources/_generated/sources/onnxruntime/quick_start.html">快速上手</a></div>
</div>

<!-- Sentence Transformers -->
Expand Down
2 changes: 1 addition & 1 deletion sources/onnxruntime/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ onnxruntime
:maxdepth: 2

install.rst
quick_start.rst
../_generated/sources/onnxruntime/quick_start
Copy link
Collaborator

@zheliuyu zheliuyu Mar 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After running make, I encountered the following error. It could be an issue with the specified path or a problem with the build files. I'll try again later.

image

Copy link
Collaborator

@zheliuyu zheliuyu Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After rebuilding, it appears that the automatic documentation generation is unaffected.

image

244 changes: 0 additions & 244 deletions sources/onnxruntime/quick_start.rst

This file was deleted.

Loading