Skip to content

Commit 33295ee

Browse files
committed
udpate
1 parent 11833a9 commit 33295ee

File tree

4 files changed

+117
-109
lines changed

4 files changed

+117
-109
lines changed

api.tag

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1 @@
1-
{% sample lang="js" %}
2-
这里演示 JavaScript 如何输出信息到控制台
31

4-
```js
5-
console.log('Hello World');
6-
```
7-
8-
{% sample lang="java" %}
9-
这里演示 Java 如何输出信息到控制台
10-
11-
```java
12-
System.out.println("Hello World");
13-
```
14-
15-
{% common %}
16-
这里是 JavaScript 和 Java 共同的信息
17-
18-
{% endmethod %}

book.json

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,132 @@
11
{
2-
"title": "GitBook Use",
3-
"description": "记录 GitBook 的配置和一些插件的使用",
4-
"author": "zhangjikai",
5-
"output.name": "site",
6-
"language": "zh-hans",
7-
"gitbook": "3.2.2",
8-
"root": ".",
2+
"title": "GitBook 使用教程",
3+
"description": "记录 GitBook 的配置和一些插件的使用",
4+
"author": "zhangjikai",
5+
"output.name": "site",
6+
"language": "zh-hans",
7+
"gitbook": "3.2.2",
8+
"root": ".",
99
"structure": {
1010
"readme": "introduction.md"
11-
},
11+
},
1212
"links": {
1313
"sidebar": {
1414
"Home": "http://www.zhangjikai.com"
1515
}
16-
},
16+
},
1717
"plugins": [
18-
"-lunr",
19-
"-search",
18+
"-lunr",
19+
"-search",
2020
"-highlight",
2121
"-livereload",
22-
"search-plus@^0.0.11",
23-
"simple-page-toc@^0.1.1",
24-
"github@^2.0.0",
25-
26-
"edit-link@^2.0.2",
27-
"disqus@^0.1.0",
28-
"prism@^2.1.0",
29-
"prism-themes@^0.0.2",
30-
"advanced-emoji@^0.2.1",
31-
"anchors@^0.7.1",
32-
"include-codeblock@^3.0.2",
33-
"ace@^0.3.2",
34-
"emphasize@^1.1.0",
35-
"katex@^1.1.3",
36-
"splitter@^0.0.8",
37-
"mermaid@^0.0.9",
38-
"tbfed-pagefooter@^0.0.1",
39-
"expandable-chapters-small@^0.1.7",
40-
"sectionx@^3.1.0",
41-
"baidu@^0.1.0",
42-
"donate@^1.0.2",
43-
"local-video@^1.0.1",
44-
"sitemap-general@^0.1.1",
45-
46-
"favicon@^0.0.2",
47-
"todo@^0.1.3"
48-
],
22+
"search-plus@^0.0.11",
23+
"simple-page-toc@^0.1.1",
24+
"github@^2.0.0",
25+
26+
"edit-link@^2.0.2",
27+
"disqus@^0.1.0",
28+
"prism@^2.1.0",
29+
"prism-themes@^0.0.2",
30+
"advanced-emoji@^0.2.1",
31+
"anchors@^0.7.1",
32+
"include-codeblock@^3.0.2",
33+
"ace@^0.3.2",
34+
"emphasize@^1.1.0",
35+
"katex@^1.1.3",
36+
"splitter@^0.0.8",
37+
"mermaid@^0.0.9",
38+
"tbfed-pagefooter@^0.0.1",
39+
"expandable-chapters-small@^0.1.7",
40+
"sectionx@^3.1.0",
41+
"donate@^1.0.2",
42+
"local-video@^1.0.1",
43+
"sitemap-general@^0.1.1",
44+
"anchor-navigation-ex@0.1.8",
45+
"favicon@^0.0.2",
46+
"todo@^0.1.3",
47+
"3-ba@^0.9.0"
48+
],
4949
"pluginsConfig": {
5050
"theme-default": {
5151
"showLevel": true
52-
},
52+
},
5353
"disqus": {
5454
"shortName": "gitbookuse"
55-
},
55+
},
5656
"prism": {
5757
"css": [
5858
"prism-themes/themes/prism-base16-ateliersulphurpool.light.css"
5959
]
60-
},
60+
},
6161
"github": {
6262
"url": "https://github.com/zhangjikai/gitbook-use"
63-
},
63+
},
6464
"github-buttons": {
65-
"repo": "zhangjikai/gitbook-use",
65+
"repo": "zhangjikai/gitbook-use",
6666
"types": [
6767
"star"
68-
],
68+
],
6969
"size": "small"
70-
},
70+
},
7171
"include-codeblock": {
72-
"template": "ace",
73-
"unindent": true,
72+
"template": "ace",
73+
"unindent": true,
7474
"edit": true
75-
},
75+
},
7676
"sharing": {
77-
"weibo": true,
78-
"facebook": true,
79-
"twitter": true,
80-
"google": false,
81-
"instapaper": false,
82-
"vk": false,
77+
"weibo": true,
78+
"facebook": true,
79+
"twitter": true,
80+
"google": false,
81+
"instapaper": false,
82+
"vk": false,
8383
"all": [
84-
"facebook",
85-
"google",
86-
"twitter",
87-
"weibo",
84+
"facebook",
85+
"google",
86+
"twitter",
87+
"weibo",
8888
"instapaper"
8989
]
90-
},
90+
},
9191
"tbfed-pagefooter": {
92-
"copyright": "Copyright © zhangjikai.com 2017",
93-
"modify_label": "该文件修订时间:",
92+
"copyright": "Copyright © zhangjikai.com 2017",
93+
"modify_label": "该文件修订时间:",
9494
"modify_format": "YYYY-MM-DD HH:mm:ss"
95-
},
96-
"baidu": {
95+
},
96+
"3-ba": {
9797
"token": "ff100361cdce95dd4c8fb96b4009f7bc"
98-
},
98+
},
9999
"donate": {
100-
"wechat": "https://zhangjikai.com/resource/weixin.png",
101-
"alipay": "https://zhangjikai.com/resource/alipay.png",
102-
"title": "",
103-
"button": "",
104-
"alipayText": "支付宝打赏",
100+
"wechat": "https://zhangjikai.com/resource/weixin.png",
101+
"alipay": "https://zhangjikai.com/resource/alipay.png",
102+
"title": "",
103+
"button": "",
104+
"alipayText": "支付宝打赏",
105105
"wechatText": "微信打赏"
106-
},
106+
},
107107
"simple-page-toc": {
108-
"maxDepth": 3,
108+
"maxDepth": 3,
109109
"skipFirstH1": true
110-
},
110+
},
111111
"edit-link": {
112-
"base": "https://github.com/zhangjikai/gitbook-use/edit/master",
112+
"base": "https://github.com/zhangjikai/gitbook-use/edit/master",
113113
"label": "Edit This Page"
114-
},
114+
},
115115
"sitemap-general": {
116116
"prefix": "http://gitbook.zhangjikai.com"
117-
},
117+
},
118118
"anchor-navigation-ex": {
119-
"isRewritePageTitle": false,
120-
"tocLevel1Icon": "fa fa-hand-o-right",
121-
"tocLevel2Icon": "fa fa-hand-o-right",
119+
"isRewritePageTitle": false,
120+
"tocLevel1Icon": "fa fa-hand-o-right",
121+
"tocLevel2Icon": "fa fa-hand-o-right",
122122
"tocLevel3Icon": "fa fa-hand-o-right"
123-
},
123+
},
124124
"sectionx": {
125125
"tag": "b"
126-
},
126+
},
127127
"favicon": {
128-
"shortcut": "favicon.ico",
128+
"shortcut": "favicon.ico",
129129
"bookmark": "favicon.ico"
130130
}
131131
}
132-
}
132+
}

plugins.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
- [Expandable-chapters-small - 使左侧的章节目录可以折叠](#expandable-chapters-small)
2222
- [Sectionx - 将页面分块显示](#sectionx)
2323
- [GA - Google 统计](#ga)
24-
- [Baidu - 百度统计](#baidu)
24+
- [3-ba - 百度统计](#3-ba)
2525
- [Donate - 打赏插件](#donate)
2626
- [Local Video - 使用 Video.js 播放本地视频](#local-video)
2727
- [Simple-page-toc - 自动生成本页的目录结构](#simple-page-toc)
@@ -372,16 +372,16 @@ Google 统计
372372
}
373373
}
374374
```
375-
## Baidu
375+
## 3-ba
376376
百度统计
377-
[插件地址](https://plugins.gitbook.com/plugin/baidu)
377+
[插件地址](https://plugins.gitbook.com/plugin/3-ba)
378378
```json
379-
"plugin": [
380-
"baidu"
381-
],
382-
"pluginsConfig": {
383-
"baidu": {
384-
"token": "YOUR TOKEN"
379+
{
380+
"plugins": ["3-ba"],
381+
"pluginsConfig": {
382+
"3-ba": {
383+
"token": "xxxxxxxx"
384+
}
385385
}
386386
}
387387
```

themes.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,41 @@ GitBook 同样可以编写 API 文档,只需要引入 [`theme-api` 插件](htt
8585
使用 GitBook 的 API 文档模式时也可以使用插件,但是因为大部分插件可能针对写书的模式,所以有可能会出现不兼容的现象。
8686

8787
API文档的语法也很简单,因为主要是针对方法的,所以以方法为基本单位,通过下面的语法来定义一个方法
88+
{% raw %}
8889
```
8990
{% method %}
9091
9192
内容区
9293
9394
{% endmethod %}
95+
9496
```
97+
9598
在内容区里面,通过 `{% sample lang="lang" %} `来定义一个针对特定语言的演示,通过 `{% common %}` 标识所有语言共同的部分。下面是一个完整的示例:
9699

97-
[import](api.tag)
100+
101+
<pre lang="no-highlight"><code>{% sample lang="js" %}
102+
这里演示 JavaScript 如何输出信息到控制台
103+
104+
```js
105+
console.log('Hello World');
106+
```
107+
108+
{% sample lang="java" %}
109+
这里演示 Java 如何输出信息到控制台
110+
111+
```java
112+
System.out.println("Hello World");
113+
```
114+
115+
{% common %}
116+
这里是 JavaScript 和 Java 共同的信息
117+
118+
{% endmethod %}
119+
```
120+
</code></pre>
121+
122+
{% endraw %}
98123

99124
## FAQ 文档
100125
[`theme-faq`](https://plugins.gitbook.com/plugin/theme-faq) 插件主要用来制作知识库或者帮助中心,GitBook 的 [帮助中心](https://plugins.gitbook.com/plugin/theme-faq) 就是使用的该主题。为了支持中文搜索我们需要引入 `search-pro` 包。

0 commit comments

Comments
 (0)