jekyll-rtd-theme 1.1.3 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +76 -30
- data/_includes/addons/analytics.liquid +6 -3
- data/_includes/addons/github.liquid +19 -4
- data/_includes/assets/sw.caches.js +43 -0
- data/_includes/class/_breadcrumbs.liquid +28 -0
- data/_includes/class/_footer.liquid +38 -0
- data/_includes/{toctree.liquid → class/_toctree.liquid} +6 -5
- data/_includes/{addons.liquid → class/rst-versions.liquid} +6 -8
- data/_includes/class/wy-nav-content.liquid +15 -0
- data/_includes/class/wy-nav-side.liquid +18 -0
- data/_includes/class/wy-nav-top.liquid +8 -0
- data/_includes/extend/list.liquid +2 -2
- data/_includes/extend/toctree.liquid +1 -11
- data/_includes/extra/footer.html +0 -0
- data/_includes/extra/head.html +0 -0
- data/_includes/node/links.liquid +24 -0
- data/_includes/node/metadata.liquid +21 -0
- data/_includes/node/script.extension.liquid +29 -0
- data/_includes/node/script.liquid +20 -0
- data/_includes/node/script.schema.liquid +27 -0
- data/_includes/node/title.liquid +1 -0
- data/_includes/reset/defaults.liquid +58 -55
- data/_includes/reset/i18n.liquid +1 -31
- data/_includes/{extend → reset}/tabs.liquid +0 -0
- data/_includes/reset/workdir.liquid +1 -15
- data/_includes/shortcodes/danger.liquid +6 -0
- data/_includes/shortcodes/mermaid.liquid +1 -0
- data/_includes/shortcodes/note.liquid +6 -0
- data/_includes/shortcodes/tip.liquid +6 -0
- data/_includes/shortcodes/warning.liquid +6 -0
- data/_layouts/default.liquid +24 -225
- data/_layouts/plugins/compress.liquid +13 -10
- data/_layouts/plugins/extension.liquid +32 -22
- data/_sass/highlight.scss +214 -0
- data/_sass/theme.scss +15 -0
- data/assets/404.liquid +1 -1
- data/assets/css/{theme.css → theme.min.css} +0 -0
- data/assets/js/theme.js +294 -1
- data/assets/js/theme.min.js +1 -0
- data/assets/robots.liquid +1 -1
- data/assets/search.liquid +0 -15
- data/assets/sitemap.liquid +1 -1
- data/assets/sw.caches.liquid +8 -0
- metadata +29 -52
- data/_includes/addons/i18n.liquid +0 -13
- data/_includes/addons/plugins.liquid +0 -6
- data/_includes/album.liquid +0 -7
- data/_includes/assets/common.js +0 -62
- data/_includes/assets/search.js +0 -76
- data/_includes/breadcrumbs.liquid +0 -43
- data/_includes/footer.liquid +0 -37
- data/_includes/i18n/en.liquid +0 -29
- data/_includes/i18n/es.liquid +0 -29
- data/_includes/i18n/fr.liquid +0 -29
- data/_includes/i18n/it.liquid +0 -29
- data/_includes/i18n/ja.liquid +0 -29
- data/_includes/i18n/ko.liquid +0 -29
- data/_includes/i18n/ru.liquid +0 -29
- data/_includes/i18n/sv.liquid +0 -29
- data/_includes/i18n/zh-cn.liquid +0 -29
- data/_includes/reset/languages.liquid +0 -110
- data/_sass/_album.scss +0 -19
- data/_sass/_embed.scss +0 -23
- data/_sass/fluid.scss +0 -7
- data/_sass/jekyll-rtd-theme.scss +0 -128
- data/assets/css/rougify/base16.css +0 -1
- data/assets/css/rougify/base16.dark.css +0 -1
- data/assets/css/rougify/base16.light.css +0 -1
- data/assets/css/rougify/base16.monokai.css +0 -1
- data/assets/css/rougify/base16.monokai.dark.css +0 -1
- data/assets/css/rougify/base16.monokai.light.css +0 -1
- data/assets/css/rougify/base16.solarized.css +0 -1
- data/assets/css/rougify/base16.solarized.dark.css +0 -1
- data/assets/css/rougify/base16.solarized.light.css +0 -1
- data/assets/css/rougify/bw.css +0 -1
- data/assets/css/rougify/colorful.css +0 -1
- data/assets/css/rougify/github.css +0 -1
- data/assets/css/rougify/gruvbox.css +0 -1
- data/assets/css/rougify/gruvbox.dark.css +0 -1
- data/assets/css/rougify/gruvbox.light.css +0 -1
- data/assets/css/rougify/igorpro.css +0 -1
- data/assets/css/rougify/magritte.css +0 -1
- data/assets/css/rougify/molokai.css +0 -1
- data/assets/css/rougify/monokai.css +0 -1
- data/assets/css/rougify/monokai.sublime.css +0 -1
- data/assets/css/rougify/pastie.css +0 -1
- data/assets/css/rougify/thankful_eyes.css +0 -1
- data/assets/css/rougify/tulip.css +0 -1
- data/assets/js/anchor.min.js +0 -9
- data/assets/js/html5shiv.min.js +0 -4
@@ -5,14 +5,17 @@ layout: plugins/extension
|
|
5
5
|
{%- if site.debug.compress == false -%}
|
6
6
|
{{ content }}
|
7
7
|
{%- else -%}
|
8
|
-
{%-
|
9
|
-
|
10
|
-
{%-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
{%-
|
15
|
-
|
16
|
-
|
17
|
-
|
8
|
+
{%- if content contains "<pre" -%}
|
9
|
+
{%- assign content_blocks = content | split: "<pre" -%}
|
10
|
+
{%- for content_block in content_blocks -%}
|
11
|
+
{%- if content_block contains "</pre>" -%}
|
12
|
+
{%- assign pre_blocks = content_block | split: "</pre>" -%}
|
13
|
+
<pre{{ pre_blocks.first }}</pre> {{ pre_blocks.last | split: " " | join: " " -}}
|
14
|
+
{%- else -%}
|
15
|
+
{{- content_block | split: " " | join: " " -}}
|
16
|
+
{%- endif -%}
|
17
|
+
{%- endfor -%}
|
18
|
+
{%- else -%}
|
19
|
+
{{- content | split: " " | join: " " -}}
|
20
|
+
{%- endif -%}
|
18
21
|
{%- endif -%}
|
@@ -1,24 +1,34 @@
|
|
1
|
-
{%-
|
2
|
-
|
3
|
-
|
4
|
-
{%- if child_blocks.size == 1 -%}
|
5
|
-
{{ block }}
|
6
|
-
{%- else -%}
|
7
|
-
{%- comment %} admonitions card {% endcomment -%}
|
8
|
-
{%- assign admonitions = "note, tip, warning, danger" | split: ", " -%}
|
9
|
-
{%- comment %} get pre code and type {% endcomment -%}
|
10
|
-
{%- assign pre_blocks = child_blocks.first | replace_first: ">", "```<temp>```" | split: "```<temp>```" -%}
|
11
|
-
{%- assign pre_type = pre_blocks.first | replace: '"', '' | replace: " class=language-", "" -%}
|
1
|
+
{%- include reset/i18n.liquid -%}
|
2
|
+
|
3
|
+
{%- assign shortcodes = "mermaid, warning, note, tip, danger" | split: ", " -%}
|
12
4
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
{%-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
5
|
+
{%- if site.debug.extension == false -%}
|
6
|
+
{{ content }}
|
7
|
+
{%- else -%}
|
8
|
+
{%- if content contains "<pre" -%}
|
9
|
+
{%- assign content_blocks = content | split: "<pre" -%}
|
10
|
+
{%- for content_block in content_blocks -%}
|
11
|
+
{%- if content_block contains "</pre>" -%}
|
12
|
+
{%- assign pre_blocks = content_block | split: "</pre>" -%}
|
13
|
+
{%- if content_block contains ' class="language-' -%}
|
14
|
+
{%- comment %} shortcodes: <pre class="language-**"> {% endcomment -%}
|
15
|
+
{%- assign custom = content_block | replace_first: ' class="language-', "" | replace_first: '">', "<temp/>" | split: "<temp/>" -%}
|
16
|
+
{%- assign lang = custom.first -%}
|
17
|
+
{%- assign codes = custom.last | split: "</pre>" | first -%}
|
18
|
+
{%- assign others = custom.last | split: "</pre>" | last -%}
|
19
|
+
{%- if shortcodes contains lang -%}
|
20
|
+
{%- include shortcodes/{{ lang }}.liquid -%} {{- others -}}
|
21
|
+
{%- else -%}
|
22
|
+
<pre{{ pre_blocks.first }}</pre> {{ pre_blocks.last }}
|
23
|
+
{%- endif -%}
|
24
|
+
{%- else -%}
|
25
|
+
<pre{{ pre_blocks.first }}</pre> {{ pre_blocks.last -}}
|
26
|
+
{%- endif -%}
|
27
|
+
{%- else -%}
|
28
|
+
{{- content_block -}}
|
29
|
+
{%- endif -%}
|
30
|
+
{%- endfor -%}
|
31
|
+
{%- else -%}
|
32
|
+
{{- content -}}
|
23
33
|
{%- endif -%}
|
24
|
-
{%-
|
34
|
+
{%- endif -%}
|
@@ -0,0 +1,214 @@
|
|
1
|
+
.highlight {
|
2
|
+
table {
|
3
|
+
td {
|
4
|
+
padding: 5px;
|
5
|
+
}
|
6
|
+
|
7
|
+
pre {
|
8
|
+
margin: 0;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
.cm {
|
13
|
+
color: #999988;
|
14
|
+
font-style: italic;
|
15
|
+
}
|
16
|
+
|
17
|
+
.cp {
|
18
|
+
color: #999999;
|
19
|
+
font-weight: bold;
|
20
|
+
}
|
21
|
+
|
22
|
+
.c1 {
|
23
|
+
color: #999988;
|
24
|
+
font-style: italic;
|
25
|
+
}
|
26
|
+
|
27
|
+
.cs {
|
28
|
+
color: #999999;
|
29
|
+
font-weight: bold;
|
30
|
+
font-style: italic;
|
31
|
+
}
|
32
|
+
|
33
|
+
.c,
|
34
|
+
.ch,
|
35
|
+
.cd,
|
36
|
+
.cpf {
|
37
|
+
color: #999988;
|
38
|
+
font-style: italic;
|
39
|
+
}
|
40
|
+
|
41
|
+
.err {
|
42
|
+
color: #a61717;
|
43
|
+
background-color: #e3d2d2;
|
44
|
+
}
|
45
|
+
|
46
|
+
.gd {
|
47
|
+
color: #000000;
|
48
|
+
background-color: #ffdddd;
|
49
|
+
}
|
50
|
+
|
51
|
+
.ge {
|
52
|
+
color: #000000;
|
53
|
+
font-style: italic;
|
54
|
+
}
|
55
|
+
|
56
|
+
.gr {
|
57
|
+
color: #aa0000;
|
58
|
+
}
|
59
|
+
|
60
|
+
.gh {
|
61
|
+
color: #999999;
|
62
|
+
}
|
63
|
+
|
64
|
+
.gi {
|
65
|
+
color: #000000;
|
66
|
+
background-color: #ddffdd;
|
67
|
+
}
|
68
|
+
|
69
|
+
.go {
|
70
|
+
color: #888888;
|
71
|
+
}
|
72
|
+
|
73
|
+
.gp {
|
74
|
+
color: #555555;
|
75
|
+
}
|
76
|
+
|
77
|
+
.gs {
|
78
|
+
font-weight: bold;
|
79
|
+
}
|
80
|
+
|
81
|
+
.gu {
|
82
|
+
color: #aaaaaa;
|
83
|
+
}
|
84
|
+
|
85
|
+
.gt {
|
86
|
+
color: #aa0000;
|
87
|
+
}
|
88
|
+
|
89
|
+
.kc,
|
90
|
+
.kd,
|
91
|
+
.kn,
|
92
|
+
.kp,
|
93
|
+
.kr {
|
94
|
+
color: #000000;
|
95
|
+
font-weight: bold;
|
96
|
+
}
|
97
|
+
|
98
|
+
.kt {
|
99
|
+
color: #445588;
|
100
|
+
font-weight: bold;
|
101
|
+
}
|
102
|
+
|
103
|
+
.k,
|
104
|
+
.kv {
|
105
|
+
color: #000000;
|
106
|
+
font-weight: bold;
|
107
|
+
}
|
108
|
+
|
109
|
+
.mf,
|
110
|
+
.mh,
|
111
|
+
.il,
|
112
|
+
.mi,
|
113
|
+
.mo,
|
114
|
+
.m,
|
115
|
+
.mb,
|
116
|
+
.mx {
|
117
|
+
color: #009999;
|
118
|
+
}
|
119
|
+
|
120
|
+
.sb,
|
121
|
+
.sc,
|
122
|
+
.sd,
|
123
|
+
.s2,
|
124
|
+
.se,
|
125
|
+
.sh,
|
126
|
+
.si,
|
127
|
+
.sx {
|
128
|
+
color: #d14;
|
129
|
+
}
|
130
|
+
|
131
|
+
.sr {
|
132
|
+
color: #009926;
|
133
|
+
}
|
134
|
+
|
135
|
+
.s1 {
|
136
|
+
color: #d14;
|
137
|
+
}
|
138
|
+
|
139
|
+
.ss {
|
140
|
+
color: #990073;
|
141
|
+
}
|
142
|
+
|
143
|
+
.s,
|
144
|
+
.sa,
|
145
|
+
.dl {
|
146
|
+
color: #d14;
|
147
|
+
}
|
148
|
+
|
149
|
+
.na {
|
150
|
+
color: #008080;
|
151
|
+
}
|
152
|
+
|
153
|
+
.bp {
|
154
|
+
color: #999999;
|
155
|
+
}
|
156
|
+
|
157
|
+
.nb {
|
158
|
+
color: #0086b3;
|
159
|
+
}
|
160
|
+
|
161
|
+
.nc {
|
162
|
+
color: #445588;
|
163
|
+
font-weight: bold;
|
164
|
+
}
|
165
|
+
|
166
|
+
.no {
|
167
|
+
color: #008080;
|
168
|
+
}
|
169
|
+
|
170
|
+
.nd {
|
171
|
+
color: #3c5d5d;
|
172
|
+
font-weight: bold;
|
173
|
+
}
|
174
|
+
|
175
|
+
.ni {
|
176
|
+
color: #800080;
|
177
|
+
}
|
178
|
+
|
179
|
+
.ne,
|
180
|
+
.nf,
|
181
|
+
.fm,
|
182
|
+
.nl {
|
183
|
+
color: #990000;
|
184
|
+
font-weight: bold;
|
185
|
+
}
|
186
|
+
|
187
|
+
.nn {
|
188
|
+
color: #555555;
|
189
|
+
}
|
190
|
+
|
191
|
+
.nt {
|
192
|
+
color: #000080;
|
193
|
+
}
|
194
|
+
|
195
|
+
.vc,
|
196
|
+
.vg,
|
197
|
+
.vi,
|
198
|
+
.nv,
|
199
|
+
.vm {
|
200
|
+
color: #008080;
|
201
|
+
}
|
202
|
+
|
203
|
+
.ow,
|
204
|
+
.o {
|
205
|
+
color: #000000;
|
206
|
+
font-weight: bold;
|
207
|
+
}
|
208
|
+
|
209
|
+
.w {
|
210
|
+
color: #bbbbbb;
|
211
|
+
}
|
212
|
+
|
213
|
+
background-color: #f8f8f8;
|
214
|
+
}
|
data/_sass/theme.scss
ADDED
data/assets/404.liquid
CHANGED
File without changes
|
data/assets/js/theme.js
CHANGED
@@ -1 +1,294 @@
|
|
1
|
-
|
1
|
+
$(document).ready(function () {
|
2
|
+
if ("serviceWorker" in navigator) {
|
3
|
+
navigator.serviceWorker.register(`${ui.baseurl}/sw.caches.js`);
|
4
|
+
} else {
|
5
|
+
debug("Service Worker not supported!");
|
6
|
+
}
|
7
|
+
|
8
|
+
function debug() {
|
9
|
+
console.debug.apply(console, arguments);
|
10
|
+
}
|
11
|
+
|
12
|
+
function search(data) {
|
13
|
+
let text = new URL(location.href).searchParams.get("q");
|
14
|
+
let lang = new URL(location.href).searchParams.get("lang") || ui.lang;
|
15
|
+
|
16
|
+
$("input[name='q']").val(text);
|
17
|
+
|
18
|
+
let results = [];
|
19
|
+
let regexp = new RegExp();
|
20
|
+
try {
|
21
|
+
regexp = new RegExp(text, "im");
|
22
|
+
} catch (e) {
|
23
|
+
$(".search").empty();
|
24
|
+
$(".search-summary").html(ui.i18n.search_results_not_found);
|
25
|
+
$("#search-results h2").html(ui.i18n.search_results);
|
26
|
+
return debug(e.message);
|
27
|
+
}
|
28
|
+
|
29
|
+
function slice(content, min, max) {
|
30
|
+
return content
|
31
|
+
.slice(min, max)
|
32
|
+
.replace(
|
33
|
+
regexp,
|
34
|
+
(match) => `<span class="highlighted">${match}</span>`
|
35
|
+
);
|
36
|
+
}
|
37
|
+
for (page of data) {
|
38
|
+
let [title, content] = [null, null];
|
39
|
+
try {
|
40
|
+
if (page.title) {
|
41
|
+
title = page.title.match(regexp);
|
42
|
+
} else {
|
43
|
+
if (page.url == "/") {
|
44
|
+
page.title = ui.title;
|
45
|
+
} else {
|
46
|
+
page.title = page.url;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
} catch (e) {
|
50
|
+
debug(e.message);
|
51
|
+
}
|
52
|
+
try {
|
53
|
+
if (page.content) {
|
54
|
+
page.content = $("<div/>").html(page.content).text();
|
55
|
+
content = page.content.match(regexp);
|
56
|
+
}
|
57
|
+
} catch (e) {
|
58
|
+
debug(e.message);
|
59
|
+
}
|
60
|
+
if (title || content) {
|
61
|
+
let result = [
|
62
|
+
`<a href="${ui.baseurl}${page.url}?highlight=${text}">${page.title}</a>`,
|
63
|
+
];
|
64
|
+
if (content) {
|
65
|
+
let [min, max] = [content.index - 100, content.index + 100];
|
66
|
+
let [prefix, suffix] = ["...", "..."];
|
67
|
+
|
68
|
+
if (min < 0) {
|
69
|
+
prefix = "";
|
70
|
+
min = 0;
|
71
|
+
}
|
72
|
+
if (max > page.content.length) {
|
73
|
+
suffix = "";
|
74
|
+
max = page.content.length;
|
75
|
+
}
|
76
|
+
result.push(
|
77
|
+
`<p class="context">${prefix}${slice(
|
78
|
+
page.content,
|
79
|
+
min,
|
80
|
+
max
|
81
|
+
)}${suffix}</p>`
|
82
|
+
);
|
83
|
+
}
|
84
|
+
results.push(`<li>${result.join("")}</li>`);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
if (results.length > 0 && text.length > 0) {
|
88
|
+
$(".search").html(results.join(""));
|
89
|
+
$(".search-summary").html(
|
90
|
+
ui.i18n.search_results_found.replace("#", results.length)
|
91
|
+
);
|
92
|
+
} else {
|
93
|
+
$(".search").empty();
|
94
|
+
$(".search-summary").html(ui.i18n.search_results_not_found);
|
95
|
+
}
|
96
|
+
$("#search-results h2").html(ui.i18n.search_results);
|
97
|
+
}
|
98
|
+
|
99
|
+
function initialize(name) {
|
100
|
+
let link = $(".wy-menu-vertical").find(`[href="${decodeURI(name)}"]`);
|
101
|
+
if (link.length > 0) {
|
102
|
+
$(".wy-menu-vertical .current").removeClass("current");
|
103
|
+
link.addClass("current");
|
104
|
+
link.closest("li.toctree-l1").parent().addClass("current");
|
105
|
+
link.closest("li.toctree-l1").addClass("current");
|
106
|
+
link.closest("li.toctree-l2").addClass("current");
|
107
|
+
link.closest("li.toctree-l3").addClass("current");
|
108
|
+
link.closest("li.toctree-l4").addClass("current");
|
109
|
+
link.closest("li.toctree-l5").addClass("current");
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
function toggleCurrent(link) {
|
114
|
+
let closest = link.closest("li");
|
115
|
+
closest.siblings("li.current").removeClass("current");
|
116
|
+
closest.siblings().find("li.current").removeClass("current");
|
117
|
+
closest.find("> ul li.current").removeClass("current");
|
118
|
+
closest.toggleClass("current");
|
119
|
+
}
|
120
|
+
|
121
|
+
function toc() {
|
122
|
+
$(".wy-menu-vertical li.current")
|
123
|
+
.append('<ul class="content-toc"></ul>')
|
124
|
+
.html(function () {
|
125
|
+
let level = parseInt(this.dataset.level);
|
126
|
+
let temp = 0;
|
127
|
+
let stack = [$(this).find(".content-toc")];
|
128
|
+
|
129
|
+
$(".document")
|
130
|
+
.find("h2,h3,h4,h5,h6")
|
131
|
+
.each(function () {
|
132
|
+
let anchor = $("<a/>")
|
133
|
+
.addClass("reference internal")
|
134
|
+
.text($(this).text())
|
135
|
+
.attr("href", `#${this.id}`);
|
136
|
+
let tagLevel = parseInt(this.tagName.slice(1)) - 1;
|
137
|
+
|
138
|
+
if (tagLevel > temp) {
|
139
|
+
let parent = stack[0].children("li:last")[0];
|
140
|
+
if (parent) {
|
141
|
+
stack.unshift($("<ul/>").appendTo(parent));
|
142
|
+
}
|
143
|
+
} else {
|
144
|
+
stack.splice(
|
145
|
+
0,
|
146
|
+
Math.min(temp - tagLevel, Math.max(stack.length - 1, 0))
|
147
|
+
);
|
148
|
+
}
|
149
|
+
temp = tagLevel;
|
150
|
+
|
151
|
+
$("<li/>")
|
152
|
+
.addClass(`toctree-l${level + tagLevel}`)
|
153
|
+
.append(anchor)
|
154
|
+
.appendTo(stack[0]);
|
155
|
+
});
|
156
|
+
if (!stack[0].html()) {
|
157
|
+
stack[0].remove();
|
158
|
+
}
|
159
|
+
});
|
160
|
+
}
|
161
|
+
|
162
|
+
function set(name, value) {
|
163
|
+
return localStorage.setItem(name, value);
|
164
|
+
}
|
165
|
+
|
166
|
+
function get(name) {
|
167
|
+
return localStorage.getItem(name) || false;
|
168
|
+
}
|
169
|
+
|
170
|
+
function restore() {
|
171
|
+
let scroll = get("scroll");
|
172
|
+
let scrollTime = get("scrollTime");
|
173
|
+
let scrollHost = get("scrollHost");
|
174
|
+
|
175
|
+
if (scroll && scrollTime && scrollHost) {
|
176
|
+
if (scrollHost == location.host && Date.now() - scrollTime < 6e5) {
|
177
|
+
$(".wy-side-scroll").scrollTop(scroll);
|
178
|
+
}
|
179
|
+
}
|
180
|
+
$(".wy-side-scroll").scroll(function () {
|
181
|
+
set("scroll", this.scrollTop);
|
182
|
+
set("scrollTime", Date.now());
|
183
|
+
set("scrollHost", location.host);
|
184
|
+
});
|
185
|
+
}
|
186
|
+
|
187
|
+
function highlight() {
|
188
|
+
let text = new URL(location.href).searchParams.get("highlight");
|
189
|
+
let box = ".highlighted-box";
|
190
|
+
|
191
|
+
if (text) {
|
192
|
+
$(".section")
|
193
|
+
.find("*")
|
194
|
+
.each(function () {
|
195
|
+
try {
|
196
|
+
if (this.outerHTML.match(new RegExp(text, "im"))) {
|
197
|
+
$(this).addClass("highlighted-box");
|
198
|
+
}
|
199
|
+
} catch (e) {
|
200
|
+
debug(e.message);
|
201
|
+
}
|
202
|
+
});
|
203
|
+
$(".section")
|
204
|
+
.find(box)
|
205
|
+
.each(function () {
|
206
|
+
if ($(this).find(box).length > 0) {
|
207
|
+
$(this).removeClass(box);
|
208
|
+
}
|
209
|
+
});
|
210
|
+
}
|
211
|
+
}
|
212
|
+
|
213
|
+
let analytics = new URL(
|
214
|
+
`https://rundocs-analytics.glitch.me/collect?v=${ui.version}&lang=${ui.lang}`
|
215
|
+
);
|
216
|
+
analytics.searchParams.append("user_lang", navigator.language);
|
217
|
+
analytics.searchParams.append("host", location.host);
|
218
|
+
analytics.searchParams.append("platform", navigator.platform);
|
219
|
+
$.getJSON(analytics.toString(), (data) => $("#counter").html(data.count));
|
220
|
+
|
221
|
+
if (location.pathname == `${ui.baseurl}/search.html`) {
|
222
|
+
$.ajax(`${ui.baseurl}/pages.json`)
|
223
|
+
.done(search)
|
224
|
+
.fail((xhr, message) => debug(message));
|
225
|
+
}
|
226
|
+
toc();
|
227
|
+
initialize(location.pathname);
|
228
|
+
restore();
|
229
|
+
highlight();
|
230
|
+
|
231
|
+
/* nested ul */
|
232
|
+
$(".wy-menu-vertical ul")
|
233
|
+
.siblings("a")
|
234
|
+
.each(function () {
|
235
|
+
let link = $(this);
|
236
|
+
let expand = $('<span class="toctree-expand"></span>');
|
237
|
+
|
238
|
+
expand.on("click", function (e) {
|
239
|
+
e.stopPropagation();
|
240
|
+
toggleCurrent(link);
|
241
|
+
return false;
|
242
|
+
});
|
243
|
+
link.prepend(expand);
|
244
|
+
});
|
245
|
+
|
246
|
+
/* bind */
|
247
|
+
$(document).on("click", '[data-toggle="wy-nav-top"]', function () {
|
248
|
+
$('[data-toggle="wy-nav-shift"]').toggleClass("shift");
|
249
|
+
$('[data-toggle="rst-versions"]').toggleClass("shift");
|
250
|
+
});
|
251
|
+
$(document).on("click", ".wy-menu-vertical .current ul li a", function () {
|
252
|
+
$('[data-toggle="wy-nav-shift"]').removeClass("shift");
|
253
|
+
$('[data-toggle="rst-versions"]').toggleClass("shift");
|
254
|
+
toggleCurrent($(this));
|
255
|
+
});
|
256
|
+
$(document).on("scroll", function () {
|
257
|
+
let start = $(this).scrollTop() + 5;
|
258
|
+
let items = [];
|
259
|
+
|
260
|
+
$(".document")
|
261
|
+
.find("h1,h2,h3,h4,h5,h6")
|
262
|
+
.each(function () {
|
263
|
+
items.push({
|
264
|
+
offset: $(this).offset().top,
|
265
|
+
id: this.id,
|
266
|
+
level: parseInt(this.tagName.slice(1)),
|
267
|
+
});
|
268
|
+
});
|
269
|
+
for (let i = 0; i < items.length; i++) {
|
270
|
+
if (start > items[i].offset) {
|
271
|
+
if (i < items.length - 1) {
|
272
|
+
if (start < items[i + 1].offset) {
|
273
|
+
if (items[i].level == 1) {
|
274
|
+
initialize(location.pathname);
|
275
|
+
} else {
|
276
|
+
initialize("#" + items[i].id);
|
277
|
+
}
|
278
|
+
}
|
279
|
+
} else {
|
280
|
+
initialize("#" + items[i].id);
|
281
|
+
}
|
282
|
+
}
|
283
|
+
}
|
284
|
+
});
|
285
|
+
$(document).on("click", '[data-toggle="rst-current-version"]', function () {
|
286
|
+
$('[data-toggle="rst-versions"]').toggleClass("shift-up");
|
287
|
+
});
|
288
|
+
$(window).bind("resize", function () {
|
289
|
+
requestAnimationFrame(function () {});
|
290
|
+
});
|
291
|
+
$(window).bind("hashchange", () =>
|
292
|
+
initialize(location.hash || location.pathname)
|
293
|
+
);
|
294
|
+
});
|