11 Commits
Author SHA1 Message Date
yuysh c6f664085e Updated workflow
Build Sphinx Documentation / Build Documentation from PR Branch (pull_request) Successful in 2s
2026-04-13 13:34:06 +08:00
yuysh 2147dc4082 Upgrade to python3
Build Sphinx Documentation / Build Documentation from PR Branch (pull_request) Failing after 0s
Deploy Sphinx Documentation / deploy (pull_request) Successful in 1s
2026-04-13 13:28:35 +08:00
yuysh 8308efee63 Merge branch 'Action_Debug' of http://192.168.1.198:3000/yuysh/Manlink_Doc into Action_Debug
Build Sphinx Documentation / Build Documentation from PR Branch (pull_request) Failing after 24s
Deploy Sphinx Documentation / deploy (pull_request) Successful in 9m21s
2025-09-05 11:48:48 +08:00
yuysh b661da845e Merge branch 'master' into Action_Debug
Build Sphinx Documentation / Build Documentation from PR Branch (pull_request) Failing after 24s
2025-09-05 11:48:00 +08:00
yuysh 6e39d12af5 Add --no-cache-dir to prevent error 2025-09-05 11:47:27 +08:00
yuysh 1f8b23e23f Merge pull request 'DPS M060 Docs' (#12) from DPS_M060 into master
Reviewed-on: http://mkb.local:3000/yuysh/Manlink_Doc/pulls/12
2025-09-04 16:26:35 +08:00
yuysh b21966beeb Merge branch 'master' into Action_Debug
Build Sphinx Documentation / Build Documentation from PR Branch (pull_request) Successful in 1m46s
2025-09-04 16:20:49 +08:00
yuysh ec4cd1efc9 Add Custom Rule
Build Sphinx Documentation / Build Documentation from PR Branch (pull_request) Successful in 1m57s
2025-09-04 16:15:06 +08:00
yuysh 1a810c8b9b remove extensions.discard() 2025-09-01 13:23:12 +08:00
yuysh de02d92e85 Merge branch 'master' into DPS_M060
Build Sphinx Documentation / Build Documentation from PR Branch (pull_request) Successful in 2m7s
Deploy Sphinx Documentation / deploy (pull_request) Successful in 1m41s
2025-08-25 16:29:24 +08:00
yuysh 2b3e2029bc Add DPS VI indexing
Build Sphinx Documentation / Build Documentation from PR Branch (pull_request) Successful in 2m8s
2025-08-25 15:33:27 +08:00
14 changed files with 150 additions and 96 deletions
+91 -53
View File
@@ -11,80 +11,118 @@ jobs:
runs-on: linux
steps:
# 第一步:更新主工作树
- name: Update main worktree
# 第一步: 设置主工作树和虚拟环境
- name: Setup main worktree and virtual environment
run: |
echo "=== Updating main worktree ==="
echo "=== Setting up main worktree ==="
# 如果主目录不存在,克隆仓库
if [ ! -d "/home/ly0kos/work/test_env" ]; then
echo "Cloning repository to main worktree..."
git clone http://localhost:3000/yuysh/Manlink_Doc.git /home/ly0kos/work/test_env
cd /home/ly0kos/work/test_env
# 创建共享虚拟环境
python3 -m venv .venv-shared
source .venv-shared/bin/activate
pip install --upgrade pip
pip install sphinx sphinx-rtd-theme
# 记录初始依赖状态
if [ -f "requirements.txt" ]; then
pip install -r requirements.txt
stat -c %Y requirements.txt > .venv-shared/last_update.txt
fi
else
cd /home/ly0kos/work/test_env
git fetch --all --prune
git checkout master
git pull origin master
fi
echo "✓ Main worktree ready"
# 第二步: 为PR分支创建工作树
- name: Create worktree for PR branch
run: |
echo "=== Creating worktree for PR branch: ${{ github.head_ref }} ==="
cd /home/ly0kos/work/test_env
git fetch --all --prune
git checkout master
git pull origin master
# 清理可能存在的旧工作树
WORKTREE_DIR="/home/ly0kos/work/test_env/worktrees/${{ github.head_ref }}"
if [ -d "$WORKTREE_DIR" ]; then
echo "Removing existing worktree..."
git worktree remove "$WORKTREE_DIR" --force 2>/dev/null || true
rm -rf "$WORKTREE_DIR" 2>/dev/null || true
fi
echo "✓ Main worktree updated"
# 创建新的工作树
mkdir -p "/home/ly0kos/work/test_env/worktrees"
git fetch origin ${{ github.head_ref }}:${{ github.head_ref }} --force
git worktree add "/home/ly0kos/work/test_env/worktrees/${{ github.head_ref }}" ${{ github.head_ref }} --force
echo "✓ Worktree created at: /home/ly0kos/work/test_env/worktrees/${{ github.head_ref }}"
# 第二步:复用共享虚拟环境
# 第三步: 复用共享虚拟环境并检查依赖更新
- name: Reuse shared virtual environment
run: |
echo "=== Using shared virtual environment ==="
echo "=== Reusing shared virtual environment ==="
cd /home/ly0kos/work/test_env
WORKTREE_DIR="/home/ly0kos/work/test_env/worktrees/${{ github.head_ref }}"
# 使用主工作树的共享虚拟环境
source .venv-shared/bin/activate
# 检查分支的requirements.txt是否有更新
if [ -f "requirements.txt" ]; then
REQ_MOD_TIME=$(stat -c %Y requirements.txt 2>/dev/null || echo 0)
# 检查PR分支的requirements.txt是否有更新
if [ -f "$WORKTREE_DIR/requirements.txt" ]; then
echo "Checking for dependency updates in PR branch..."
REQ_MOD_TIME=$(stat -c %Y "$WORKTREE_DIR/requirements.txt" 2>/dev/null || echo 0)
VENV_MOD_TIME=$(cat .venv-shared/last_update.txt 2>/dev/null || echo 0)
if [ $REQ_MOD_TIME -gt $VENV_MOD_TIME ]; then
echo "Master branch requirements updated, installing new dependencies..."
pip install -r requirements.txt
echo "PR branch requirements updated, installing new dependencies..."
pip install -r "$WORKTREE_DIR/requirements.txt"
echo $REQ_MOD_TIME > .venv-shared/last_update.txt
echo "Dependencies updated from PR branch"
else
echo "No changes in requirements, using existing packages"
fi
fi
echo "python3: $(python3 --version)"
echo "Sphinx: $(sphinx-build --version 2>/dev/null || echo 'Not installed')"
# 第三步:从主工作树构建文档
- name: Build documentation from master
# 第四步: 在工作树构建文档
- name: Build documentation in worktree
run: |
echo "=== Building production documentation ==="
echo "=== Building documentation in worktree ==="
cd /home/ly0kos/work/test_env
WORKTREE_DIR="/home/ly0kos/work/test_env/worktrees/${{ github.head_ref }}"
source .venv-shared/bin/activate
rm -rf build/
sphinx-build -b html source build -v -j 4
echo "✓ Production build completed"
# 构建文档
cd "$WORKTREE_DIR"
sphinx-build -b html source "$WORKTREE_DIR/build" -v -j 4
# 复制到预览位置
mkdir -p /home/ly0kos/work/test_env/pr-builds/
rm -rf /home/ly0kos/work/test_env/pr-builds/${{ github.head_ref }}
cp -r "$WORKTREE_DIR/build" /home/ly0kos/work/test_env/pr-builds/${{ github.head_ref }}
echo "✓ Build completed for PR branch: ${{ github.head_ref }}"
# 第四步:部署到Web服务器
- name: Deploy to web server
# 第五步: 验证构建结果
- name: Verify build
run: |
echo "=== Deploying to production ==="
cd /home/ly0kos/work/test_env
rm -rf /var/www/docs_dev/*
cp -r build/* /var/www/docs_dev/
echo "✓ Documentation deployed"
# 第五步:清理PR工作树
- name: Cleanup PR worktree
echo "Build output for PR ${{ github.head_ref }}:"
ls -la /home/ly0kos/work/test_env/pr-builds/${{ github.head_ref }}/ | head -10
# 第六步: 复制至测试目录
- name: Copy to dev folder
run: |
echo "=== Cleaning up PR worktree ==="
cd /home/ly0kos/work/test_env
WORKTREE_DIR="/home/ly0kos/work/test_env/worktrees/${{ github.head_ref }}"
if [ -d "$WORKTREE_DIR" ]; then
git worktree remove "$WORKTREE_DIR" --force
echo "✓ Removed worktree for ${{ github.head_ref }}"
fi
# 清理预览文件
PREVIEW_DIR="/home/ly0kos/work/test_env/pr-builds/${{ github.head_ref }}"
if [ -d "$PREVIEW_DIR" ]; then
rm -rf "$PREVIEW_DIR"
echo "✓ Removed preview for ${{ github.head_ref }}"
fi
# 第六步:验证部署
- name: Verify deployment
run: |
echo "Production deployment completed!"
ls -la /var/www/docs_dev/ | head -10
echo "Now clear dev folder"
rm -rf /var/www/docs/*
echo "Copy build to dev folder"
cp -r /home/ly0kos/work/test_env/pr-builds/${{ github.head_ref }}/* /var/www/docs/
echo "✓ Documentation in Product folder now!"
echo "Please check http://mkb.local to See Changes"
+10 -9
View File
@@ -11,7 +11,7 @@ jobs:
runs-on: linux
steps:
# 第一步设置主工作树和虚拟环境
# 第一步: 设置主工作树和虚拟环境
- name: Setup main worktree and virtual environment
run: |
echo "=== Setting up main worktree ==="
@@ -23,7 +23,7 @@ jobs:
cd /home/ly0kos/work/test_env
# 创建共享虚拟环境
python -m venv .venv-shared
python3 -m venv .venv-shared
source .venv-shared/bin/activate
pip install --upgrade pip
pip install sphinx sphinx-rtd-theme
@@ -42,7 +42,7 @@ jobs:
echo "✓ Main worktree ready"
# 第二步为PR分支创建工作树
# 第二步: 为PR分支创建工作树
- name: Create worktree for PR branch
run: |
echo "=== Creating worktree for PR branch: ${{ github.head_ref }} ==="
@@ -63,7 +63,7 @@ jobs:
echo "✓ Worktree created at: /home/ly0kos/work/test_env/worktrees/${{ github.head_ref }}"
# 第三步复用共享虚拟环境并检查依赖更新
# 第三步: 复用共享虚拟环境并检查依赖更新
- name: Reuse shared virtual environment
run: |
echo "=== Reusing shared virtual environment ==="
@@ -89,10 +89,10 @@ jobs:
fi
fi
echo "Python: $(python --version)"
echo "python3: $(python3 --version)"
echo "Sphinx: $(sphinx-build --version 2>/dev/null || echo 'Not installed')"
# 第四步在工作树中构建文档
# 第四步: 在工作树中构建文档
- name: Build documentation in worktree
run: |
echo "=== Building documentation in worktree ==="
@@ -111,13 +111,13 @@ jobs:
echo "✓ Build completed for PR branch: ${{ github.head_ref }}"
# 第五步验证构建结果
# 第五步: 验证构建结果
- name: Verify build
run: |
echo "Build output for PR ${{ github.head_ref }}:"
ls -la /home/ly0kos/work/test_env/pr-builds/${{ github.head_ref }}/ | head -10
# 第六步复制至测试目录
# 第六步: 复制至测试目录
- name: Copy to dev folder
run: |
echo "Now clear dev folder"
@@ -125,4 +125,5 @@ jobs:
echo "Copy build to dev folder"
cp -r /home/ly0kos/work/test_env/pr-builds/${{ github.head_ref }}/* /var/www/docs_dev/
echo "✓ Documentation in DEV folder now!"
echo "Please check http://mkb.local:880 to Verify Changes"
echo "Please check http://mkb.local:880 to Verify Changes"
+2 -1
View File
@@ -6,4 +6,5 @@ M060 Specifications
:maxdepth: 1
:glob:
*
*
VI/index
+17
View File
@@ -0,0 +1,17 @@
document.addEventListener('DOMContentLoaded', function() {
// 禁用右键菜单
document.addEventListener('contextmenu', function(e) {
e.preventDefault();
});
// 禁用文本选择
document.styleSheets[0].addRule('body', '-webkit-user-select: none!important;');
document.styleSheets[0].addRule('body', '-moz-user-select: none!important;');
document.styleSheets[0].addRule('body', '-ms-user-select: none!important;');
document.styleSheets[0].addRule('body', 'user-select: none!important;');
// 禁用拖拽
document.addEventListener('dragstart', function(e) {
e.preventDefault();
});
});
+4 -1
View File
@@ -59,6 +59,10 @@ html_theme_options = {
# ================= 高级功能 =================
html_js_files = [
'custom.js'
]
# ================== Mermaid 配置 ==================
def find_system_chrome():
"""自动检测系统 Chrome/Chromium 可执行路径"""
@@ -117,7 +121,6 @@ try:
except Exception as e:
print(f"⚠️ Mermaid 初始化失败: {e}")
print("⚠️ 图表将显示为代码块,请安装 Chrome 和 mermaid-cli")
extensions.discard('sphinxcontrib.mermaid')
# ================= CHM特化配置 =================
if is_chm_build:
-32
View File
@@ -1,32 +0,0 @@
---
title: ManLin 硬件产品知识库
---
# ManLin 硬件产品知识库
```{toctree}
:maxdepth: 1
:caption: 目录
Mars_1KS/index
Calibration/index
Lab_Report/index
```
## 附加文档
1. [AD5522](_static/data/add_docs/AD5522.pdf)
2. :::{dropdown} Power DataSheets
- [LTM4655](_static/data/add_docs/Pwr_DataSheet/ltm4655.pdf)
- [MIC29502](_static/data/add_docs/Pwr_DataSheet/MIC29502.pdf)
- [LMR51450](_static/data/add_docs/Pwr_DataSheet/LMR51450.pdf)
- [TPS54627](_static/data/add_docs/Pwr_DataSheet/tps54627.pdf)
- [TPS54821](_static/data/add_docs/Pwr_DataSheet/tps54821.pdf)
- [TPS563209](_static/data/add_docs/Pwr_DataSheet/tps563209.pdf)
- [LT3091](_static/data/add_docs/Pwr_DataSheet/lt3091.pdf)
:::
3.
+26
View File
@@ -0,0 +1,26 @@
.. ManLin_KnowledgeBase documentation master file, created by
sphinx-quickstart on Tue Aug 12 05:35:46 2025.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. ManLin 硬件知识库主索引文件
.. 注意:此文件使用 reStructuredText 语法,但支持包含 Markdown 文件
##############################
ManLin 硬件产品知识库
##############################
.. toctree::
:maxdepth: 1
:caption: Contents:
Mars_1KS/index
Calibration/index
Lab_Report/index
*Additional Docs:*
1. `AD5522 <_static/data/add_docs/AD5522.pdf>`_