forked from nodejs/undici
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
107 lines (96 loc) · 3.75 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Node.js Undici</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="A HTTP/1.1 client, written from scratch for Node.js.">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
<link rel="icon" type="image/png" href="https://nodejs.org/static/images/favicons/favicon.png" />
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
name: 'Node.js Undici',
repo: 'https://github.com/nodejs/undici',
loadSidebar: 'docsify/sidebar.md',
search: {
noData: {
'/': 'No results!'
},
paths: ['docs/'],
placeholder: {
'/': 'Search'
}
},
auto2top: true,
subMaxLevel: 3,
maxLevel: 3,
themeColor: '#2B91F0',
noCompileLinks: [
'benchmarks/.*'
],
relativePath: true,
markdown: {
renderer: {
// Mimic markedjs/marked behavior just modify href - https://github.com/markedjs/marked/blob/master/src/Renderer.ts#L178-L191
link(href, title, text) {
const originalHref = href;
if (href.startsWith('./')) {
// Use absolute path (e.g. ./docs/api.md => /docs/api.md) if href starts with ./ (e.g. ./api.md)
href = href.slice(1);
}
// Check for /docs/docs/ in the href and remove duplication it if present
href = href.startsWith('/docs/docs/') ? href.replace('/docs/', '/') : href;
// Check for /docs/ in the href and remove it if present
if (href.startsWith('/docs/')) {
// ignore paths /docs/api/ and /docs/best-practices/ in /docs/docs directory
if (!/^(\/docs\/(?:api|best-practices))(?:\/|$)/.test(href)) {
href = href.includes('/docs/') ? href.replace('/docs/', '/') : href;
}
}
let target = '';
if (originalHref.startsWith('http')) {
// External link - default behavior is to open in a new window
return `<a href="${originalHref}" ${title}" target="_blank" rel="noopener noreferrer">${text}</a>`;
}
title = title ? `title="${title}"` : '';
let out = `<a href="#${href}" ${title}">${text}</a>`;
return out;
},
},
},
}
</script>
<!-- Docsify v4 -->
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
<script type="module">
import mermaid from "//cdn.jsdelivr.net/npm/mermaid@10.8.0/+esm";
mermaid.initialize({ startOnLoad: true });
window.mermaid = mermaid;
</script>
<script>
const plugin = (config) => (hook) => {
hook.afterEach((html, next) => {
const container = document.createElement('div');
container.innerHTML = html;
const elements = container.querySelectorAll('pre[data-lang=mermaid]')
for (const element of elements) {
const replacement = document.createElement('div');
replacement.textContent = element.textContent;
replacement.classList.add('mermaid');
element.parentNode.replaceChild(replacement, element);
}
next(container.innerHTML);
});
hook.doneEach(() => mermaid.run(config));
}
window.$docsify = window.$docsify || {};
window.$docsify.plugins = window.$docsify.plugins || []
window.$docsify.plugins.push(plugin(window.$docsify.mermaidConfig || { querySelector: ".mermaid" }));
</script>
</body>
</html>