zhangdocs 1.1.6 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.html +20 -20
- package/lib/toc.js +19 -0
- package/package.json +46 -46
- package/theme/handbook/layout.ejs +74 -0
- package/theme/handbook/source/css/_partial/markdown.styl +125 -60
- package/theme/default/footer.ejs +0 -3
- package/theme/default/gitignore +0 -22
- package/theme/default/head.ejs +0 -67
- package/theme/default/header.ejs +0 -38
- package/theme/default/layout.ejs +0 -31
- package/theme/default/source/css/_partial/head_nav.styl +0 -239
- package/theme/default/source/css/_partial/highlight.styl +0 -103
- package/theme/default/source/css/_partial/markdown.styl +0 -121
- package/theme/default/source/css/_partial/reset.styl +0 -101
- package/theme/default/source/css/_partial/variables.styl +0 -10
- package/theme/default/source/css/main.styl +0 -156
- package/theme/default/source/img/forkgithub.png +0 -0
- package/theme/doc/footer.ejs +0 -25
- package/theme/doc/gitignore +0 -22
- package/theme/doc/head.ejs +0 -50
- package/theme/doc/header.ejs +0 -38
- package/theme/doc/layout.ejs +0 -16
- package/theme/doc/source/css/_partial/head_nav.styl +0 -239
- package/theme/doc/source/css/_partial/highlight.styl +0 -103
- package/theme/doc/source/css/_partial/markdown.styl +0 -121
- package/theme/doc/source/css/_partial/reset.styl +0 -101
- package/theme/doc/source/css/_partial/variables.styl +0 -10
- package/theme/doc/source/css/main.styl +0 -166
- package/theme/doc/source/img/forkgithub.png +0 -0
- package/theme/resume/footer.ejs +0 -2
- package/theme/resume/gitignore +0 -22
- package/theme/resume/head.ejs +0 -49
- package/theme/resume/layout.ejs +0 -30
- package/theme/resume/source/css/_partial/highlight.styl +0 -103
- package/theme/resume/source/css/_partial/markdown.styl +0 -137
- package/theme/resume/source/css/_partial/reset.styl +0 -101
- package/theme/resume/source/css/_partial/variables.styl +0 -10
- package/theme/resume/source/css/main.styl +0 -50
- package/theme/resume/source/js/jquery.2.1.4.min.js +0 -5
- package/theme/resume/source/js/pdfmake.js +0 -17
- package/theme/resume/source/js/vfs_fonts.js +0 -1
package/index.html
CHANGED
|
@@ -102,26 +102,26 @@
|
|
|
102
102
|
</div>
|
|
103
103
|
|
|
104
104
|
<div class="content markdown-body">
|
|
105
|
-
<h1 id="t0测试文档">测试文档 <a href="#t0测试文档"> # </a></h1>
|
|
106
|
-
<p>这是一个测试文档,用于验证 highlight.js 是否正常工作。</p>
|
|
107
|
-
<h2 id="t1JavaScript 代码示例">JavaScript 代码示例 <a href="#t1JavaScript 代码示例"> # </a></h2>
|
|
108
|
-
<pre><code class="hljs js"><span class="hljs-keyword">function</span> <span class="hljs-title function_">hello</span>(<span class="hljs-params"></span>) {
|
|
109
|
-
<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">"Hello, World!"</span>);
|
|
110
|
-
<span class="hljs-keyword">return</span> <span class="hljs-string">"success"</span>;
|
|
111
|
-
}</code></pre><h2 id="t2JSON 代码示例">JSON 代码示例 <a href="#t2JSON 代码示例"> # </a></h2>
|
|
112
|
-
<pre><code class="hljs json"><span class="hljs-punctuation">{</span>
|
|
113
|
-
<span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"test"</span><span class="hljs-punctuation">,</span>
|
|
114
|
-
<span class="hljs-attr">"version"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"1.0.0"</span><span class="hljs-punctuation">,</span>
|
|
115
|
-
<span class="hljs-attr">"dependencies"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
|
|
116
|
-
<span class="hljs-attr">"highlight.js"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"^11.11.1"</span>
|
|
117
|
-
<span class="hljs-punctuation">}</span>
|
|
118
|
-
<span class="hljs-punctuation">}</span></code></pre><h2 id="t3Diff 代码示例">Diff 代码示例 <a href="#t3Diff 代码示例"> # </a></h2>
|
|
119
|
-
<pre><code class="hljs diff"><span class="hljs-addition">+ 这是新增的行</span>
|
|
120
|
-
<span class="hljs-deletion">- 这是删除的行</span>
|
|
121
|
-
这是未修改的行</code></pre><h2 id="t4数学公式">数学公式 <a href="#t4数学公式"> # </a></h2>
|
|
122
|
-
<p>这是一个行内公式:$E = mc^2$</p>
|
|
123
|
-
<p>这是一个块级公式:</p>
|
|
124
|
-
<p>$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$</p>
|
|
105
|
+
<h1 id="t0测试文档">测试文档 <a href="#t0测试文档"> # </a></h1>
|
|
106
|
+
<p>这是一个测试文档,用于验证 highlight.js 是否正常工作。</p>
|
|
107
|
+
<h2 id="t1JavaScript 代码示例">JavaScript 代码示例 <a href="#t1JavaScript 代码示例"> # </a></h2>
|
|
108
|
+
<pre><code class="hljs js"><span class="hljs-keyword">function</span> <span class="hljs-title function_">hello</span>(<span class="hljs-params"></span>) {
|
|
109
|
+
<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">"Hello, World!"</span>);
|
|
110
|
+
<span class="hljs-keyword">return</span> <span class="hljs-string">"success"</span>;
|
|
111
|
+
}</code></pre><h2 id="t2JSON 代码示例">JSON 代码示例 <a href="#t2JSON 代码示例"> # </a></h2>
|
|
112
|
+
<pre><code class="hljs json"><span class="hljs-punctuation">{</span>
|
|
113
|
+
<span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"test"</span><span class="hljs-punctuation">,</span>
|
|
114
|
+
<span class="hljs-attr">"version"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"1.0.0"</span><span class="hljs-punctuation">,</span>
|
|
115
|
+
<span class="hljs-attr">"dependencies"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
|
|
116
|
+
<span class="hljs-attr">"highlight.js"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"^11.11.1"</span>
|
|
117
|
+
<span class="hljs-punctuation">}</span>
|
|
118
|
+
<span class="hljs-punctuation">}</span></code></pre><h2 id="t3Diff 代码示例">Diff 代码示例 <a href="#t3Diff 代码示例"> # </a></h2>
|
|
119
|
+
<pre><code class="hljs diff"><span class="hljs-addition">+ 这是新增的行</span>
|
|
120
|
+
<span class="hljs-deletion">- 这是删除的行</span>
|
|
121
|
+
这是未修改的行</code></pre><h2 id="t4数学公式">数学公式 <a href="#t4数学公式"> # </a></h2>
|
|
122
|
+
<p>这是一个行内公式:$E = mc^2$</p>
|
|
123
|
+
<p>这是一个块级公式:</p>
|
|
124
|
+
<p>$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$</p>
|
|
125
125
|
|
|
126
126
|
<div class="copyright">Powered by <a href="https://github.com/jaywcjlove/zhangdocs"
|
|
127
127
|
target="_blank">zhangdocs</a>. Dependence <a href="https://nodejs.org">Node.js</a> run.</div>
|
package/lib/toc.js
CHANGED
|
@@ -33,6 +33,10 @@ function toc(str,cb){
|
|
|
33
33
|
} else {
|
|
34
34
|
lang = '';
|
|
35
35
|
}
|
|
36
|
+
// 如果 lang 只是 'hljs' 本身,当作没有语言处理
|
|
37
|
+
if(lang === 'hljs'){
|
|
38
|
+
lang = '';
|
|
39
|
+
}
|
|
36
40
|
if(lang){
|
|
37
41
|
try{
|
|
38
42
|
htstr = hljs.highlight($(this).text(), { language: lang }).value;
|
|
@@ -43,6 +47,21 @@ function toc(str,cb){
|
|
|
43
47
|
}
|
|
44
48
|
});
|
|
45
49
|
|
|
50
|
+
// 为每个代码块添加复制按钮
|
|
51
|
+
$('pre').each(function(i, e) {
|
|
52
|
+
var $pre = $(this);
|
|
53
|
+
// 检查是否已经有复制按钮(避免重复添加)
|
|
54
|
+
if ($pre.find('.code-copy-btn').length === 0) {
|
|
55
|
+
// 设置 relative 定位以便按钮定位
|
|
56
|
+
$pre.css('position', 'relative');
|
|
57
|
+
// 添加复制按钮,使用复制图标
|
|
58
|
+
$pre.attr('data-code-index', i);
|
|
59
|
+
var copyIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.5 3.5H3.5C2.67157 3.5 2 4.17157 2 5V12.5C2 13.3284 2.67157 14 3.5 14H11C11.8284 14 12.5 13.3284 12.5 12.5V10.5M5.5 3.5C5.5 2.67157 6.17157 2 7 2H11.5C12.3284 2 13 2.67157 13 3.5V8C13 8.82843 12.3284 9.5 11.5 9.5H7C6.17157 9.5 5.5 8.82843 5.5 8V3.5Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
60
|
+
// 使用 append 而不是 prepend,避免影响代码布局
|
|
61
|
+
$pre.append('<button class="code-copy-btn" data-code-index="' + i + '" title="复制代码">' + copyIcon + '</button>');
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
46
65
|
// 1. markd模块 中文标题生成 ID bug;
|
|
47
66
|
// 2. 序列号一个导航菜单
|
|
48
67
|
tocCreate($('h1,h2,h3,h4,h5,h6').attr('id',function(idx,elm){
|
package/package.json
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "zhangdocs",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Simple document generation tool. Dependence Node.js run.",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "https://github.com/jaywcjlove/zhangdocs.git"
|
|
8
|
-
},
|
|
9
|
-
"main": "index.js",
|
|
10
|
-
"bin": {
|
|
11
|
-
"zhangdocs": ".bin/zhangdocs.js"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"zhangdocs",
|
|
15
|
-
"markdown",
|
|
16
|
-
"api",
|
|
17
|
-
"document",
|
|
18
|
-
"tool"
|
|
19
|
-
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
22
|
-
},
|
|
23
|
-
"author": "kenny wang <wowohoo@qq.com>",
|
|
24
|
-
"license": "MIT",
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"autoprefixer-stylus": "^0.13.0",
|
|
27
|
-
"cheerio": "^0.22.0",
|
|
28
|
-
"chokidar": "^1.6.1",
|
|
29
|
-
"colors-cli": "^1.0.7",
|
|
30
|
-
"commander": "^2.9.0",
|
|
31
|
-
"ejs": "^2.5.6",
|
|
32
|
-
"highlight.js": "^11.11.1",
|
|
33
|
-
"inquirer": "^3.0.5",
|
|
34
|
-
"marked": "^0.3.6",
|
|
35
|
-
"semver": "^5.3.0",
|
|
36
|
-
"shelljs": "0.6.0",
|
|
37
|
-
"ssr": "^1.0.15",
|
|
38
|
-
"stylus": "^0.54.5",
|
|
39
|
-
"underscore": "^1.8.3"
|
|
40
|
-
},
|
|
41
|
-
"zhangdocs": {
|
|
42
|
-
"theme": "default",
|
|
43
|
-
"md": [
|
|
44
|
-
"README.md"
|
|
45
|
-
]
|
|
46
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "zhangdocs",
|
|
3
|
+
"version": "1.1.9",
|
|
4
|
+
"description": "Simple document generation tool. Dependence Node.js run.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/jaywcjlove/zhangdocs.git"
|
|
8
|
+
},
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"bin": {
|
|
11
|
+
"zhangdocs": ".bin/zhangdocs.js"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"zhangdocs",
|
|
15
|
+
"markdown",
|
|
16
|
+
"api",
|
|
17
|
+
"document",
|
|
18
|
+
"tool"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
22
|
+
},
|
|
23
|
+
"author": "kenny wang <wowohoo@qq.com>",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"autoprefixer-stylus": "^0.13.0",
|
|
27
|
+
"cheerio": "^0.22.0",
|
|
28
|
+
"chokidar": "^1.6.1",
|
|
29
|
+
"colors-cli": "^1.0.7",
|
|
30
|
+
"commander": "^2.9.0",
|
|
31
|
+
"ejs": "^2.5.6",
|
|
32
|
+
"highlight.js": "^11.11.1",
|
|
33
|
+
"inquirer": "^3.0.5",
|
|
34
|
+
"marked": "^0.3.6",
|
|
35
|
+
"semver": "^5.3.0",
|
|
36
|
+
"shelljs": "0.6.0",
|
|
37
|
+
"ssr": "^1.0.15",
|
|
38
|
+
"stylus": "^0.54.5",
|
|
39
|
+
"underscore": "^1.8.3"
|
|
40
|
+
},
|
|
41
|
+
"zhangdocs": {
|
|
42
|
+
"theme": "default",
|
|
43
|
+
"md": [
|
|
44
|
+
"README.md"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
47
|
}
|
|
@@ -120,4 +120,78 @@ style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background:
|
|
|
120
120
|
|
|
121
121
|
<script src="https://static.docs-hub.com/jquerymin_1645176580555.js"></script>
|
|
122
122
|
<script src="https://static.docs-hub.com/bootstrapmin_1645176554753.js"></script>
|
|
123
|
+
<script>
|
|
124
|
+
// 代码复制功能
|
|
125
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
126
|
+
// 为所有复制按钮添加点击事件
|
|
127
|
+
document.querySelectorAll('.code-copy-btn').forEach(function(btn) {
|
|
128
|
+
btn.addEventListener('click', function(e) {
|
|
129
|
+
e.preventDefault();
|
|
130
|
+
e.stopPropagation();
|
|
131
|
+
|
|
132
|
+
// 找到对应的代码块
|
|
133
|
+
var preElement = this.parentElement;
|
|
134
|
+
var codeElement = preElement.querySelector('code');
|
|
135
|
+
|
|
136
|
+
if (!codeElement) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// 获取代码的纯文本内容
|
|
141
|
+
var codeText = codeElement.textContent || codeElement.innerText;
|
|
142
|
+
|
|
143
|
+
// 复制到剪贴板
|
|
144
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
145
|
+
// 使用现代 Clipboard API
|
|
146
|
+
navigator.clipboard.writeText(codeText).then(function() {
|
|
147
|
+
// 复制成功,更新按钮状态
|
|
148
|
+
btn.classList.add('copied');
|
|
149
|
+
|
|
150
|
+
// 2秒后恢复原状
|
|
151
|
+
setTimeout(function() {
|
|
152
|
+
btn.classList.remove('copied');
|
|
153
|
+
}, 2000);
|
|
154
|
+
}).catch(function(err) {
|
|
155
|
+
console.error('复制失败:', err);
|
|
156
|
+
// 如果 Clipboard API 失败,使用备用方法
|
|
157
|
+
fallbackCopyTextToClipboard(codeText, btn);
|
|
158
|
+
});
|
|
159
|
+
} else {
|
|
160
|
+
// 使用备用方法(兼容旧浏览器)
|
|
161
|
+
fallbackCopyTextToClipboard(codeText, btn);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// 备用复制方法
|
|
167
|
+
function fallbackCopyTextToClipboard(text, btn) {
|
|
168
|
+
var textArea = document.createElement('textarea');
|
|
169
|
+
textArea.value = text;
|
|
170
|
+
textArea.style.position = 'fixed';
|
|
171
|
+
textArea.style.top = '-9999px';
|
|
172
|
+
textArea.style.left = '-9999px';
|
|
173
|
+
document.body.appendChild(textArea);
|
|
174
|
+
textArea.focus();
|
|
175
|
+
textArea.select();
|
|
176
|
+
|
|
177
|
+
try {
|
|
178
|
+
var successful = document.execCommand('copy');
|
|
179
|
+
if (successful) {
|
|
180
|
+
btn.classList.add('copied');
|
|
181
|
+
|
|
182
|
+
setTimeout(function() {
|
|
183
|
+
btn.classList.remove('copied');
|
|
184
|
+
}, 2000);
|
|
185
|
+
} else {
|
|
186
|
+
alert('复制失败,请手动选择代码复制');
|
|
187
|
+
}
|
|
188
|
+
} catch (err) {
|
|
189
|
+
console.error('复制失败:', err);
|
|
190
|
+
alert('复制失败,请手动选择代码复制');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
document.body.removeChild(textArea);
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
</script>
|
|
123
197
|
<% include footer.ejs %>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
.markdown-body
|
|
2
|
-
padding: 30px
|
|
2
|
+
padding: 20px 30px 20px 30px
|
|
3
3
|
word-wrap: break-word
|
|
4
|
-
font-family:
|
|
5
|
-
font-size:
|
|
6
|
-
line-height: 1.
|
|
7
|
-
color
|
|
4
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif
|
|
5
|
+
font-size: 15px
|
|
6
|
+
line-height: 1.6
|
|
7
|
+
color: #24292e
|
|
8
8
|
@media mq-mobile
|
|
9
9
|
padding: 30px 10px 30px 10px
|
|
10
10
|
&>*:first-child
|
|
@@ -12,18 +12,29 @@
|
|
|
12
12
|
strong
|
|
13
13
|
font-weight: bold
|
|
14
14
|
hr
|
|
15
|
-
border
|
|
16
|
-
border-
|
|
15
|
+
border: none
|
|
16
|
+
border-top: 1px solid #d8dee4
|
|
17
|
+
margin: 20px 0
|
|
17
18
|
em
|
|
18
|
-
font-style:italic
|
|
19
|
+
font-style: italic
|
|
19
20
|
img
|
|
20
|
-
max-width 100%
|
|
21
|
+
max-width: 100%
|
|
22
|
+
height: auto
|
|
23
|
+
border-radius: 4px
|
|
24
|
+
a
|
|
25
|
+
color: #0969da
|
|
26
|
+
text-decoration: none
|
|
27
|
+
&:hover
|
|
28
|
+
text-decoration: underline
|
|
29
|
+
&:visited
|
|
30
|
+
color: #0969da
|
|
21
31
|
h1,h2,h3,h4,h5,h6
|
|
22
32
|
position: relative
|
|
23
|
-
margin-top:
|
|
24
|
-
margin-bottom:
|
|
25
|
-
font-weight:
|
|
26
|
-
line-height: 1.
|
|
33
|
+
margin-top: 0.8em
|
|
34
|
+
margin-bottom: 12px
|
|
35
|
+
font-weight: 600
|
|
36
|
+
line-height: 1.25
|
|
37
|
+
color: #1f2328
|
|
27
38
|
a
|
|
28
39
|
display:none
|
|
29
40
|
&:hover a
|
|
@@ -31,68 +42,121 @@
|
|
|
31
42
|
color:#000
|
|
32
43
|
font-size:85%
|
|
33
44
|
h1,h2
|
|
34
|
-
border-bottom: 1px solid #
|
|
45
|
+
border-bottom: 1px solid #d8dee4
|
|
35
46
|
h1
|
|
36
|
-
font-size:
|
|
47
|
+
font-size: 2em
|
|
37
48
|
line-height: 1.2
|
|
38
|
-
padding-bottom: 0.
|
|
49
|
+
padding-bottom: 0.25em
|
|
50
|
+
margin-top: 0
|
|
39
51
|
h2
|
|
40
|
-
padding-bottom: 0.
|
|
41
|
-
font-size: 1.
|
|
42
|
-
line-height: 1.
|
|
43
|
-
border-bottom:1px
|
|
52
|
+
padding-bottom: 0.25em
|
|
53
|
+
font-size: 1.5em
|
|
54
|
+
line-height: 1.3
|
|
55
|
+
border-bottom: 1px solid #d8dee4
|
|
56
|
+
h3
|
|
57
|
+
font-size: 1.25em
|
|
58
|
+
h4
|
|
59
|
+
font-size: 1em
|
|
60
|
+
h5
|
|
61
|
+
font-size: 0.875em
|
|
62
|
+
h6
|
|
63
|
+
font-size: 0.85em
|
|
64
|
+
color: #656d76
|
|
44
65
|
blockquote
|
|
45
|
-
padding: 0
|
|
46
|
-
color: #
|
|
47
|
-
border-left:
|
|
48
|
-
margin: 0
|
|
66
|
+
padding: 0 1em
|
|
67
|
+
color: #656d76
|
|
68
|
+
border-left: 3px solid #d8dee4
|
|
69
|
+
margin: 0
|
|
70
|
+
background-color: #f6f8fa
|
|
71
|
+
border-radius: 3px
|
|
72
|
+
padding: 8px 16px
|
|
49
73
|
&>:last-child
|
|
50
74
|
margin-bottom: 0
|
|
51
75
|
&>:first-child
|
|
52
76
|
margin-top: 0
|
|
53
77
|
p,blockquote,ul,ol,dl,table,pre
|
|
54
|
-
margin-top: 0
|
|
55
|
-
margin-bottom:
|
|
78
|
+
margin-top: 0
|
|
79
|
+
margin-bottom: 12px
|
|
56
80
|
ul,ol
|
|
57
|
-
padding-left: 1.
|
|
58
|
-
|
|
81
|
+
padding-left: 1.5em
|
|
82
|
+
margin-bottom: 12px
|
|
83
|
+
li
|
|
84
|
+
margin-bottom: 4px
|
|
85
|
+
line-height: 1.6
|
|
86
|
+
ul
|
|
87
|
+
list-style-type: disc
|
|
59
88
|
ol
|
|
60
89
|
list-style-type: decimal
|
|
61
90
|
ol ol, ul ol
|
|
62
|
-
list-style-type: lower-roman
|
|
91
|
+
list-style-type: lower-roman
|
|
63
92
|
ul ul ol, ul ol ol, ol ul ol, ol ol ol
|
|
64
|
-
list-style-type: lower-alpha
|
|
93
|
+
list-style-type: lower-alpha
|
|
65
94
|
pre
|
|
66
|
-
padding: 16px
|
|
95
|
+
padding: 12px 16px
|
|
67
96
|
overflow: auto
|
|
68
|
-
background-color: #
|
|
69
|
-
border
|
|
97
|
+
background-color: #f6f8fa
|
|
98
|
+
border: 1px solid #d8dee4
|
|
99
|
+
border-radius: 6px
|
|
70
100
|
word-break: break-all
|
|
71
101
|
word-wrap: break-word
|
|
72
|
-
font:
|
|
73
|
-
white-space: pre-wrap
|
|
102
|
+
font: 13px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace
|
|
103
|
+
white-space: pre-wrap
|
|
104
|
+
position: relative
|
|
105
|
+
margin-bottom: 12px
|
|
106
|
+
.code-copy-btn
|
|
107
|
+
position: absolute
|
|
108
|
+
top: 0
|
|
109
|
+
right: 0
|
|
110
|
+
padding: 0
|
|
111
|
+
background-color: transparent
|
|
112
|
+
color: #333
|
|
113
|
+
border: none
|
|
114
|
+
border-radius: 4px
|
|
115
|
+
font-size: 0
|
|
116
|
+
cursor: pointer
|
|
117
|
+
opacity: 0.5
|
|
118
|
+
transition: all 0.2s
|
|
119
|
+
z-index: 10
|
|
120
|
+
display: flex
|
|
121
|
+
align-items: center
|
|
122
|
+
justify-content: center
|
|
123
|
+
width: 24px
|
|
124
|
+
height: 24px
|
|
125
|
+
&:hover
|
|
126
|
+
opacity: 1
|
|
127
|
+
color: #007bff
|
|
128
|
+
&:active
|
|
129
|
+
transform: scale(0.95)
|
|
130
|
+
&.copied
|
|
131
|
+
color: #28a745
|
|
132
|
+
opacity: 1
|
|
133
|
+
svg
|
|
134
|
+
width: 20px
|
|
135
|
+
height: 20px
|
|
136
|
+
pointer-events: none
|
|
74
137
|
code
|
|
75
138
|
background-color: transparent
|
|
76
|
-
color:
|
|
77
|
-
line-height: 1.
|
|
139
|
+
color: #24292e
|
|
140
|
+
line-height: 1.45
|
|
78
141
|
display: block
|
|
79
|
-
font-size:
|
|
80
|
-
white-space: pre-wrap
|
|
142
|
+
font-size: 13px
|
|
143
|
+
white-space: pre-wrap
|
|
144
|
+
// 确保代码内容不受按钮影响
|
|
145
|
+
&::before
|
|
146
|
+
content: none
|
|
81
147
|
|
|
82
148
|
code,tt
|
|
83
|
-
padding:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
word-break: break-all // 添加这一行
|
|
95
|
-
word-wrap: break-word // 添加这一行
|
|
149
|
+
padding: 2px 6px
|
|
150
|
+
margin: 0 2px
|
|
151
|
+
vertical-align: baseline
|
|
152
|
+
background-color: rgba(175, 184, 193, 0.2)
|
|
153
|
+
border-radius: 3px
|
|
154
|
+
font-size: 85%
|
|
155
|
+
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace
|
|
156
|
+
color: #e36209
|
|
157
|
+
white-space: pre-wrap
|
|
158
|
+
word-break: break-all
|
|
159
|
+
word-wrap: break-word
|
|
96
160
|
|
|
97
161
|
code:before,code:after,tt:before,tt:after
|
|
98
162
|
content: "\00a0"
|
|
@@ -102,18 +166,19 @@
|
|
|
102
166
|
border-collapse: collapse
|
|
103
167
|
border-spacing: 0
|
|
104
168
|
max-width: 100%
|
|
105
|
-
display:
|
|
106
|
-
|
|
169
|
+
display: table
|
|
170
|
+
margin-bottom: 12px
|
|
107
171
|
th,td
|
|
108
|
-
border: 1px solid #
|
|
109
|
-
padding:
|
|
172
|
+
border: 1px solid #d8dee4
|
|
173
|
+
padding: 6px 13px
|
|
174
|
+
text-align: left
|
|
110
175
|
th
|
|
111
|
-
font-weight:
|
|
112
|
-
background: #
|
|
176
|
+
font-weight: 600
|
|
177
|
+
background: #f6f8fa
|
|
113
178
|
tr:nth-child(2n)
|
|
114
|
-
background-color: #
|
|
179
|
+
background-color: #f6f8fa
|
|
115
180
|
tbody
|
|
116
|
-
background
|
|
181
|
+
background: #fff
|
|
117
182
|
|
|
118
183
|
// markdown 增强样式
|
|
119
184
|
.markdown-body
|
package/theme/default/footer.ejs
DELETED
package/theme/default/gitignore
DELETED
package/theme/default/head.ejs
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
|
-
<title>
|
|
8
|
-
<%=title%>
|
|
9
|
-
</title>
|
|
10
|
-
<%if(pkg.zhangdocs&&pkg.zhangdocs.logo){ var iconurl=pkg.zhangdocs.logo %>
|
|
11
|
-
<%if( /\.png$/.test(iconurl)){%>
|
|
12
|
-
<link rel="shortcut icon" href="<%=relative_path%><%=pkg.zhangdocs.logo%>" type="image/x-png">
|
|
13
|
-
<%}else if(/\.ico$/.test(iconurl)){%>
|
|
14
|
-
<link rel="shortcut icon" href="<%=relative_path%><%=pkg.zhangdocs.logo%>" type="image/x-icon">
|
|
15
|
-
<%}%>
|
|
16
|
-
<%}%>
|
|
17
|
-
<link rel="stylesheet" type="text/css" href="<%=relative_path%>static/css/main.css">
|
|
18
|
-
<!-- 添加MathJax支持 -->
|
|
19
|
-
<script type="text/javascript" id="MathJax-script" async
|
|
20
|
-
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
|
|
21
|
-
</script>
|
|
22
|
-
<script type="text/javascript">
|
|
23
|
-
window.MathJax = {
|
|
24
|
-
tex: {
|
|
25
|
-
inlineMath: [['$', '$'], ['\\(', '\\)'], ['(', ')']],
|
|
26
|
-
displayMath: [['$$', '$$'], ['\\[', '\\]']],
|
|
27
|
-
processEscapes: true,
|
|
28
|
-
processEnvironments: true,
|
|
29
|
-
packages: ['base', 'ams', 'noerrors', 'noundefined']
|
|
30
|
-
},
|
|
31
|
-
options: {
|
|
32
|
-
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'],
|
|
33
|
-
ignoreHtmlClass: 'tex2jax_ignore',
|
|
34
|
-
processHtmlClass: 'tex2jax_process'
|
|
35
|
-
},
|
|
36
|
-
svg: {
|
|
37
|
-
fontCache: 'global'
|
|
38
|
-
},
|
|
39
|
-
chtml: {
|
|
40
|
-
scale: 1,
|
|
41
|
-
minScale: .5,
|
|
42
|
-
mtextInheritFont: true,
|
|
43
|
-
merrorInheritFont: true
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
</script>
|
|
47
|
-
<script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
|
|
48
|
-
<script>
|
|
49
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
50
|
-
mermaid.initialize({
|
|
51
|
-
startOnLoad: true,
|
|
52
|
-
theme: 'default',
|
|
53
|
-
themeVariables: {
|
|
54
|
-
primaryColor: '#ff6b6b',
|
|
55
|
-
primaryTextColor: '#333',
|
|
56
|
-
primaryBorderColor: '#ff6b6b',
|
|
57
|
-
lineColor: '#333',
|
|
58
|
-
secondaryColor: '#f8f9fa',
|
|
59
|
-
tertiaryColor: '#fff'
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
</script>
|
|
64
|
-
</head>
|
|
65
|
-
|
|
66
|
-
<body>
|
|
67
|
-
<% include header.ejs %>
|
package/theme/default/header.ejs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<div class="navbar <%if(!index){%>navbar-line<%}%>">
|
|
2
|
-
<div class="container">
|
|
3
|
-
<div class="logo">
|
|
4
|
-
<%if(pkg.zhangdocs.logo){%>
|
|
5
|
-
<img src="<%=relative_path%><%=pkg.zhangdocs.logo%>">
|
|
6
|
-
<%}else{%>
|
|
7
|
-
<%= title %>
|
|
8
|
-
<%}%>
|
|
9
|
-
</div>
|
|
10
|
-
<input type="checkbox" id="zhangdocs_nav" />
|
|
11
|
-
<div class="menu_tree">
|
|
12
|
-
<%- menu_html %>
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
<% if(pkg&&pkg.repository&&pkg.repository.url) {%>
|
|
16
|
-
<div class="forkgithub"><a target="_blank" href="<%=pkg.repository.url%>">fork on github</a></div>
|
|
17
|
-
<%}%>
|
|
18
|
-
|
|
19
|
-
<section class="zhangdocs_nav_btn">
|
|
20
|
-
<label for="zhangdocs_nav"><span></span></label>
|
|
21
|
-
</section>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<% if(index){ %>
|
|
28
|
-
<div class="bs-docs-header">
|
|
29
|
-
<div class="container">
|
|
30
|
-
<h1>
|
|
31
|
-
<%= title %>
|
|
32
|
-
</h1>
|
|
33
|
-
<p>
|
|
34
|
-
<%= pkg.description %>
|
|
35
|
-
</p>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
<% } %>
|