-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
247 lines (221 loc) · 8.01 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="UTF-8">
<meta name="referrer" content="never">
<link rel="icon" type="image/png" href="./Python.svg"/>
<title>《Python工匠》</title>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/style.min.css"/>
<style>
.markdown-section {
position: relative;
/*正文宽度*/
max-width: 63em;
margin: 0 auto;
padding: 2rem 45px
}
.markdown-section p {
/*正文行高*/
line-height: 30px;
}
/* ============== code代码样式优化 ================ */
/*侧边栏边距控制*/
.sidebar-nav li {
position: relative;
margin: 6px 0 6px 0;
padding-left: 8px; /*箭头右边的边距*/
cursor: pointer
}
/*箭头左边的边距*/
.sidebar-nav ul:not(.app-sub-sidebar) {
padding-left: 8px;
}
/*顶层文件夹字体增大*/
.sidebar-nav li.level-1 > a {
font-size: 17px;
}
/*鼠标进入搜索框变色*/
.search input:hover {
box-shadow: 0 0 5px #42b983;
border: 1px solid #42b983;
}
/*侧边栏展缩图标*/
.sidebar-nav ul:not(.app-sub-sidebar) > li:not(.file)::before {
content: '';
display: block;
position: absolute;
top: 11px;
left: -12px;
height: 6px;
width: 6px;
/*border-right: 10px;*/
/*margin: 10px;*/
border-right: 1px solid #505d6b;
border-bottom: 1px solid #505d6b;
transform: rotate(-45deg);
transition: transform .1s
}
.sidebar-nav ul:not(.app-sub-sidebar) > li.open::before {
transform: rotate(45deg)
}
.sidebar-nav ul:not(.app-sub-sidebar) > li.collapse::before {
transform: rotate(-45deg)
}
.app-name-link img {
max-width: 100%;
}
/*移动端关闭显示TOC*/
@media only screen and (max-width: 1299px) {
aside.toc-nav {
display: none;
}
}
</style>
<!-- 箭头样式 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-sidebar-collapse/dist/sidebar.min.css"/>
</head>
<body>
<!--收到 docsify.min.js 文件响应之前显示的页面-->
<div id="app">加载中...</div>
<script>
// 配置项:https://docsify.js.org/#/zh-cn/configuration?id=el
window.$docsify = {
maxLevel: 6,
// loadNavbar: true,
loadSidebar: true,
subMaxLevel: 3,
auto2top: true,
// coverpage: true,
// logo: './Python.svg',
name: '《Python工匠》',
// nameLink: '/',
alias: {
'/.*/_sidebar.md': '/_sidebar.md', // See #301
},
// autoHeader: true,
executeScript: true,
mergeNavbar: true,
// formatUpdated: '{YYYY}年{MM}月{DD}日',
notFoundPage: true,
topMargin: 20,
// 配置插件
// ----------------------------------------------------------------
// 代码复制
copyCode: {
buttonText: '复制',
errorText: '失败',
successText: '已复制'
},
// 全局搜索插件
search: {
maxAge: 86400000, // 过期时间,单位毫秒,默认一天
paths: [], // or 'auto'
placeholder: {
'/': /mobile/i.test(navigator.userAgent) ? '搜索' : '搜索 ( Ctrl + K )',
'/en/': 'Type to search'
},
noData: {
'/': '找不到结果',
'/en/': 'No Results'
},
// 搜索标题的最大层级, 1 - 6
depth: 3,
hideOtherSidebarContent: false, // 是否隐藏其他侧边栏内容
},
// 底部导航
pagination: {
previousText: "上一页",
nextText: "下一页",
crossChapter: true,
crossChapterText: true,
},
// 页面右侧toc
toc: {
tocMaxLevel: 3,
target: "h2, h3, h4, h5, h6",
},
// docsify-valine (defaults)
Valine: {
el: '#vcomments',
appId: 'PHalJUcdodWmeIDrv6vcdjoQ-9Nh9j0Va',
appKey: '0clIJq6497kczkWA9UDDSHKM',
placeholder: '请留言。',
},
// 字数统计 https://github.com/827652549/docsify-count
count: {
countable: true,
position: "top",
margin: "10px",
float: "right",
fontsize: "0.9em",
// color: "red",
language: "chinese",
localization: {
words: "",
minute: "",
},
isExpected: true,
},
plugins: [
function (hook, vm) {
hook.beforeEach(function (html) {
});
}
],
};
</script>
<!-- 添加插件 -->
<!-- docsify -->
<script src="https://cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
<!-- 代码高亮 https://cdn.jsdelivr.net/npm/prismjs@1/components/ -->
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-python.min.js"></script>
<!-- 代码复制 https://github.com/jperasmus/docsify-copy-code/blob/master/README.md-->
<script src="https://cdn.jsdelivr.net/npm/docsify-copy-code@2/dist/docsify-copy-code.min.js"></script>
<!-- 底部分页导航 https://github.com/imyelo/docsify-pagination -->
<script src="https://unpkg.com/[email protected]/dist/docsify-pagination.min.js"></script>
<!-- 全文搜索 -->
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/search.js"></script>
<!-- 图片缩放 -->
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/zoom-image.min.js"></script>
<!-- 侧边栏目录折叠 -->
<script src="https://cdn.jsdelivr.net/npm/docsify-sidebar-collapse/dist/docsify-sidebar-collapse.min.js"></script>
<!-- emoji -->
<script src="https://cdn.jsdelivr.net/npm/docsify/lib/plugins/emoji.min.js"></script>
<!--外链引用-->
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/external-script.min.js"></script>
<!-- 黑色主题 -->
<script src="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/index.min.js"></script>
<!-- 字数统计 https://github.com/827652549/docsify-count -->
<script src="https://cdn.jsdelivr.net/npm/docsify-count@latest/dist/countable.min.js"></script>
<!-- 页面右侧 TOC -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/docsify-plugin-toc.min.js"></script>
<!-- valine无后端评论系统 https://valine.js.org/quickstart.html、https://github.com/daidi/docsify-valine -->
<script src='https://unpkg.com/valine/dist/Valine.min.js'></script>
<script src="./docsify-valine.min.js"></script>
<script>
// 搜索框支持快捷键
setTimeout(function () {
let inp = document.querySelector('input[type="search"]');
document.addEventListener("keydown", function (e) {
if (e.ctrlKey && e.code === "KeyK") {
e.preventDefault() // 阻止显示器响应快捷键
inp.focus();
inp.select();
}
});
}, 200);
// 解决黑暗模式不适配toc插件
setInterval(function () {
var toc_text_color = getComputedStyle(document.querySelector('main')).getPropertyValue('color-scheme') === 'dark' ? 'white' : 'black'
document.querySelectorAll('.page_toc a').forEach(
function (e) {
e.style.color = toc_text_color
}
)
}, 100);
</script>
</body>
</html>