Skip to content

Commit 5a88857

Browse files
committed
fix mdbook issue for workflows
1 parent d8a2617 commit 5a88857

5 files changed

Lines changed: 38 additions & 50 deletions

File tree

.github/workflows/online-ebook.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,17 @@ jobs:
4040

4141
steps:
4242
- uses: actions/checkout@v4
43-
- name: Install mdBook by Xlings
44-
run: |
45-
curl -fsSL https://d2learn.org/xlings-install.sh | bash
46-
xlings install mdbook@${MDBOOK_VERSION} --global -y
43+
#- name: Install mdBook by Xlings
44+
# run: |
45+
# curl -fsSL https://d2learn.org/xlings-install.sh | bash
46+
# xlings install mdbook@${MDBOOK_VERSION} --global -y
47+
- name: Setup mdBook
48+
uses: peaceiris/actions-mdbook@v2
49+
with:
50+
mdbook-version: '0.4.43'
51+
52+
- run: mdbook build
53+
4754
- name: Setup Pages
4855
id: pages
4956
uses: actions/configure-pages@v4

README.md

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,31 @@
11
# d2x-project-template
22

3-
> d2x教程类项目模板 - `Book + Video + Code + X`
3+
> d2x交互式教程项目模板 - `Book + Video + Code + X`
44
55
[![d2x](https://img.shields.io/badge/d2x-ok-green.svg)](https://github.com/d2learn/d2x)
66
[![License](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](LICENSE-CODE)
77

8-
该项目提供了一个, 可以被[d2x](https://github.com/d2learn/d2x)工具识别和加载的**交互式**教程类项目结构. 开发者和教程制作者, 可以基于这个模板来设计开发自己的交互式教程项目
8+
| [d2x工具](https://github.com/d2learn/d2x) - [论坛](https://forum.d2learn.org) |
9+
| --- |
10+
| [文档](https://d2learn.github.io/d2x-project-template) -> [工具和环境配置](https://github.com/d2learn/d2x) -> [项目和新内容添加](https://forum.d2learn.org) |
11+
12+
该项目提供了一个, 可以被[d2x](https://github.com/d2learn/d2x)工具识别和加载的**交互式教程项目**的基础结构. 开发者和教程创作者, 可以基于这个模板来设计开发自己的交互式教程项目
913

1014
## 功能特色
1115

1216
- 提供了基础的 `Book + Video + Code + X` 结构
1317
- d2x工具可以直接识别和加载
1418
- 提供了项目依赖描述, 支持一键配置环境
1519

16-
## 快速开始
17-
18-
**方式一: 本地安装使用**
19-
20-
```
21-
xlings install d2x@latest
22-
d2x create d2hello
23-
cd d2hello
24-
d2x book
25-
```
26-
27-
**方式二: 直接使用项目模板**
28-
29-
通过 [Use this template](https://github.com/new?template_name=d2x-project-template&template_owner=d2learn) 创建新的仓库
30-
31-
> 注: 工具安装及环境配置文档 -> [详情](https://d2learn.github.io/d2x-project-template)
32-
3320
## 具体项目案例
3421

3522
| 项目 | 简介 | 备注 |
3623
| --- | --- | --- |
3724
| [d2mcpp](https://github.com/mcpp-community/d2mcpp) | 现代C++核心特性入门教程 | |
25+
| [d2ds](https://github.com/d2learn/d2ds) | 强调动手实践的数据结构学习项目 | |
3826

3927
## 其他
4028

4129
- [d2x工具](https://github.com/d2learn/d2x)
42-
- [论坛交流和反馈](https://forum.d2learn.org)
30+
- [论坛交流和反馈](https://forum.d2learn.org)
31+
- `交流群`: 167535744

book/src/SUMMARY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Summary
22

33
- [简介](./chapter_0.md)
4-
- [工具安装与环境配置](./chapter_1.md)
5-
- [配置并添加内容](./chapter_2.md)
6-
- [等待你的扩展](./chapter_2.md)
4+
- [工具与环境配置](./chapter_1.md)
5+
- [项目和新内容添加](./chapter_2.md)
6+
- [等待你的扩展](./chapter_3.md)

book/src/chapter_0.md

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,32 @@
1-
# d2x-project-template 简介
1+
# d2x-project-template
22

3-
> d2x教程类项目模板 - `Book + Video + Code + X`
3+
> d2x交互式教程项目模板 - `Book + Video + Code + X`
44
55
[![d2x](https://img.shields.io/badge/d2x-ok-green.svg)](https://github.com/d2learn/d2x)
6+
[![online-ebook](https://img.shields.io/badge/online-ebook-orange.svg)](https://github.com/d2learn/d2x)
67
[![License](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](LICENSE-CODE)
78

8-
该项目提供了一个, 可以被[d2x](https://github.com/d2learn/d2x)工具识别和加载的**交互式**教程类项目结构. 开发者和教程制作者, 可以基于这个模板来设计开发自己的交互式教程项目
9+
| [d2x工具](https://github.com/d2learn/d2x) - [论坛](https://forum.d2learn.org) |
10+
| --- |
11+
| [文档](https://d2learn.github.io/d2x-project-template) -> [工具和环境配置](https://d2learn.github.io/d2x-project-template/chapter_1.html) -> [项目和新内容添加](https://d2learn.github.io/d2x-project-template/chapter_2.html) |
12+
13+
该项目提供了一个, 可以被[d2x](https://github.com/d2learn/d2x)工具识别和加载的**交互式教程项目**的基础结构. 开发者和教程创作者, 可以基于这个模板来设计开发自己的交互式教程项目
914

1015
## 功能特色
1116

1217
- 提供了基础的 `Book + Video + Code + X` 结构
1318
- d2x工具可以直接识别和加载
1419
- 提供了项目依赖描述, 支持一键配置环境
1520

16-
## 快速开始
17-
18-
**方式一: 本地安装使用**
19-
20-
```
21-
xlings install d2x@latest
22-
d2x create d2hello
23-
cd d2hello
24-
d2x book
25-
```
26-
27-
**方式二: 直接使用项目模板**
28-
29-
通过 [Use this template](https://github.com/new?template_name=d2x-project-template&template_owner=d2learn) 创建新的仓库
30-
31-
> 注: 工具安装及环境配置文档 -> [详情](https://d2learn.github.io/d2x-project-template)
32-
3321
## 具体项目案例
3422

3523
| 项目 | 简介 | 备注 |
3624
| --- | --- | --- |
3725
| [d2mcpp](https://github.com/mcpp-community/d2mcpp) | 现代C++核心特性入门教程 | |
26+
| [d2ds](https://github.com/d2learn/d2ds) | 强调动手实践的数据结构学习项目 | |
3827

3928
## 其他
4029

4130
- [d2x工具](https://github.com/d2learn/d2x)
42-
- [论坛交流和反馈](https://forum.d2learn.org)
31+
- [论坛交流和反馈](https://forum.d2learn.org)
32+
- `交流群`: 167535744

book/src/chapter_2.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 配置并添加内容
1+
# 项目配置和新内容添加
22

33
本章节主要是介绍模板项目的基础结构, 以及如何基于模板进行配置和添加自己的内容
44

@@ -124,6 +124,8 @@ git-repository-url = "xxxx"
124124
- 第一步: 在`book/src`目录添加章节文件, 并填充内容
125125
- 第二步: 在`book/src/SUMMARY.md`添加这个文件的目录索引
126126

127+
> 注: 更多配置细节参考 - [mdbook文档](https://rust-lang.github.io/mdBook)
128+
127129
## 三、Code: 添加新的练习代码
128130

129131
项目的练习代码集中放在了`dslings`目录中, 每当用户运行`d2x checker`命令时, 就会自动加载这些练习代码到一个检测队列中, 并跳转到当前第一个检测不同的练习代码, 等待用户去修改和完整.
@@ -238,6 +240,6 @@ d2x工具在练习代码检测过程中, 提供了一个AI智能助手的功能.
238240

239241
### 配置在线电子书
240242

241-
模板项目默认提供了Github Pages的自动部署功能
243+
模板项目默认提供了Github Pages的自动部署功能, 只需要打开开启一下即可
242244

243245
具体步骤: `仓库的Setting -> Pages -> Build and deployment -> Source -> Github Actions`

0 commit comments

Comments
 (0)