-
Notifications
You must be signed in to change notification settings - Fork 54
/
extra.js
46 lines (42 loc) · 1.65 KB
/
extra.js
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
var footer = document.querySelector('footer');
footer.innerHTML = footer.innerHTML.replace('<p>Documentation built with <a href="https://www.mkdocs.org/">MkDocs</a>.</p>', '<p style="display: none">本页面由 <a href="https://www.mkdocs.org/">MkDocs</a> 构建</p>');
var lut = {
Next: '下一章',
Previous: '上一章',
Search: '搜索',
'Edit on GitHub': '编辑此页面',
};
// enumerate all nav-links
var links = document.querySelectorAll('a.nav-link');
for (var i = 0; i < links.length; i++) {
var link = links[i];
for (var j = 0; j < link.childNodes.length; j++) {
var node = link.childNodes[j];
if (node.data !== undefined) {
var key = node.data.trim();
var to = lut[key];
if (to !== undefined) {
node.data = node.data.replace(key, to);
}
}
}
}
var nasms = document.querySelectorAll('code.language-nasm');
for (var i = 0; i < nasms.length; i++) {
var nasm = nasms[i];
// add class .language-wasm .hljs
nasm.classList.add('language-x86asm', 'hljs');
// remove class .language-nasm
nasm.classList.remove('language-nasm');
}
var stylesheets = [
'https://cdn.jsdelivr.net/npm/@fontsource/[email protected]/index.min.css',
'https://cdn.jsdelivr.net/npm/[email protected]/css/jetbrains-mono.min.css',
'https://cdn.jsdelivr.net/npm/@fontsource/[email protected]/chinese-simplified-500.min.css',
];
for (var i = 0; i < stylesheets.length; i++) {
var link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.setAttribute('href', stylesheets[i]);
document.head.appendChild(link);
}