Skip to content

Commit ca6348d

Browse files
SunrisepeakCopilot
andauthored
d2x: add support for d2x and update book / docs / readme (#6)
* d2x: add support for d2x and update book / docs / readme - mcpp-community/OpenOrg#1 Signed-off-by: sunrisepeak <speakshen@163.com> * update * add d2x default config * Update d2x/mcpp/d2x.cppm Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update book/src/chapter_1.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> - #7 --------- Signed-off-by: sunrisepeak <speakshen@163.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6cc0c8f commit ca6348d

17 files changed

Lines changed: 285 additions & 285 deletions

File tree

.d2x.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"buildtools": "xmake d2x-buildtools",
3+
"lang": "zh",
4+
"llm": {
5+
"api_key": "",
6+
"api_url": "https://api.deepseek.com/v1",
7+
"model": "deepseek-chat",
8+
"system_prompt": ""
9+
},
10+
"ui_backend": "tui"
11+
}

README.md

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,77 @@
11
# D2MySTL
22

3-
> TODO...
3+
> 从零实现一个迷你STL库
44
55
[![d2x](https://img.shields.io/badge/d2x-ok-green.svg)](https://github.com/d2learn/d2x)
66
[![online-ebook](https://img.shields.io/badge/online-ebook-orange.svg)](https://github.com/d2learn/d2x)
77
[![License](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](LICENSE-CODE)
88

9-
| [d2x工具](https://github.com/d2learn/d2x) - [论坛](https://mcpp.d2learn.org/forum) |
9+
| [d2x工具](https://github.com/d2learn/d2x) - [文档](https://mcpp-community.github.io/d2mystl) - [论坛](https://mcpp.d2learn.org/forum) |
1010
| --- |
11-
| [文档](https://mcpp-community.github.io/d2mystl) -> [工具和环境配置](https://mcpp-community.github.io/d2mystl/chapter_1.html) -> [项目和新内容添加](https://mcpp-community.github.io/d2mystl/chapter_2.html) |
11+
12+
## 快速开始
13+
14+
### 方式一: d2x自动代码检测
15+
16+
<details>
17+
<summary>点击查看xlings安装命令</summary>
18+
19+
---
20+
21+
#### Linux/MacOS
22+
23+
```bash
24+
curl -fsSL https://d2learn.org/xlings-install.sh | bash
25+
```
26+
27+
#### Windows - PowerShell
28+
29+
```bash
30+
irm https://d2learn.org/xlings-install.ps1.txt | iex
31+
```
32+
33+
> tips: xlings -> [details](https://xlings.d2learn.org)
34+
35+
---
36+
37+
</details>
38+
39+
**获取项目**
40+
41+
```
42+
d2x install d2mystl
43+
```
44+
45+
**进入练习模式**
46+
47+
```
48+
d2x checker
49+
```
50+
51+
### 方式二: 动手运行验证
52+
53+
**获取项目**
54+
55+
```
56+
git clone https://github.com/mcpp-community/d2mystl.git
57+
```
58+
59+
**动手运行测试代码**
60+
61+
```
62+
xmake run chapter0_tests
63+
```
64+
65+
> 注: 测试名格式`chapter[x]_tests`
66+
67+
## 前置教程
68+
69+
如果感觉该教程上手有点难度, 可以先学习下面的教程了解现代C++基础和核心语法特性
70+
71+
| 项目 | 简介 | 备注 |
72+
| --- | --- | --- |
73+
| [mcpp-start](https://github.com/mcpp-community/mcpp-start) | 现代C++启动! - `import std` | 入门-0 |
74+
| [d2mcpp](https://github.com/mcpp-community/d2mcpp) | 现代C++核心特性入门教程 | 入门-1 |
1275

1376
## 其他
1477

book/src/SUMMARY.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22

33
- [简介](./chapter_0.md)
44
- [工具与环境配置](./chapter_1.md)
5-
- [项目和新内容添加](./chapter_2.md)
6-
- [等待你的扩展](./chapter_3.md)
5+
- [使用教程](./chapter_2.md)
6+
7+
# 正文
8+
9+
- [实现array](./chapter_3.md)

book/src/chapter_0.md

Lines changed: 62 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,80 @@
1-
# d2x-project-template
1+
# D2MySTL
22

3-
> d2x交互式教程项目模板 - `Book + Video + Code + X`
3+
> 从零实现一个迷你STL库
44
55
[![d2x](https://img.shields.io/badge/d2x-ok-green.svg)](https://github.com/d2learn/d2x)
66
[![online-ebook](https://img.shields.io/badge/online-ebook-orange.svg)](https://github.com/d2learn/d2x)
77
[![License](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](LICENSE-CODE)
88

9-
| [d2x工具](https://github.com/d2learn/d2x) - [论坛](https://forum.d2learn.org) |
9+
| [d2x工具](https://github.com/d2learn/d2x) - [文档](https://mcpp-community.github.io/d2mystl) - [论坛](https://mcpp.d2learn.org/forum) |
1010
| --- |
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) |
1211

13-
该项目提供了一个, 可以被[d2x](https://github.com/d2learn/d2x)工具识别和加载的**交互式教程项目**的基础结构. 开发者和教程创作者, 可以基于这个模板来设计开发自己的交互式教程项目
12+
## 快速开始
1413

15-
## 功能特色
14+
### 方式一: d2x自动代码检测
1615

17-
- 提供了基础的 `Book + Video + Code + X` 结构
18-
- d2x工具可以直接识别和加载
19-
- 提供了项目依赖描述, 支持一键配置环境
16+
<details>
17+
<summary>点击查看xlings安装命令</summary>
2018

21-
## 具体项目案例
19+
---
20+
21+
#### Linux/MacOS
22+
23+
```bash
24+
curl -fsSL https://d2learn.org/xlings-install.sh | bash
25+
```
26+
27+
#### Windows - PowerShell
28+
29+
```bash
30+
irm https://d2learn.org/xlings-install.ps1.txt | iex
31+
```
32+
33+
> tips: xlings -> [details](https://xlings.d2learn.org)
34+
35+
---
36+
37+
</details>
38+
39+
**获取项目**
40+
41+
```
42+
d2x install d2mystl
43+
```
44+
45+
**进入练习模式**
46+
47+
```
48+
d2x checker
49+
```
50+
51+
### 方式二: 动手运行验证
52+
53+
**获取项目**
54+
55+
```
56+
git clone https://github.com/mcpp-community/d2mystl.git
57+
```
58+
59+
**动手运行测试代码**
60+
61+
```
62+
xmake run chapter0_tests
63+
```
64+
65+
> 注: 测试名格式`chapter[x]_tests`
66+
67+
## 前置教程
68+
69+
如果感觉该教程上手有点难度, 可以先学习下面的教程了解现代C++基础和核心语法特性
2270

2371
| 项目 | 简介 | 备注 |
2472
| --- | --- | --- |
25-
| [d2mcpp](https://github.com/mcpp-community/d2mcpp) | 现代C++核心特性入门教程 | |
26-
| [d2ds](https://github.com/d2learn/d2ds) | 强调动手实践的数据结构学习项目 | |
73+
| [mcpp-start](https://github.com/mcpp-community/mcpp-start) | 现代C++启动! - `import std` | 入门-0 |
74+
| [d2mcpp](https://github.com/mcpp-community/d2mcpp) | 现代C++核心特性入门教程 | 入门-1 |
2775

2876
## 其他
2977

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

book/src/chapter_1.md

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,19 @@ irm https://d2learn.org/xlings-install.ps1.txt | iex
3535
xlings install d2x
3636
```
3737

38-
### 方法2: 从源码进行构建
38+
## 二、书籍和代码检测
3939

40-
TODO...
40+
进入当前项目的根目录, 运行命令进行测试
4141

42-
## 二、创建项目 & 测试
43-
44-
### 创建项目
45-
46-
通过`d2x new xxx`命令创建一个新项目
47-
48-
```
49-
d2x new d2hello
50-
```
51-
52-
命令运行后会生成一个叫`d2hello`的目录, 进入/打开这个目录就能看到项目的基础结构
53-
54-
## 测试
55-
56-
进入新创建项目的根目录, 运行命令进行测试完整性
57-
58-
**查看文档命令测试**
42+
**查看文档命令**
5943

6044
运行下面命令后会在浏览器打开新项目的文档/书籍
6145

6246
```
6347
d2x book
6448
```
6549

66-
**代码自动检测功能测试**
50+
**代码自动检测功能**
6751

6852
运行下面的checker命令, 可以看到控制台进入实时代码检测模式, 修改文件代码, 控制台会自动更新
6953

0 commit comments

Comments
 (0)