generated from hibbitts-design/docsify-open-publishing-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
476 lines (384 loc) · 20.4 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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Open Projects by David Malawey</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Open Projects by David Malawey">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" sizes="57x57" href="/images/favicons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/images/favicons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/images/favicons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/images/favicons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/images/favicons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/images/favicons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/images/favicons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/images/favicons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/images/favicons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/images/favicons/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/images/favicons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicons/favicon-16x16.png">
<link rel="manifest" href="/images/favicons/manifest.json">
<meta name="msapplication-TileColor" content="#0A6ECC">
<meta name="msapplication-TileImage" content="/images/favicons/ms-icon-144x144.png">
<meta name="theme-color" content="#0A6ECC">
<!-- Themeable Simple theme
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css">-->
<!-- Themeable Simple light + dark theme (uncomment to use, and comment out the above loading of Simple theme) -->
<link rel="stylesheet" media="(prefers-color-scheme: light)"
href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css">
<link rel="stylesheet" media="(prefers-color-scheme: dark)"
href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css">
<link rel="stylesheet" href="assets/css/theme.css">
<link rel="stylesheet" href="assets/css/custom.css">
<!-- Font Awesome Stylesheets -->
<link rel="stylesheet" href="https://unpkg.com/@fortawesome/fontawesome-free/css/fontawesome.css" />
<link rel="stylesheet" href="https://unpkg.com/@fortawesome/fontawesome-free/css/brands.css" />
<link rel="stylesheet" href="https://unpkg.com/@fortawesome/fontawesome-free/css/regular.css" />
<link rel="stylesheet" href="https://unpkg.com/@fortawesome/fontawesome-free/css/solid.css" />
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap" rel="stylesheet">
<style>
:root {
--base-font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
--base-line-height: 1.5; /* Slightly increased for readability */
--base-font-size: 1.2rem; /* Slightly larger base font size */
--cover-max-width: 50em; /* Slightly wider for improved readability */
--heading-h2-border-style: none;
--heading-h1-margin: 1.25rem 0rem -0.5rem 0rem; /* Adjusted for better spacing */
--heading-h2-margin: 1.25rem 0rem -1.25rem 0rem;
--heading-h3-margin: 1.25rem 0rem -0.5rem 0rem;
--heading-h4-margin: 1.25rem 0rem -0.5rem 0rem;
--heading-h5-margin: 1.25rem 0rem -0.5rem 0rem;
--heading-h6-margin: 1.25rem 0rem 0rem 0rem;
--heading-h1-font-size: 2rem; /* Larger headings for better hierarchy */
--heading-h2-font-size: 1.75rem;
--heading-h3-font-size: 1.5rem;
--heading-h4-font-size: 1.35rem;
--heading-h5-font-size: 1.25rem;
--heading-h6-font-size: 1.15rem;
--heading-h1-font-weight: 600; /* Slightly bolder for emphasis */
--heading-h2-font-weight: 600;
--heading-h3-font-weight: 500;
--heading-h4-font-weight: 500;
--heading-h5-font-weight: 400;
--heading-h6-font-weight: 400;
--link-color: #0374B5;
--link-text-decoration: underline;
--link-text-decoration--hover: underline;
--sidebar-name-color: #0374B5;
--sidebar-nav-link-color--active: #0374B5;
--sidebar-nav-link-border-color--active: #0374B5;
--sidebar-nav-link-font-weight--active: bold;
--sidebar-nav-pagelink-background--active:
no-repeat 0px center / 5px 6px linear-gradient(225deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4.25px),
no-repeat 5px center / 5px 6px linear-gradient(135deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4.25px);
--sidebar-nav-pagelink-background--collapse:
no-repeat 2px calc(50% - 2.5px) / 6px 5px linear-gradient(45deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4px),
no-repeat 2px calc(50% + 2.5px) / 6px 5px linear-gradient(135deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4px);
--sidebar-nav-pagelink-background--loaded:
no-repeat 0px center / 5px 6px linear-gradient(225deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4.25px),
no-repeat 5px center / 5px 6px linear-gradient(135deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4.25px);
--navbar-root-margin: 0 0 0 .8em;
--navbar-root-color--active: #0374B5;
--blockquote-border-color: #0374B5;
--pagination-title-color: #0374B5;
--docsifytabs-tab-color: var(--base-color);
}
</style>
</head>
<body>
<div id="app"></div>
<script>
// Enter the URL of your own GitHub Repository in between the two quotes below
var gitLinkRepoURL = 'https://github.com/davidmalawey/openIndex';
// Customize the text for your Edit this Page on GitHub link between the two quotes below
var editThisPageLinkText = 'Edit this Page';
// Set standalone to true to permanently hide the Sidebar and Navbar
var standalone = false;
// Set ToC to true to permanently show page Table of Contents (Sidebar and Navbar must also be hidden)
var ToC = false;
// Set navbar to true to permanently override the hiding of the Navbar when displaying as standalone
var navbar = false;
// Set footer to true to permanently show the Footer ('_footer.md)
var footer = false;
// Get value from GET-parameter in URL
// @param {array} name Parameter-name
// @param {*} isTrue Return if found
// @param {*} isFalse Return if not found
// @returns {string|null} Parameter-value
function getURLParameterByName(name, isTrue = null, isFalse = null, url = window.location.href) {
let exists = false;
if (Array.isArray(name)) {
name.forEach(element => {
if (getURLParameterByName(element)) {
exists = true;
}
});
} else {
name = name.toLowerCase().replace(/[\[\]]/g, '\\$&');
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');
var results = regex.exec(url.toLowerCase());
exists = (results && results[2]) ? true : false;
}
if (exists && isTrue) {
return isTrue;
}
if (!exists && isFalse) {
return isFalse;
}
return exists;
}
// Docsify
window.$docsify = {
// GENERAL SETTINGS
// -----------------------------------------------------------------
name: 'Open Projects by David Malawey',
homepage: 'home.md',
logo: '/images/david-malawey.svg =200x200',
loadSidebar: !(getURLParameterByName(['standalone', 'embedded']) || standalone || false),
loadNavbar: !(getURLParameterByName(['standalone', 'embedded']) && !(getURLParameterByName('navbar')) || standalone && !navbar || false),
mergeNavbar: false,
externalLinkTarget: standalone ? '_top' : (getURLParameterByName(['standalone', 'embedded'], '_top', '_blank')),
loadFooter: (getURLParameterByName('footer') || footer || false),
// SIDEBAR NAVIGATION
// -----------------------------------------------------------------
auto2top: true,
maxLevel: 3,
// Set subMaxLevel to 0 to remove automatic display of page table of contents (TOC) in Sidebar
subMaxLevel: 1,
hideSidebar: (getURLParameterByName(['standalone', 'embedded']) || standalone),
// PLUGIN SETTINGS
// -----------------------------------------------------------------
pagination: {
previousText: 'PREV',
nextText: 'NEXT',
crossChapter: false,
crossChapterText: false,
},
toc: {
scope: '.markdown-section',
headings: 'h2,h3',
title: '',
},
// CUSTOM PLUGINS
// -----------------------------------------------------------------
plugins: [
function (hook, vm) {
hook.afterEach(function (html, next) {
// Invoked each time after the Markdown file is parsed.
// beforeEach and afterEach support asynchronous。
// ...
// call `next(html)` when task is done.
var htmlElement = document.createElement('div');
htmlElement.innerHTML = html;
if (getURLParameterByName(['standalone', 'embedded']) || standalone) {
// Carry any existing URL parms in links
var URLparms = '';
if (getURLParameterByName('standalone') || standalone) {
URLparms = `?standalone=true`;
}
if (getURLParameterByName('embedded')) {
URLparms = `?embedded=true`;
}
if (getURLParameterByName('hidegitlink')) {
URLparms = URLparms + `&hidegitlink=true`;
}
if (getURLParameterByName('navbar') || navbar) {
URLparms = URLparms + `&navbar=true`;
}
if (getURLParameterByName('toc') || ToC) {
URLparms = URLparms + `&toc=true`;
}
if (getURLParameterByName('footer') || footer) {
URLparms = URLparms + `&footer=true`;
}
const links = Array.from(htmlElement.querySelectorAll('a'))
for (const link of links) {
//console.log(link.getAttribute('href'));
// Find any local Markdown file links not including Docsify id anchor links
if ((link.getAttribute('href')?.match(/^#/) && (link.getAttribute('href').includes('id=')) === false)) {
// Modify each Markdown file link to include existing parms
var existingLink = link.getAttribute('href');
//console.log(existingLink);
// Update Markdown file link
var newURL = existingLink + URLparms;
//console.log("Changed:");
//console.log(newURL);
link.setAttribute('href', newURL);
//console.log(link.getAttribute('href'));
}
}
}
/* JS to change Embedly cards to light or dark theme based on system setting when using the light + dark theme (uncomment to use) */
/*
const embeds = Array.from(htmlElement.querySelectorAll('.embedly-card'))
if (!(embeds.length === 0)) {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
// dark mode
// console.log("dark");
embeds.forEach(embed => {
embed.setAttribute('data-card-theme', 'dark');
});
} else {
// light mode
// console.log("light");
embeds.forEach(embed => {
embed.setAttribute('data-card-theme', 'light');
});
}
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function (e) {
// console.log(`changed to ${e.matches ? "dark" : "light"} mode`);
// console.log(e.matches);
document.location.reload();
});
}
*/
next(htmlElement.innerHTML);
});
// hook.beforeEach(function (html) {
// if (/githubusercontent\.com/.test(vm.route.file)) {
// url = vm.route.file
// .replace('raw.githubusercontent.com', 'github.com')
// .replace(/\/master/, '/blob/master')
// } else {
// url = gitLinkRepoURL + '/blob/main/docs/' + vm.route.file
// }
// var editHtml = '[:memo:' + editThisPageLinkText + '](' + url + ' ":class=align-items-vertically")\n'
// if ((!(getURLParameterByName('hidegitlink'))) && (!!gitLinkRepoURL)) {
// return html + '<br />' + '\n\n' + editHtml
// } else {
// return html
// }
// });
// Invoked on each page load after new HTML has been appended to the DOM
hook.doneEach(function () {
var hasEmbedly = document.getElementsByClassName('embedly-card');
if (hasEmbedly.length > 0) {
// elements with class "embedly-card" exist
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://cdn.embedly.com/widgets/platform.js';
document.head.appendChild(script);
}
// Remove optional ToC area if full width header image is present
var hasImageHeader = document.getElementsByClassName('header-image-full-width');
if (hasImageHeader.length > 0) {
const elements = document.getElementsByClassName("nav");
while (elements.length > 0) elements[0].remove();
}
// Adjust left margin for optional ToC area if faded header image is present
var hasImageFade = document.getElementsByClassName('header-image-fade');
var hasNav = document.getElementsByClassName('nav');
if (hasImageFade.length > 0 && hasNav.length > 0) {
var editCSS = document.createElement('style')
editCSS.innerHTML = ".markdown-section {margin-right: 0px;}";
document.body.appendChild(editCSS);
}
// Update all iframes with source domains 'youtube.com', 'youtube-nocookie.com', 'docs.google.com' or 'onedrive.live.com' to include the default responsive CSS Markdown class `video-container-16by9`
const allIframes = Array.from(document.querySelectorAll('iframe[src*="youtube.com"], iframe[src*="youtube-nocookie.com"], iframe[src*="docs.google.com"], iframe[src*="onedrive.live.com"]'));
// Filter out iframes that are not already wrapped with a div including the classes 'video-container-16by9' and 'video-container-4by3'
const targetIframes = allIframes.filter(function (iframe) {
const parentDiv = iframe.parentNode;
return !parentDiv.matches('.video-container-16by9, .video-container-4by3');
});
// Wrap each target iframe with a div element
targetIframes.forEach(function (iframe) {
const wrapperDiv = document.createElement('div');
wrapperDiv.classList.add('video-container-16by9');
// Preserve existing classes on the iframe
iframe.classList.forEach(function (className) {
wrapperDiv.classList.add(className);
});
// Replace the iframe with the wrapper div
iframe.parentNode.replaceChild(wrapperDiv, iframe);
wrapperDiv.appendChild(iframe);
});
});
hook.ready(function () {
// Original code by @rizdaprasetya and further improved with the assistance of ChatGPT, an AI language model by OpenAI
let TARGET_QUERY = 'id';
let SCROLL_DELAY = 650; // in milliseconds
let location = window.location;
// Build the current URL without the hash
let currentUrlWithoutHash = new URL(
location.origin + location.pathname +
location.search
);
// Get the search parameters from the URL (before the hash)
let urlQueryParam = currentUrlWithoutHash.searchParams;
let isUrlHasIdQuery = urlQueryParam.has(TARGET_QUERY);
// Handle the case where the 'id' is in the fragment (hash) part
let hashParams = new URLSearchParams(location.hash.split('?')[1]); // Get the query params after `#`
let isHashHasIdQuery = hashParams.has(TARGET_QUERY);
// Check if the URL contains the 'id' query parameter in either search or hash
if (isUrlHasIdQuery || isHashHasIdQuery) {
// Get the 'id' from either search or hash
let urlId = isUrlHasIdQuery ? urlQueryParam.get(TARGET_QUERY) : hashParams.get(TARGET_QUERY);
// Delay the scrolling to ensure everything is loaded
setTimeout(function () {
try {
let targetElement = document.querySelector('#' + urlId);
if (targetElement) {
// Scroll to the element with smooth behavior
targetElement.scrollIntoView({
behavior: 'smooth', // Enables smooth scrolling
block: 'start', // Aligns the top of the element to the top of the viewport
});
}
} catch (e) {
console.log('custom scroll failed', e);
}
}, SCROLL_DELAY);
}
});
}
]
}
</script>
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/docsify.min.js"></script>
<!-- Adjust Page Margins When Standalone or Embedded -->
<script>
if (getURLParameterByName(['standalone', 'embedded']) || standalone) {
var editCSS = document.createElement('style')
editCSS.innerHTML = ".markdown-section {padding: 1rem 14px;}";
document.body.appendChild(editCSS);
}
</script>
<!-- Customizable Theme-->
<script src="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/js/docsify-themeable.min.js"></script>
<!-- Search Box Plugin -->
<!-- <script src="assets/js/search.min.js"></script> -->
<!-- Font Awesome Plugin -->
<script src="assets/js/docsify-fontawesome.min.js"></script>
<!-- Tabs Plugin-->
<script src="https://cdn.jsdelivr.net/npm/docsify-tabs@1/dist/docsify-tabs.min.js"></script>
<!-- Run External Scripts Plugin -->
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/external-script.min.js"></script>
<!-- Footnotes Plugin -->
<script src="//cdn.jsdelivr.net/npm/@sy-records/docsify-footnotes/lib/index.min.js"></script>
<!-- Footer Plugin -->
<script src="assets/js/docsify-footer.min.js"></script>
<!-- Pagination Plugin -->
<script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
<!-- Docsify Browser-level Image Lazy Loading Plugin -->
<script src="//cdn.jsdelivr.net/npm/@sy-records/docsify-loading/lib/index.min.js"></script>
<!-- Table of Contents Plugin -->
<script>
if (getURLParameterByName('toc') || ToC) {
document.write('<link rel="stylesheet" type="text/css" href="assets/css/toc.css" />');
document.write('<script src="https://unpkg.com/docsify-toc@1.1.0/dist/toc.js"><\/script>');
}
</script>
<!-- Additional Languages for Prismjs -->
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-go.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-java.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-kotlin.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markdown.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-php.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-python.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-swift.min.js"></script>
</body>
</html>