opendevsecops-jekyll 0.1.0

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.
Files changed (90) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +1755 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +110 -0
  5. data/Rakefile +1 -0
  6. data/_includes/components/aux_nav.html +15 -0
  7. data/_includes/components/breadcrumbs.html +144 -0
  8. data/_includes/components/children_nav.html +33 -0
  9. data/_includes/components/footer.html +34 -0
  10. data/_includes/components/header.html +11 -0
  11. data/_includes/components/mermaid.html +45 -0
  12. data/_includes/components/nav.html +75 -0
  13. data/_includes/components/search_footer.html +7 -0
  14. data/_includes/components/search_header.html +9 -0
  15. data/_includes/components/sidebar.html +32 -0
  16. data/_includes/components/site_nav.html +67 -0
  17. data/_includes/css/activation.scss.liquid +332 -0
  18. data/_includes/css/callouts.scss.liquid +93 -0
  19. data/_includes/css/custom.scss.liquid +1 -0
  20. data/_includes/css/just-the-docs.scss.liquid +12 -0
  21. data/_includes/favicon.html +23 -0
  22. data/_includes/fix_linenos.html +73 -0
  23. data/_includes/footer_custom.html +3 -0
  24. data/_includes/head.html +53 -0
  25. data/_includes/head_custom.html +0 -0
  26. data/_includes/header_custom.html +0 -0
  27. data/_includes/icons/code_copy.html +15 -0
  28. data/_includes/icons/document.html +6 -0
  29. data/_includes/icons/expand.html +6 -0
  30. data/_includes/icons/external_link.html +5 -0
  31. data/_includes/icons/icons.html +13 -0
  32. data/_includes/icons/link.html +6 -0
  33. data/_includes/icons/menu.html +6 -0
  34. data/_includes/icons/search.html +6 -0
  35. data/_includes/js/custom.js +0 -0
  36. data/_includes/lunr/custom-data.json +0 -0
  37. data/_includes/lunr/custom-index.js +0 -0
  38. data/_includes/mermaid_config.js +1 -0
  39. data/_includes/nav_footer_custom.html +0 -0
  40. data/_includes/search_placeholder_custom.html +1 -0
  41. data/_includes/sorted_pages.html +109 -0
  42. data/_includes/title.html +5 -0
  43. data/_includes/toc_heading_custom.html +1 -0
  44. data/_layouts/about.html +5 -0
  45. data/_layouts/default.html +41 -0
  46. data/_layouts/home.html +5 -0
  47. data/_layouts/minimal.html +34 -0
  48. data/_layouts/page.html +5 -0
  49. data/_layouts/post.html +5 -0
  50. data/_layouts/table_wrappers.html +7 -0
  51. data/_sass/base.scss +113 -0
  52. data/_sass/buttons.scss +127 -0
  53. data/_sass/code.scss +246 -0
  54. data/_sass/color_schemes/dark.scss +18 -0
  55. data/_sass/color_schemes/legacy_light.scss +208 -0
  56. data/_sass/color_schemes/light.scss +16 -0
  57. data/_sass/content.scss +239 -0
  58. data/_sass/custom/custom.scss +1 -0
  59. data/_sass/custom/setup.scss +1 -0
  60. data/_sass/labels.scss +37 -0
  61. data/_sass/layout.scss +209 -0
  62. data/_sass/modules.scss +17 -0
  63. data/_sass/navigation.scss +235 -0
  64. data/_sass/print.scss +40 -0
  65. data/_sass/search.scss +324 -0
  66. data/_sass/skiptomain.scss +30 -0
  67. data/_sass/support/_variables.scss +117 -0
  68. data/_sass/support/mixins/_buttons.scss +29 -0
  69. data/_sass/support/mixins/_layout.scss +33 -0
  70. data/_sass/support/mixins/_typography.scss +84 -0
  71. data/_sass/support/mixins/mixins.scss +3 -0
  72. data/_sass/support/support.scss +2 -0
  73. data/_sass/tables.scss +56 -0
  74. data/_sass/typography.scss +63 -0
  75. data/_sass/utilities/_colors.scss +237 -0
  76. data/_sass/utilities/_layout.scss +101 -0
  77. data/_sass/utilities/_lists.scss +15 -0
  78. data/_sass/utilities/_spacing.scss +162 -0
  79. data/_sass/utilities/_typography.scss +85 -0
  80. data/_sass/utilities/utilities.scss +5 -0
  81. data/assets/css/just-the-docs-dark.scss +3 -0
  82. data/assets/css/just-the-docs-default.scss +8 -0
  83. data/assets/css/just-the-docs-head-nav.css +24 -0
  84. data/assets/css/just-the-docs-light.scss +3 -0
  85. data/assets/js/just-the-docs.js +616 -0
  86. data/assets/js/zzzz-search-data.json +74 -0
  87. data/bin/just-the-docs +16 -0
  88. data/favicon.ico +0 -0
  89. data/lib/tasks/search.rake +88 -0
  90. metadata +201 -0
@@ -0,0 +1,616 @@
1
+ ---
2
+ layout: null
3
+ ---
4
+ (function (jtd, undefined) {
5
+
6
+ // Event handling
7
+
8
+ jtd.addEvent = function(el, type, handler) {
9
+ if (el.attachEvent) el.attachEvent('on'+type, handler); else el.addEventListener(type, handler);
10
+ }
11
+ jtd.removeEvent = function(el, type, handler) {
12
+ if (el.detachEvent) el.detachEvent('on'+type, handler); else el.removeEventListener(type, handler);
13
+ }
14
+ jtd.onReady = function(ready) {
15
+ // in case the document is already rendered
16
+ if (document.readyState!='loading') ready();
17
+ // modern browsers
18
+ else if (document.addEventListener) document.addEventListener('DOMContentLoaded', ready);
19
+ // IE <= 8
20
+ else document.attachEvent('onreadystatechange', function(){
21
+ if (document.readyState=='complete') ready();
22
+ });
23
+ }
24
+
25
+ // Show/hide mobile menu
26
+
27
+ function initNav() {
28
+ jtd.addEvent(document, 'click', function(e){
29
+ var target = e.target;
30
+ while (target && !(target.classList && target.classList.contains('nav-list-expander'))) {
31
+ target = target.parentNode;
32
+ }
33
+ if (target) {
34
+ e.preventDefault();
35
+ target.ariaPressed = target.parentNode.classList.toggle('active');
36
+ }
37
+ });
38
+
39
+ const siteNav = document.getElementById('site-nav');
40
+ const mainHeader = document.getElementById('main-header');
41
+ const menuButton = document.getElementById('menu-button');
42
+
43
+ disableHeadStyleSheets();
44
+
45
+ jtd.addEvent(menuButton, 'click', function(e){
46
+ e.preventDefault();
47
+
48
+ if (menuButton.classList.toggle('nav-open')) {
49
+ siteNav.classList.add('nav-open');
50
+ mainHeader.classList.add('nav-open');
51
+ menuButton.ariaPressed = true;
52
+ } else {
53
+ siteNav.classList.remove('nav-open');
54
+ mainHeader.classList.remove('nav-open');
55
+ menuButton.ariaPressed = false;
56
+ }
57
+ });
58
+
59
+ {%- if site.search_enabled != false and site.search.button %}
60
+ const searchInput = document.getElementById('search-input');
61
+ const searchButton = document.getElementById('search-button');
62
+
63
+ jtd.addEvent(searchButton, 'click', function(e){
64
+ e.preventDefault();
65
+
66
+ mainHeader.classList.add('nav-open');
67
+ searchInput.focus();
68
+ });
69
+ {%- endif %}
70
+ }
71
+
72
+ // The <head> element is assumed to include the following stylesheets:
73
+ // - a <link> to /assets/css/just-the-docs-head-nav.css,
74
+ // with id 'jtd-head-nav-stylesheet'
75
+ // - a <style> containing the result of _includes/css/activation.scss.liquid.
76
+ // To avoid relying on the order of stylesheets (which can change with HTML
77
+ // compression, user-added JavaScript, and other side effects), stylesheets
78
+ // are only interacted with via ID
79
+
80
+ function disableHeadStyleSheets() {
81
+ const headNav = document.getElementById('jtd-head-nav-stylesheet');
82
+ if (headNav) {
83
+ headNav.disabled = true;
84
+ }
85
+
86
+ const activation = document.getElementById('jtd-nav-activation');
87
+ if (activation) {
88
+ activation.disabled = true;
89
+ }
90
+ }
91
+
92
+ {%- if site.search_enabled != false %}
93
+ // Site search
94
+
95
+ function initSearch() {
96
+ var request = new XMLHttpRequest();
97
+ request.open('GET', '{{ "assets/js/search-data.json" | relative_url }}', true);
98
+
99
+ request.onload = function(){
100
+ if (request.status >= 200 && request.status < 400) {
101
+ var docs = JSON.parse(request.responseText);
102
+
103
+ lunr.tokenizer.separator = {{ site.search.tokenizer_separator | default: site.search_tokenizer_separator | default: "/[\s\-/]+/" }}
104
+
105
+ var index = lunr(function(){
106
+ this.ref('id');
107
+ this.field('title', { boost: 200 });
108
+ this.field('content', { boost: 2 });
109
+ {%- if site.search.rel_url != false %}
110
+ this.field('relUrl');
111
+ {%- endif %}
112
+ this.metadataWhitelist = ['position']
113
+
114
+ for (var i in docs) {
115
+ {% include lunr/custom-index.js %}
116
+ this.add({
117
+ id: i,
118
+ title: docs[i].title,
119
+ content: docs[i].content,
120
+ {%- if site.search.rel_url != false %}
121
+ relUrl: docs[i].relUrl
122
+ {%- endif %}
123
+ });
124
+ }
125
+ });
126
+
127
+ searchLoaded(index, docs);
128
+ } else {
129
+ console.log('Error loading ajax request. Request status:' + request.status);
130
+ }
131
+ };
132
+
133
+ request.onerror = function(){
134
+ console.log('There was a connection error');
135
+ };
136
+
137
+ request.send();
138
+ }
139
+
140
+ function searchLoaded(index, docs) {
141
+ var index = index;
142
+ var docs = docs;
143
+ var searchInput = document.getElementById('search-input');
144
+ var searchResults = document.getElementById('search-results');
145
+ var mainHeader = document.getElementById('main-header');
146
+ var currentInput;
147
+ var currentSearchIndex = 0;
148
+
149
+ {%- if site.search.focus_shortcut_key %}
150
+ // add event listener on ctrl + <focus_shortcut_key> for showing the search input
151
+ jtd.addEvent(document, 'keydown', function (e) {
152
+ if ((e.ctrlKey || e.metaKey) && e.key === '{{ site.search.focus_shortcut_key }}') {
153
+ e.preventDefault();
154
+
155
+ mainHeader.classList.add('nav-open');
156
+ searchInput.focus();
157
+ }
158
+ });
159
+ {%- endif %}
160
+
161
+ function showSearch() {
162
+ document.documentElement.classList.add('search-active');
163
+ }
164
+
165
+ function hideSearch() {
166
+ document.documentElement.classList.remove('search-active');
167
+ }
168
+
169
+ function update() {
170
+ currentSearchIndex++;
171
+
172
+ var input = searchInput.value;
173
+ if (input === '') {
174
+ hideSearch();
175
+ } else {
176
+ showSearch();
177
+ // scroll search input into view, workaround for iOS Safari
178
+ window.scroll(0, -1);
179
+ setTimeout(function(){ window.scroll(0, 0); }, 0);
180
+ }
181
+ if (input === currentInput) {
182
+ return;
183
+ }
184
+ currentInput = input;
185
+ searchResults.innerHTML = '';
186
+ if (input === '') {
187
+ return;
188
+ }
189
+
190
+ var results = index.query(function (query) {
191
+ var tokens = lunr.tokenizer(input)
192
+ query.term(tokens, {
193
+ boost: 10
194
+ });
195
+ query.term(tokens, {
196
+ wildcard: lunr.Query.wildcard.TRAILING
197
+ });
198
+ });
199
+
200
+ if ((results.length == 0) && (input.length > 2)) {
201
+ var tokens = lunr.tokenizer(input).filter(function(token, i) {
202
+ return token.str.length < 20;
203
+ })
204
+ if (tokens.length > 0) {
205
+ results = index.query(function (query) {
206
+ query.term(tokens, {
207
+ editDistance: Math.round(Math.sqrt(input.length / 2 - 1))
208
+ });
209
+ });
210
+ }
211
+ }
212
+
213
+ if (results.length == 0) {
214
+ var noResultsDiv = document.createElement('div');
215
+ noResultsDiv.classList.add('search-no-result');
216
+ noResultsDiv.innerText = 'No results found';
217
+ searchResults.appendChild(noResultsDiv);
218
+
219
+ } else {
220
+ var resultsList = document.createElement('ul');
221
+ resultsList.classList.add('search-results-list');
222
+ searchResults.appendChild(resultsList);
223
+
224
+ addResults(resultsList, results, 0, 10, 100, currentSearchIndex);
225
+ }
226
+
227
+ function addResults(resultsList, results, start, batchSize, batchMillis, searchIndex) {
228
+ if (searchIndex != currentSearchIndex) {
229
+ return;
230
+ }
231
+ for (var i = start; i < (start + batchSize); i++) {
232
+ if (i == results.length) {
233
+ return;
234
+ }
235
+ addResult(resultsList, results[i]);
236
+ }
237
+ setTimeout(function() {
238
+ addResults(resultsList, results, start + batchSize, batchSize, batchMillis, searchIndex);
239
+ }, batchMillis);
240
+ }
241
+
242
+ function addResult(resultsList, result) {
243
+ var doc = docs[result.ref];
244
+
245
+ var resultsListItem = document.createElement('li');
246
+ resultsListItem.classList.add('search-results-list-item');
247
+ resultsList.appendChild(resultsListItem);
248
+
249
+ var resultLink = document.createElement('a');
250
+ resultLink.classList.add('search-result');
251
+ resultLink.setAttribute('href', doc.url);
252
+ resultsListItem.appendChild(resultLink);
253
+
254
+ var resultTitle = document.createElement('div');
255
+ resultTitle.classList.add('search-result-title');
256
+ resultLink.appendChild(resultTitle);
257
+
258
+ // note: the SVG svg-doc is only loaded as a Jekyll include if site.search_enabled is true; see _includes/icons/icons.html
259
+ var resultDoc = document.createElement('div');
260
+ resultDoc.classList.add('search-result-doc');
261
+ resultDoc.innerHTML = '<svg viewBox="0 0 24 24" class="search-result-icon"><use xlink:href="#svg-doc"></use></svg>';
262
+ resultTitle.appendChild(resultDoc);
263
+
264
+ var resultDocTitle = document.createElement('div');
265
+ resultDocTitle.classList.add('search-result-doc-title');
266
+ resultDocTitle.innerHTML = doc.doc;
267
+ resultDoc.appendChild(resultDocTitle);
268
+ var resultDocOrSection = resultDocTitle;
269
+
270
+ if (doc.doc != doc.title) {
271
+ resultDoc.classList.add('search-result-doc-parent');
272
+ var resultSection = document.createElement('div');
273
+ resultSection.classList.add('search-result-section');
274
+ resultSection.innerHTML = doc.title;
275
+ resultTitle.appendChild(resultSection);
276
+ resultDocOrSection = resultSection;
277
+ }
278
+
279
+ var metadata = result.matchData.metadata;
280
+ var titlePositions = [];
281
+ var contentPositions = [];
282
+ for (var j in metadata) {
283
+ var meta = metadata[j];
284
+ if (meta.title) {
285
+ var positions = meta.title.position;
286
+ for (var k in positions) {
287
+ titlePositions.push(positions[k]);
288
+ }
289
+ }
290
+ if (meta.content) {
291
+ var positions = meta.content.position;
292
+ for (var k in positions) {
293
+ var position = positions[k];
294
+ var previewStart = position[0];
295
+ var previewEnd = position[0] + position[1];
296
+ var ellipsesBefore = true;
297
+ var ellipsesAfter = true;
298
+ for (var k = 0; k < {{ site.search.preview_words_before | default: 5 }}; k++) {
299
+ var nextSpace = doc.content.lastIndexOf(' ', previewStart - 2);
300
+ var nextDot = doc.content.lastIndexOf('. ', previewStart - 2);
301
+ if ((nextDot >= 0) && (nextDot > nextSpace)) {
302
+ previewStart = nextDot + 1;
303
+ ellipsesBefore = false;
304
+ break;
305
+ }
306
+ if (nextSpace < 0) {
307
+ previewStart = 0;
308
+ ellipsesBefore = false;
309
+ break;
310
+ }
311
+ previewStart = nextSpace + 1;
312
+ }
313
+ for (var k = 0; k < {{ site.search.preview_words_after | default: 10 }}; k++) {
314
+ var nextSpace = doc.content.indexOf(' ', previewEnd + 1);
315
+ var nextDot = doc.content.indexOf('. ', previewEnd + 1);
316
+ if ((nextDot >= 0) && (nextDot < nextSpace)) {
317
+ previewEnd = nextDot;
318
+ ellipsesAfter = false;
319
+ break;
320
+ }
321
+ if (nextSpace < 0) {
322
+ previewEnd = doc.content.length;
323
+ ellipsesAfter = false;
324
+ break;
325
+ }
326
+ previewEnd = nextSpace;
327
+ }
328
+ contentPositions.push({
329
+ highlight: position,
330
+ previewStart: previewStart, previewEnd: previewEnd,
331
+ ellipsesBefore: ellipsesBefore, ellipsesAfter: ellipsesAfter
332
+ });
333
+ }
334
+ }
335
+ }
336
+
337
+ if (titlePositions.length > 0) {
338
+ titlePositions.sort(function(p1, p2){ return p1[0] - p2[0] });
339
+ resultDocOrSection.innerHTML = '';
340
+ addHighlightedText(resultDocOrSection, doc.title, 0, doc.title.length, titlePositions);
341
+ }
342
+
343
+ if (contentPositions.length > 0) {
344
+ contentPositions.sort(function(p1, p2){ return p1.highlight[0] - p2.highlight[0] });
345
+ var contentPosition = contentPositions[0];
346
+ var previewPosition = {
347
+ highlight: [contentPosition.highlight],
348
+ previewStart: contentPosition.previewStart, previewEnd: contentPosition.previewEnd,
349
+ ellipsesBefore: contentPosition.ellipsesBefore, ellipsesAfter: contentPosition.ellipsesAfter
350
+ };
351
+ var previewPositions = [previewPosition];
352
+ for (var j = 1; j < contentPositions.length; j++) {
353
+ contentPosition = contentPositions[j];
354
+ if (previewPosition.previewEnd < contentPosition.previewStart) {
355
+ previewPosition = {
356
+ highlight: [contentPosition.highlight],
357
+ previewStart: contentPosition.previewStart, previewEnd: contentPosition.previewEnd,
358
+ ellipsesBefore: contentPosition.ellipsesBefore, ellipsesAfter: contentPosition.ellipsesAfter
359
+ }
360
+ previewPositions.push(previewPosition);
361
+ } else {
362
+ previewPosition.highlight.push(contentPosition.highlight);
363
+ previewPosition.previewEnd = contentPosition.previewEnd;
364
+ previewPosition.ellipsesAfter = contentPosition.ellipsesAfter;
365
+ }
366
+ }
367
+
368
+ var resultPreviews = document.createElement('div');
369
+ resultPreviews.classList.add('search-result-previews');
370
+ resultLink.appendChild(resultPreviews);
371
+
372
+ var content = doc.content;
373
+ for (var j = 0; j < Math.min(previewPositions.length, {{ site.search.previews | default: 3 }}); j++) {
374
+ var position = previewPositions[j];
375
+
376
+ var resultPreview = document.createElement('div');
377
+ resultPreview.classList.add('search-result-preview');
378
+ resultPreviews.appendChild(resultPreview);
379
+
380
+ if (position.ellipsesBefore) {
381
+ resultPreview.appendChild(document.createTextNode('... '));
382
+ }
383
+ addHighlightedText(resultPreview, content, position.previewStart, position.previewEnd, position.highlight);
384
+ if (position.ellipsesAfter) {
385
+ resultPreview.appendChild(document.createTextNode(' ...'));
386
+ }
387
+ }
388
+ }
389
+
390
+ {%- if site.search.rel_url != false %}
391
+ var resultRelUrl = document.createElement('span');
392
+ resultRelUrl.classList.add('search-result-rel-url');
393
+ resultRelUrl.innerText = doc.relUrl;
394
+ resultTitle.appendChild(resultRelUrl);
395
+ {%- endif %}
396
+ }
397
+
398
+ function addHighlightedText(parent, text, start, end, positions) {
399
+ var index = start;
400
+ for (var i in positions) {
401
+ var position = positions[i];
402
+ var span = document.createElement('span');
403
+ span.innerHTML = text.substring(index, position[0]);
404
+ parent.appendChild(span);
405
+ index = position[0] + position[1];
406
+ var highlight = document.createElement('span');
407
+ highlight.classList.add('search-result-highlight');
408
+ highlight.innerHTML = text.substring(position[0], index);
409
+ parent.appendChild(highlight);
410
+ }
411
+ var span = document.createElement('span');
412
+ span.innerHTML = text.substring(index, end);
413
+ parent.appendChild(span);
414
+ }
415
+ }
416
+
417
+ jtd.addEvent(searchInput, 'focus', function(){
418
+ setTimeout(update, 0);
419
+ });
420
+
421
+ jtd.addEvent(searchInput, 'keyup', function(e){
422
+ switch (e.keyCode) {
423
+ case 27: // When esc key is pressed, hide the results and clear the field
424
+ searchInput.value = '';
425
+ break;
426
+ case 38: // arrow up
427
+ case 40: // arrow down
428
+ case 13: // enter
429
+ e.preventDefault();
430
+ return;
431
+ }
432
+ update();
433
+ });
434
+
435
+ jtd.addEvent(searchInput, 'keydown', function(e){
436
+ switch (e.keyCode) {
437
+ case 38: // arrow up
438
+ e.preventDefault();
439
+ var active = document.querySelector('.search-result.active');
440
+ if (active) {
441
+ active.classList.remove('active');
442
+ if (active.parentElement.previousSibling) {
443
+ var previous = active.parentElement.previousSibling.querySelector('.search-result');
444
+ previous.classList.add('active');
445
+ }
446
+ }
447
+ return;
448
+ case 40: // arrow down
449
+ e.preventDefault();
450
+ var active = document.querySelector('.search-result.active');
451
+ if (active) {
452
+ if (active.parentElement.nextSibling) {
453
+ var next = active.parentElement.nextSibling.querySelector('.search-result');
454
+ active.classList.remove('active');
455
+ next.classList.add('active');
456
+ }
457
+ } else {
458
+ var next = document.querySelector('.search-result');
459
+ if (next) {
460
+ next.classList.add('active');
461
+ }
462
+ }
463
+ return;
464
+ case 13: // enter
465
+ e.preventDefault();
466
+ var active = document.querySelector('.search-result.active');
467
+ if (active) {
468
+ active.click();
469
+ } else {
470
+ var first = document.querySelector('.search-result');
471
+ if (first) {
472
+ first.click();
473
+ }
474
+ }
475
+ return;
476
+ }
477
+ });
478
+
479
+ jtd.addEvent(document, 'click', function(e){
480
+ if (e.target != searchInput) {
481
+ hideSearch();
482
+ }
483
+ });
484
+ }
485
+ {%- endif %}
486
+
487
+ // Switch theme
488
+
489
+ jtd.getTheme = function() {
490
+ var cssFileHref = document.querySelector('[rel="stylesheet"]').getAttribute('href');
491
+ return cssFileHref.substring(cssFileHref.lastIndexOf('-') + 1, cssFileHref.length - 4);
492
+ }
493
+
494
+ jtd.setTheme = function(theme) {
495
+ var cssFile = document.querySelector('[rel="stylesheet"]');
496
+ cssFile.setAttribute('href', '{{ "assets/css/just-the-docs-" | relative_url }}' + theme + '.css');
497
+ }
498
+
499
+ // Note: pathname can have a trailing slash on a local jekyll server
500
+ // and not have the slash on GitHub Pages
501
+
502
+ function navLink() {
503
+ var pathname = document.location.pathname;
504
+
505
+ var navLink = document.getElementById('site-nav').querySelector('a[href="' + pathname + '"]');
506
+ if (navLink) {
507
+ return navLink;
508
+ }
509
+
510
+ // The `permalink` setting may produce navigation links whose `href` ends with `/` or `.html`.
511
+ // To find these links when `/` is omitted from or added to pathname, or `.html` is omitted:
512
+
513
+ if (pathname.endsWith('/') && pathname != '/') {
514
+ pathname = pathname.slice(0, -1);
515
+ }
516
+
517
+ if (pathname != '/') {
518
+ navLink = document.getElementById('site-nav').querySelector('a[href="' + pathname + '"], a[href="' + pathname + '/"], a[href="' + pathname + '.html"]');
519
+ if (navLink) {
520
+ return navLink;
521
+ }
522
+ }
523
+
524
+ return null; // avoids `undefined`
525
+ }
526
+
527
+ // Scroll site-nav to ensure the link to the current page is visible
528
+
529
+ function scrollNav() {
530
+ const targetLink = navLink();
531
+ if (targetLink) {
532
+ targetLink.scrollIntoView({ block: "center" });
533
+ targetLink.removeAttribute('href');
534
+ }
535
+ }
536
+
537
+ // Find the nav-list-link that refers to the current page
538
+ // then make it and all enclosing nav-list-item elements active.
539
+
540
+ function activateNav() {
541
+ var target = navLink();
542
+ if (target) {
543
+ target.classList.toggle('active', true);
544
+ }
545
+ while (target) {
546
+ while (target && !(target.classList && target.classList.contains('nav-list-item'))) {
547
+ target = target.parentNode;
548
+ }
549
+ if (target) {
550
+ target.classList.toggle('active', true);
551
+ target = target.parentNode;
552
+ }
553
+ }
554
+ }
555
+
556
+ // Document ready
557
+
558
+ jtd.onReady(function(){
559
+ initNav();
560
+ {%- if site.search_enabled != false %}
561
+ initSearch();
562
+ {%- endif %}
563
+ activateNav();
564
+ scrollNav();
565
+ });
566
+
567
+ // Copy button on code
568
+
569
+
570
+ {%- if site.enable_copy_code_button != false %}
571
+
572
+ jtd.onReady(function(){
573
+
574
+ if (!window.isSecureContext) {
575
+ console.log('Window does not have a secure context, therefore code clipboard copy functionality will not be available. For more details see https://web.dev/async-clipboard/#security-and-permissions');
576
+ return;
577
+ }
578
+
579
+ var codeBlocks = document.querySelectorAll('div.highlighter-rouge, div.listingblock > div.content, figure.highlight');
580
+
581
+ // note: the SVG svg-copied and svg-copy is only loaded as a Jekyll include if site.enable_copy_code_button is true; see _includes/icons/icons.html
582
+ var svgCopied = '<svg viewBox="0 0 24 24" class="copy-icon"><use xlink:href="#svg-copied"></use></svg>';
583
+ var svgCopy = '<svg viewBox="0 0 24 24" class="copy-icon"><use xlink:href="#svg-copy"></use></svg>';
584
+
585
+ codeBlocks.forEach(codeBlock => {
586
+ var copyButton = document.createElement('button');
587
+ var timeout = null;
588
+ copyButton.type = 'button';
589
+ copyButton.ariaLabel = 'Copy code to clipboard';
590
+ copyButton.innerHTML = svgCopy;
591
+ codeBlock.append(copyButton);
592
+
593
+ copyButton.addEventListener('click', function () {
594
+ if(timeout === null) {
595
+ var code = (codeBlock.querySelector('pre:not(.lineno, .highlight)') || codeBlock.querySelector('code')).innerText;
596
+ window.navigator.clipboard.writeText(code);
597
+
598
+ copyButton.innerHTML = svgCopied;
599
+
600
+ var timeoutSetting = 4000;
601
+
602
+ timeout = setTimeout(function () {
603
+ copyButton.innerHTML = svgCopy;
604
+ timeout = null;
605
+ }, timeoutSetting);
606
+ }
607
+ });
608
+ });
609
+
610
+ });
611
+
612
+ {%- endif %}
613
+
614
+ })(window.jtd = window.jtd || {});
615
+
616
+ {% include js/custom.js %}
@@ -0,0 +1,74 @@
1
+ ---
2
+ permalink: /assets/js/search-data.json
3
+ ---
4
+ {
5
+ {%- assign i = 0 -%}
6
+ {%- assign pages_array = "" | split: "" -%}
7
+ {%- assign pages_array = pages_array | push: site.html_pages -%}
8
+ {%- if site.just_the_docs.collections -%}
9
+ {%- for collection_entry in site.just_the_docs.collections -%}
10
+ {%- assign collection_key = collection_entry[0] -%}
11
+ {%- assign collection_value = collection_entry[1] -%}
12
+ {%- assign collection = site[collection_key] -%}
13
+ {%- if collection_value.search_exclude != true -%}
14
+ {%- assign pages_array = pages_array | push: collection -%}
15
+ {%- endif -%}
16
+ {%- endfor -%}
17
+ {%- endif -%}
18
+ {%- for pages in pages_array -%}
19
+ {%- for page in pages -%}
20
+ {%- if page.title and page.search_exclude != true -%}
21
+ {%- assign page_content = page.content -%}
22
+ {%- assign heading_level = site.search.heading_level | default: 2 -%}
23
+ {%- for j in (2..heading_level) -%}
24
+ {%- assign tag = '<h' | append: j -%}
25
+ {%- assign closing_tag = '</h' | append: j -%}
26
+ {%- assign page_content = page_content | replace: tag, '<h1' | replace: closing_tag, '</h1' -%}
27
+ {%- endfor -%}
28
+ {%- assign parts = page_content | split: '<h1' -%}
29
+ {%- assign title_found = false -%}
30
+ {%- for part in parts offset: 1 -%}
31
+ {%- assign titleAndContent = part | split: '</h1>' -%}
32
+ {%- assign title = titleAndContent[0] | replace_first: '>', '<h1>' | split: '<h1>' -%}
33
+ {%- assign title = title[1] | strip_html -%}
34
+ {%- assign content = titleAndContent[1] -%}
35
+ {%- assign url = page.url -%}
36
+ {%- if title == page.title and parts[0] == '' -%}
37
+ {%- assign title_found = true -%}
38
+ {%- else -%}
39
+ {%- assign id = titleAndContent[0] -%}
40
+ {%- assign id = id | split: 'id="' -%}
41
+ {%- if id.size == 2 -%}
42
+ {%- assign id = id[1] -%}
43
+ {%- assign id = id | split: '"' -%}
44
+ {%- assign id = id[0] -%}
45
+ {%- capture url -%}{{ url | append: '#' | append: id }}{%- endcapture -%}
46
+ {%- endif -%}
47
+ {%- endif -%}
48
+ {%- unless i == 0 -%},{%- endunless -%}
49
+ "{{ i }}": {
50
+ "doc": {{ page.title | jsonify }},
51
+ "title": {{ title | jsonify }},
52
+ "content": {{ content | replace: '</h', ' . </h' | replace: '<hr', ' . <hr' | replace: '</p', ' . </p' | replace: '<ul', ' . <ul' | replace: '</ul', ' . </ul' | replace: '<ol', ' . <ol' | replace: '</ol', ' . </ol' | replace: '</tr', ' . </tr' | replace: '<li', ' | <li' | replace: '</li', ' | </li' | replace: '</td', ' | </td' | replace: '<td', ' | <td' | replace: '</th', ' | </th' | replace: '<th', ' | <th' | strip_html | remove: 'Table of contents' | normalize_whitespace | replace: '. . .', '.' | replace: '. .', '.' | replace: '| |', '|' | append: ' ' | jsonify }},
53
+ "url": "{{ url | relative_url }}",
54
+ {% include lunr/custom-data.json page=page %}
55
+ "relUrl": "{{ url }}"
56
+ }
57
+ {%- assign i = i | plus: 1 -%}
58
+ {%- endfor -%}
59
+ {%- unless title_found -%}
60
+ {%- unless i == 0 -%},{%- endunless -%}
61
+ "{{ i }}": {
62
+ "doc": {{ page.title | jsonify }},
63
+ "title": {{ page.title | jsonify }},
64
+ "content": {{ parts[0] | replace: '</h', ' . </h' | replace: '<hr', ' . <hr' | replace: '</p', ' . </p' | replace: '<ul', ' . <ul' | replace: '</ul', ' . </ul' | replace: '<ol', ' . <ol' | replace: '</ol', ' . </ol' | replace: '</tr', ' . </tr' | replace: '<li', ' | <li' | replace: '</li', ' | </li' | replace: '</td', ' | </td' | replace: '<td', ' | <td' | replace: '</th', ' | </th' | replace: '<th', ' | <th' | strip_html | remove: 'Table of contents' | normalize_whitespace | replace: '. . .', '.' | replace: '. .', '.' | replace: '| |', '|' | append: ' ' | jsonify }},
65
+ "url": "{{ page.url | relative_url }}",
66
+ {% include lunr/custom-data.json page=page %}
67
+ "relUrl": "{{ page.url }}"
68
+ }
69
+ {%- assign i = i | plus: 1 -%}
70
+ {%- endunless -%}
71
+ {%- endif -%}
72
+ {%- endfor -%}
73
+ {%- endfor %}
74
+ }