Skip to content

Commit ffdaa6b

Browse files
committed
docs: 更新文档配置和安装说明
- 在文档索引中添加隐藏目录配置 - 更新Python和PyTorch安装版本说明 - 简化文档版本获取逻辑
1 parent 0961841 commit ffdaa6b

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ pip install torch-book
5656

5757
推荐[使用 `anaconda3` 配置环境](https://www.zhihu.com/zvideo/1423062760733700096)
5858
```bash
59-
conda create -n ai python=3.12
59+
conda create -n ai python=3.14
6060
conda activate ai
6161
pip install -e .[doc,dev]
6262
```
6363

6464
安装 PyTorch GPU 版本(其他版本见 [PyTorch 安装指南](https://pytorch.org/get-started/locally/)):
6565
```bash
66-
conda install pytorch torchvision torchaudio pytorch-cuda=12.4 -c pytorch -c nvidia
66+
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130
6767
```
6868

6969
## 文档构建

doc/conf.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import os
1212
import sys
1313
from pathlib import Path
14-
14+
from importlib.metadata import version as _pkg_version
1515
# === Platform-Specific Configuration ===
1616
if sys.platform == 'win32':
1717
import asyncio
@@ -35,11 +35,7 @@ def get_project_root():
3535
# ================================= 项目基本信息 =================================
3636
project = "torch-book" # 文档项目名称
3737
author = "xinetzone" # 文档作者
38-
try:
39-
from importlib.metadata import version as _pkg_version
40-
release = _pkg_version("taolib")
41-
except Exception:
42-
release = os.environ.get("TAOLIB_VERSION", "0.0.0")
38+
release = _pkg_version("torch-book")
4339
copyright = '2021, xinetzone' # 版权信息
4440
# ================================= 国际化与本地化设置 ==============================
4541
language = 'zh_CN' # 文档语言(中文简体)

doc/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Torch Book
22

33
```{toctree}
4+
:hidden:
5+
46
readme
57
blog/index
68
旧版 Torch 手册 <https://torch-book.readthedocs.io/zh-cn/old/index.html>

0 commit comments

Comments
 (0)