Skip to content

Commit 3c2b97e

Browse files
committed
update guides
1 parent fc3b11c commit 3c2b97e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+414
-106
lines changed

docs/.vitepress/config.js

Lines changed: 62 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,75 @@
1+
const chaptersAndGuides = [
2+
{
3+
text: "目录",
4+
collapsed: false,
5+
items: [
6+
{ text: "引言", link: "/chapters/intro" },
7+
{ text: "环境", link: "/chapters/ch01_environment" },
8+
{ text: "计算", link: "/chapters/ch02_computation" },
9+
{ text: "过程", link: "/chapters/ch03_procedure" },
10+
{ text: "编码", link: "/chapters/ch04_encoding" },
11+
{ text: "序列", link: "/chapters/ch05_sequence" },
12+
{ text: "数据", link: "/chapters/ch06_data" },
13+
{ text: "状态", link: "/chapters/ch07_state" },
14+
{ text: "引用", link: "/chapters/ch08_reference" },
15+
{ text: "闭包", link: "/chapters/ch09_closure" },
16+
{ text: "对象", link: "/chapters/ch10_object" },
17+
{ text: "并发", link: "/chapters/ch11_concurrency" },
18+
],
19+
},
20+
{
21+
text: "附录",
22+
collapsed: true,
23+
items: [
24+
{ text: "工具上手", link: "/guides/" },
25+
{ text: "浏览器开发者工具与 Console", link: "/guides/browser-devtools" },
26+
{ text: "安装与上手 VS Code", link: "/guides/vscode" },
27+
{
28+
text: "安装 Node.js 并在 VS Code 运行 JavaScript",
29+
link: "/guides/nodejs",
30+
},
31+
{ text: "TypeScript 入门:安装、编译与运行", link: "/guides/typescript" },
32+
],
33+
},
34+
];
35+
136
module.exports = {
2-
title: '编程导引',
3-
themeConfig: {
4-
nav: [
5-
{text: "编程导引", link: '/chapters/intro'},
6-
{text: "参考", link: '/reference/glossary'},
7-
],
37+
title: "编程导引",
38+
themeConfig: {
39+
nav: [
40+
{ text: "编程导引", link: "/chapters/intro" },
41+
{ text: "参考", link: "/reference/glossary" },
42+
],
843

9-
sidebar: {
10-
"/chapters/": [
11-
{ text: "引言", link: "/chapters/intro" },
12-
{ text: "环境", link: '/chapters/ch01_environment' },
13-
{ text: "计算", link: '/chapters/ch02_computation' },
14-
{ text: "过程", link: '/chapters/ch03_procedure' },
15-
{ text: "编码", link: '/chapters/ch04_encoding' },
16-
{ text: "序列", link: '/chapters/ch05_sequence' },
17-
{ text: "数据", link: '/chapters/ch06_data' },
18-
{ text: "状态", link: '/chapters/ch07_state' },
19-
{ text: "引用", link: '/chapters/ch08_reference' },
20-
{ text: "闭包", link: '/chapters/ch09_closure' },
21-
{ text: "对象", link: '/chapters/ch10_object' },
22-
{ text: "并发", link: '/chapters/ch11_concurrency' }
23-
],
24-
"/reference/": [
25-
{ text: "概念解释", link: "/reference/glossary"}
26-
]
27-
},
28-
footer: {
29-
copyright: "CC-BY 4.0 Licensed | Copyright © 2015-present Kimmy Leo"
30-
},
44+
sidebar: {
45+
"/chapters/": chaptersAndGuides,
46+
"/reference/": [{ text: "概念解释", link: "/reference/glossary" }],
47+
"/guides/": chaptersAndGuides,
3148
},
32-
33-
markdown: {
34-
math: true
49+
footer: {
50+
message: "CC-BY 4.0 Licensed",
51+
copyright:"Copyright © 2015-present Kimmy Liu",
3552
},
53+
},
54+
55+
markdown: {
56+
math: true,
57+
},
3658

37-
38-
head: [
39-
[
40-
"script",
41-
{},
59+
head: [
60+
[
61+
"script",
62+
{},
4263

43-
`
64+
`
4465
var _hmt = _hmt || [];
4566
(function() {
4667
var hm = document.createElement("script");
4768
hm.src = "https://hm.baidu.com/hm.js?bc2f9f80827718f41c02c33dc45976cb";
4869
var s = document.getElementsByTagName("script")[0];
4970
s.parentNode.insertBefore(hm, s);
5071
})();
51-
`
52-
]
53-
]
54-
}
72+
`,
73+
],
74+
],
75+
};

docs/chapters/ch01_environment.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ JavaScript是目前使用最广泛的编程语言之一。作为互联网和移
1010

1111
JavaScript的诞生和发展也颇具传奇色彩,Brendan Eich在几天的时间内设计并实现了这门编程语言,影响了后面几十年的软件和技术的发展。如今几乎每一个设备都接入了JavaScript,深入到了我们生活的方方面面。作为一门工业级的编程语言,JavaScript由欧洲计算机制造商协会(ECMA)制定标准化的行为和定义,来规范这个语言的使用和发展方向。TC39技术委员会也一直在更新JavaScript的功能,让这个有二十多年历史的旧技术不断焕发新的活力。
1212

13-
JavaScript的环境触手可及。在电脑端你可以随时打开一个现代的浏览器,页面上右键菜单中选择“Inspect”或者“查看/检查元素”,选择“控制台(Console)”标签。如果你是在移动端或者浏览器不支持,也可以通过一些工具比如[移动端Console](http://code.hnldesign.nl/demo/hnl.MobileConsole.html)来体验JavaScript控制台
13+
JavaScript 的环境触手可及。在电脑端你可以随时打开一个现代的浏览器,页面上右键菜单中选择“Inspect”或者“查看/检查元素”,然后切换到“控制台(Console)”标签。如果你还没用过开发者工具,请先阅读[浏览器开发者工具与 Console](../guides/browser-devtools.md)
1414

1515
## 编写代码
1616

@@ -37,15 +37,18 @@ JavaScript的环境触手可及。在电脑端你可以随时打开一个现代
3737

3838
比如上面的代码,就是在控制台打印“hello world”。
3939

40-
本书推荐使用[Visual Studio Code](https://code.visualstudio.com/)作为基本的代码编辑工具。你可以在官网进行下载和安装。官网也有详细的使用教程
40+
本书推荐使用 Visual Studio Code 作为基本的代码编辑工具,安装与上手请参考[安装与上手 VS Code](../guides/vscode.md)
4141

42-
MDN 中对[浏览器开发者工具](https://developer.mozilla.org/zh-CN/docs/Learn/Discover_browser_developer_tools)[基本的工具软件](https://developer.mozilla.org/zh-CN/docs/Learn/Getting_started_with_the_web/Installing_basic_software)有更为完整的介绍,可以参考。如果你想了解更多关于Web设计和开发的知识,MDN也有完备的文档供参考。
42+
当你希望在本地运行 JavaScript 或 TypeScript 时,需要安装 Node.js 与 TypeScript,对应的上手步骤见:
43+
44+
* [安装 Node.js 并在 VS Code 运行 JavaScript](../guides/nodejs.md)
45+
* [TypeScript 入门:安装、编译与运行](../guides/typescript.md)
4346

4447
## 延伸阅读
4548

46-
* [进程与线程 Process & Thread](../reference/process-and-thread.md)
47-
* [阻塞与非阻塞 Blocking & Non-blocking](../reference/blocking-nonblocking.md)
48-
* [同步与异步 Sync & Async](../reference/sync-async.md)
49-
* [调用栈 Call Stack](../reference/call-stack.md)
49+
* [进程与线程 Process & Thread](../reference/glossary/process-and-thread.md)
50+
* [阻塞与非阻塞 Blocking & Non-blocking](../reference/glossary/blocking-nonblocking.md)
51+
* [同步与异步 Sync & Async](../reference/glossary/sync-async.md)
52+
* [调用栈 Call Stack](../reference/glossary/call-stack.md)
5053

5154
一切准备就绪的话,我们就开始吧。

docs/chapters/ch02_computation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: 计算机可以完成哪些基本运算?如何把运算进行组
88

99
计算机(Computer)是干嘛的?当然是计算(Computing)啦。
1010

11-
在浏览器的控制台输入以下代码:
11+
在浏览器的控制台输入以下代码(如果还没打开过控制台,请先看[浏览器开发者工具与 Console](../guides/browser-devtools.md)
1212

1313
```javascript
1414
1 + 1
@@ -161,5 +161,5 @@ function sortReversed(array) {
161161

162162
## 延伸阅读
163163

164-
* [复杂度 Complexity](../reference/complexity.md)
165-
* [浮点数 Floating Point](../reference/floating-point.md)
164+
* [复杂度 Complexity](../reference/glossary/complexity.md)
165+
* [浮点数 Floating Point](../reference/glossary/floating-point.md)

docs/chapters/ch03_procedure.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,6 @@ function pow(x, y) {
291291

292292
## 延伸阅读
293293

294-
* [递归 Recursion](../reference/recursion.md)
295-
* [调用栈 Call Stack](../reference/call-stack.md)
296-
* [尾调用优化 Tail Call Optimization](../reference/tail-call-optimization.md)
294+
* [递归 Recursion](../reference/glossary/recursion.md)
295+
* [调用栈 Call Stack](../reference/glossary/call-stack.md)
296+
* [尾调用优化 Tail Call Optimization](../reference/glossary/tail-call-optimization.md)

docs/chapters/ch04_encoding.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,6 @@ Unicode包含的字符量足够的多,于是就要设计比ASCII更充分大
174174

175175
## 延伸阅读
176176

177-
* [编码与字符集 Encoding & Charset](../reference/encoding-and-charset.md)
178-
* [Unicode / UTF-8](../reference/unicode-utf8.md)
179-
* [浮点数 Floating Point](../reference/floating-point.md)
177+
* [编码与字符集 Encoding & Charset](../reference/glossary/encoding-and-charset.md)
178+
* [Unicode / UTF-8](../reference/glossary/unicode-utf8.md)
179+
* [浮点数 Floating Point](../reference/glossary/floating-point.md)

docs/chapters/ch05_sequence.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,5 +247,5 @@ take(5, zeros()); // [0, 0, 0, 0, 0]
247247
248248
## 延伸阅读
249249

250-
* [复杂度 Complexity](../reference/complexity.md)
251-
* [缓存 Cache](../reference/cache.md)
250+
* [复杂度 Complexity](../reference/glossary/complexity.md)
251+
* [缓存 Cache](../reference/glossary/cache.md)

docs/chapters/ch06_data.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,5 +272,5 @@ function bfs(root, visit) {
272272

273273
## 延伸阅读
274274

275-
* [值语义与引用语义 Value vs. Reference](../reference/value-reference.md)
276-
* [序列化 Serialization](../reference/serialization.md)
275+
* [值语义与引用语义 Value vs. Reference](../reference/glossary/value-reference.md)
276+
* [序列化 Serialization](../reference/glossary/serialization.md)

docs/chapters/ch07_state.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,5 @@ let light = {
133133

134134
## 延伸阅读
135135

136-
* [不可变性 Immutability](../reference/immutability.md)
137-
* [竞态条件 Race Condition](../reference/race-condition.md)
136+
* [不可变性 Immutability](../reference/glossary/immutability.md)
137+
* [竞态条件 Race Condition](../reference/glossary/race-condition.md)

docs/chapters/ch08_reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,6 @@ console.log(a, b, c);
200200

201201
## 延伸阅读
202202

203-
* [值语义与引用语义 Value vs. Reference](../reference/value-reference.md)
204-
* [垃圾回收 Garbage Collection](../reference/garbage-collection.md)
205-
* [栈与堆 Stack & Heap](../reference/stack-and-heap.md)
203+
* [值语义与引用语义 Value vs. Reference](../reference/glossary/value-reference.md)
204+
* [垃圾回收 Garbage Collection](../reference/glossary/garbage-collection.md)
205+
* [栈与堆 Stack & Heap](../reference/glossary/stack-and-heap.md)

docs/chapters/ch09_closure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,5 @@ outer()();
176176

177177
## 延伸阅读
178178

179-
* [词法作用域 Lexical Scope](../reference/lexical-scope.md)
180-
* [垃圾回收 Garbage Collection](../reference/garbage-collection.md)
179+
* [词法作用域 Lexical Scope](../reference/glossary/lexical-scope.md)
180+
* [垃圾回收 Garbage Collection](../reference/glossary/garbage-collection.md)

0 commit comments

Comments
 (0)