Skip to content

Commit

Permalink
udpate
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjikai committed Feb 27, 2017
1 parent 11833a9 commit 33295ee
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 109 deletions.
17 changes: 0 additions & 17 deletions api.tag
Original file line number Diff line number Diff line change
@@ -1,18 +1 @@
{% sample lang="js" %}
这里演示 JavaScript 如何输出信息到控制台

```js
console.log('Hello World');
```

{% sample lang="java" %}
这里演示 Java 如何输出信息到控制台

```java
System.out.println("Hello World");
```

{% common %}
这里是 JavaScript 和 Java 共同的信息

{% endmethod %}
164 changes: 82 additions & 82 deletions book.json
Original file line number Diff line number Diff line change
@@ -1,132 +1,132 @@
{
"title": "GitBook Use",
"description": "记录 GitBook 的配置和一些插件的使用",
"author": "zhangjikai",
"output.name": "site",
"language": "zh-hans",
"gitbook": "3.2.2",
"root": ".",
"title": "GitBook 使用教程",
"description": "记录 GitBook 的配置和一些插件的使用",
"author": "zhangjikai",
"output.name": "site",
"language": "zh-hans",
"gitbook": "3.2.2",
"root": ".",
"structure": {
"readme": "introduction.md"
},
},
"links": {
"sidebar": {
"Home": "http://www.zhangjikai.com"
}
},
},
"plugins": [
"-lunr",
"-search",
"-lunr",
"-search",
"-highlight",
"-livereload",
"search-plus@^0.0.11",
"simple-page-toc@^0.1.1",
"github@^2.0.0",
"[email protected]",
"edit-link@^2.0.2",
"disqus@^0.1.0",
"prism@^2.1.0",
"prism-themes@^0.0.2",
"advanced-emoji@^0.2.1",
"anchors@^0.7.1",
"include-codeblock@^3.0.2",
"ace@^0.3.2",
"emphasize@^1.1.0",
"katex@^1.1.3",
"splitter@^0.0.8",
"mermaid@^0.0.9",
"tbfed-pagefooter@^0.0.1",
"expandable-chapters-small@^0.1.7",
"sectionx@^3.1.0",
"baidu@^0.1.0",
"donate@^1.0.2",
"local-video@^1.0.1",
"sitemap-general@^0.1.1",
"[email protected]",
"favicon@^0.0.2",
"todo@^0.1.3"
],
"search-plus@^0.0.11",
"simple-page-toc@^0.1.1",
"github@^2.0.0",
"[email protected]",
"edit-link@^2.0.2",
"disqus@^0.1.0",
"prism@^2.1.0",
"prism-themes@^0.0.2",
"advanced-emoji@^0.2.1",
"anchors@^0.7.1",
"include-codeblock@^3.0.2",
"ace@^0.3.2",
"emphasize@^1.1.0",
"katex@^1.1.3",
"splitter@^0.0.8",
"mermaid@^0.0.9",
"tbfed-pagefooter@^0.0.1",
"expandable-chapters-small@^0.1.7",
"sectionx@^3.1.0",
"donate@^1.0.2",
"local-video@^1.0.1",
"sitemap-general@^0.1.1",
"anchor-navigation-ex@0.1.8",
"favicon@^0.0.2",
"todo@^0.1.3",
"3-ba@^0.9.0"
],
"pluginsConfig": {
"theme-default": {
"showLevel": true
},
},
"disqus": {
"shortName": "gitbookuse"
},
},
"prism": {
"css": [
"prism-themes/themes/prism-base16-ateliersulphurpool.light.css"
]
},
},
"github": {
"url": "https://github.com/zhangjikai/gitbook-use"
},
},
"github-buttons": {
"repo": "zhangjikai/gitbook-use",
"repo": "zhangjikai/gitbook-use",
"types": [
"star"
],
],
"size": "small"
},
},
"include-codeblock": {
"template": "ace",
"unindent": true,
"template": "ace",
"unindent": true,
"edit": true
},
},
"sharing": {
"weibo": true,
"facebook": true,
"twitter": true,
"google": false,
"instapaper": false,
"vk": false,
"weibo": true,
"facebook": true,
"twitter": true,
"google": false,
"instapaper": false,
"vk": false,
"all": [
"facebook",
"google",
"twitter",
"weibo",
"facebook",
"google",
"twitter",
"weibo",
"instapaper"
]
},
},
"tbfed-pagefooter": {
"copyright": "Copyright © zhangjikai.com 2017",
"modify_label": "该文件修订时间:",
"copyright": "Copyright © zhangjikai.com 2017",
"modify_label": "该文件修订时间:",
"modify_format": "YYYY-MM-DD HH:mm:ss"
},
"baidu": {
},
"3-ba": {
"token": "ff100361cdce95dd4c8fb96b4009f7bc"
},
},
"donate": {
"wechat": "https://zhangjikai.com/resource/weixin.png",
"alipay": "https://zhangjikai.com/resource/alipay.png",
"title": "",
"button": "",
"alipayText": "支付宝打赏",
"wechat": "https://zhangjikai.com/resource/weixin.png",
"alipay": "https://zhangjikai.com/resource/alipay.png",
"title": "",
"button": "",
"alipayText": "支付宝打赏",
"wechatText": "微信打赏"
},
},
"simple-page-toc": {
"maxDepth": 3,
"maxDepth": 3,
"skipFirstH1": true
},
},
"edit-link": {
"base": "https://github.com/zhangjikai/gitbook-use/edit/master",
"base": "https://github.com/zhangjikai/gitbook-use/edit/master",
"label": "Edit This Page"
},
},
"sitemap-general": {
"prefix": "http://gitbook.zhangjikai.com"
},
},
"anchor-navigation-ex": {
"isRewritePageTitle": false,
"tocLevel1Icon": "fa fa-hand-o-right",
"tocLevel2Icon": "fa fa-hand-o-right",
"isRewritePageTitle": false,
"tocLevel1Icon": "fa fa-hand-o-right",
"tocLevel2Icon": "fa fa-hand-o-right",
"tocLevel3Icon": "fa fa-hand-o-right"
},
},
"sectionx": {
"tag": "b"
},
},
"favicon": {
"shortcut": "favicon.ico",
"shortcut": "favicon.ico",
"bookmark": "favicon.ico"
}
}
}
}
18 changes: 9 additions & 9 deletions plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- [Expandable-chapters-small - 使左侧的章节目录可以折叠](#expandable-chapters-small)
- [Sectionx - 将页面分块显示](#sectionx)
- [GA - Google 统计](#ga)
- [Baidu - 百度统计](#baidu)
- [3-ba - 百度统计](#3-ba)
- [Donate - 打赏插件](#donate)
- [Local Video - 使用 Video.js 播放本地视频](#local-video)
- [Simple-page-toc - 自动生成本页的目录结构](#simple-page-toc)
Expand Down Expand Up @@ -372,16 +372,16 @@ Google 统计
}
}
```
## Baidu
## 3-ba
百度统计
[插件地址](https://plugins.gitbook.com/plugin/baidu)
[插件地址](https://plugins.gitbook.com/plugin/3-ba)
```json
"plugin": [
"baidu"
],
"pluginsConfig": {
"baidu": {
"token": "YOUR TOKEN"
{
"plugins": ["3-ba"],
"pluginsConfig": {
"3-ba": {
"token": "xxxxxxxx"
}
}
}
```
Expand Down
27 changes: 26 additions & 1 deletion themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,41 @@ GitBook 同样可以编写 API 文档,只需要引入 [`theme-api` 插件](htt
使用 GitBook 的 API 文档模式时也可以使用插件,但是因为大部分插件可能针对写书的模式,所以有可能会出现不兼容的现象。

API文档的语法也很简单,因为主要是针对方法的,所以以方法为基本单位,通过下面的语法来定义一个方法
{% raw %}
```
{% method %}
内容区
{% endmethod %}
```

在内容区里面,通过 `{% sample lang="lang" %} `来定义一个针对特定语言的演示,通过 `{% common %}` 标识所有语言共同的部分。下面是一个完整的示例:

[import](api.tag)

<pre lang="no-highlight"><code>{% sample lang="js" %}
这里演示 JavaScript 如何输出信息到控制台

```js
console.log('Hello World');
```

{% sample lang="java" %}
这里演示 Java 如何输出信息到控制台

```java
System.out.println("Hello World");
```

{% common %}
这里是 JavaScript 和 Java 共同的信息

{% endmethod %}
```
</code></pre>

{% endraw %}

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

0 comments on commit 33295ee

Please sign in to comment.