Skip to content

Commit a7388a3

Browse files
author
Gavin Liu
committed
使用 docsify 结构化文档内容
1 parent 1b46217 commit a7388a3

File tree

4 files changed

+107
-8
lines changed

4 files changed

+107
-8
lines changed

.nojekyll

Whitespace-only changes.

0.9.md

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### 0.9 go fmt与gofmt
1+
# go fmt与gofmt
22

33

44
`go fmt`命令会按照Go语言代码规范格式化指定代码包中的所有Go语言源码文件的代码,所有Go语言源码文件即包括命令源码文件、库源码文件和测试源码文件。注意,当代码包还有子代码包时,子代码包中的Go语言源码文件是不包含在内的。也就是说,`go fmt`命令只会格式化被直接保存在指定代码包对应目录下的Go语言源码文件。
@@ -95,10 +95,3 @@ if a == "print" {
9595
```
9696
9797
由上述示例可知,我们可以使用`gofmt`命令的交互模式格式化任意的代码片段。虽然会显示一行警告信息,但是格式化后的结果仍然会被打印出来。并且,在交互模式下,当我们输入的代码片段不符合Go语言的语法规则时,命令程序也会打印出错误提示信息。在其它方面,命令程序在交互模式与普通模式下的行为也是基本一致的。
98-
99-
100-
101-
## links
102-
* [目录](catalog.md)
103-
* 上一节: [go list](0.8.md)
104-
* 下一节: [go fix与go tool fix](0.10.md)

_sidebar.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
* [标志命令详解](0.0)
2+
3+
* [go build](0.1)
4+
5+
* [go install](0.2)
6+
7+
* [go get](0.3)
8+
9+
* [go clean](0.4)
10+
11+
* [go doc 与 godoc](0.5)
12+
13+
* [go run](0.6)
14+
15+
* [go test](0.7)
16+
17+
* [go list](0.8)
18+
19+
* [go fmt 与 gofmt](0.9)
20+
21+
* [go fix 与 go tool fix](0.10)
22+
23+
* [go vet 与 go tool vet](0.11)
24+
25+
* [go tool pprof](0.12)
26+
27+
* [go tool cgo](0.13)
28+
29+
* [go env](0.14)
30+

index.html

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Go 命令教程</title>
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7+
<meta name="description" content="Description">
8+
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
9+
<!-- 在 GitHub 上编辑 -->
10+
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
11+
<!-- 自定义样式 -->
12+
<style>
13+
.sidebar li>p a {
14+
font-weight: 700;
15+
}
16+
.sidebar ul p.active>a {
17+
border-right: 2px solid;
18+
color: var(--theme-color,#42b983);
19+
}
20+
</style>
21+
<script src="//unpkg.com/docsify-edit-on-github/index.js"></script>
22+
</head>
23+
<body>
24+
<div id="app"></div>
25+
<script>
26+
window.$docsify = {
27+
name: 'Go 命令教程',
28+
repo: 'hyper0x/go_command_tutorial',
29+
loadSidebar: true,
30+
auto2top: true,
31+
// 全文搜索配置
32+
search: {
33+
paths: 'auto', // or 'auto'
34+
placeholder: '输入关键词搜索',
35+
noData: '找不到结果'
36+
},
37+
pagination: {
38+
previousText: '上一节',
39+
nextText: '下一节',
40+
crossChapter: false
41+
},
42+
plugins: [
43+
EditOnGithubPlugin.create(
44+
'https://github.com/hyper0x/go_command_tutorial/blob/master/',
45+
undefined,
46+
'在 GitHub 上编辑本页'
47+
),
48+
function(hook) {
49+
var footer = [
50+
'<footer>',
51+
'<span>Powered by <a href="https://github.com/docsifyjs/docsify" target="_blank">docsify</a>.</span>',
52+
'</footer>'
53+
].join('');
54+
55+
hook.afterEach(function(html) {
56+
return html + footer;
57+
});
58+
}
59+
]
60+
}
61+
</script>
62+
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
63+
<!-- 语言高亮 -->
64+
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
65+
<!-- 全文搜索 -->
66+
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
67+
<!-- emoji 支持 -->
68+
<script src="//unpkg.com/docsify/lib/plugins/emoji.min.js"></script>
69+
<!-- 复制到剪贴板 -->
70+
<script src="//unpkg.com/docsify-copy-code"></script>
71+
<!-- 图片缩放 -->
72+
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.js"></script>
73+
<!-- 分页 -->
74+
<script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
75+
</body>
76+
</html>

0 commit comments

Comments
 (0)