Skip to content

Commit 0e0d094

Browse files
committed
add requirements.txt
1 parent 9055f13 commit 0e0d094

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.github/workflows/generate_release_pdf.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ jobs:
2828

2929
- name: Prepare Mkdocs environment
3030
run: |
31-
pip install mkdocs
32-
pip install mkdocs-print-site-plugin
33-
pip install mkdocs-macros-plugin
34-
pip install python-markdown-math
31+
pip install -r requirements.txt
3532
3633
- name: Compile Mkdocs document
3734
run: |

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,20 @@
6464

6565
本书使用 [Mkdocs](https://www.mkdocs.org/) 构建,是一种基于 Markdown 的静态网站生成器,可以把一堆 Markdown 文件编译成一个网站,非常适合用于写书。
6666

67+
每当小彭老师提交新的代码,GitHub 的机器人就会自动调用 Mkdocs 重新编译和部署网页。这样,小彭老师只需要关心写作本书,不用再操心排版、发布等问题。
68+
6769
```bash
68-
pip install mkdocs mkdocs-print-site-plugin mkdocs-macros-plugin python-markdown-math
70+
git clone https://github.com/parallel101/cppguidebook
71+
cd cppguidebook
72+
pip install -r requirements.txt
6973
```
7074

71-
克隆本仓库后,可以用 `mkdocs build` 命令编译生成 `site` 文件夹,打开其中的 `site/index.html` 就可以开始看了。也可以用 `mkdocs serve` 命令,在 `http://127.0.0.1:8000` 开启实时预览服务,每当你修改 `.md` 文件时都会自动刷新
75+
> [`requirements.txt`](requirements.txt) 中是包括 Mkdocs 在内的构建本书所需的全部依赖项
7276
73-
每当小彭老师提交新的代码,GitHub 的机器人就会自动调用 Mkdocs 重新编译和部署网页。这样,小彭老师只需要关心写作本书,不用再操心排版、发布等问题。
77+
- `mkdocs build` 命令可以编译生成 `site` 文件夹,打开其中的 `site/index.html` 就可以开始看了。
78+
- `mkdocs serve` 命令会在 `http://127.0.0.1:8000` 开启实时预览服务,在浏览器中打开该地址,每当你修改 `.md` 文件时页面都会自动刷新。
7479

75-
> 以下是第一章节的内容预览,要查看全文,请前往 Release 页面下载完整 PDF 文件
80+
> 以下是第一章节的内容预览,要查看全文,请前往 Release 页面下载完整 PDF 文件或[在线浏览](https://parallel101.github.io/cppguidebook)
7681
7782
# 前言
7883

requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mkdocs
2+
mkdocs-print-site-plugin
3+
mkdocs-macros-plugin
4+
python-markdown-math

0 commit comments

Comments
 (0)