@kenjura/ursa 0.90.0 → 0.93.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.
- package/CHANGELOG.md +54 -0
- package/README.md +35 -0
- package/meta/templates/default-template/default.css +1574 -1323
- package/meta/templates/default-template/index.html +175 -129
- package/meta/templates/default-template/lightbox.css +225 -216
- package/meta/templates/default-template/lightbox.js +3 -0
- package/meta/templates/default-template/menu.js +9 -6
- package/meta/templates/default-template/toc-generator.js +58 -0
- package/meta/templates/default-template/widgets.js +88 -15
- package/package.json +5 -3
- package/src/dev.js +1 -1
- package/src/helper/__test__/breadcrumbs.test.js +71 -0
- package/src/helper/__test__/contentHash.test.js +114 -0
- package/src/helper/automenu.js +9 -89
- package/src/helper/breadcrumbs.js +21 -6
- package/src/helper/build/__test__/autoIndex.test.js +68 -1
- package/src/helper/build/autoIndex.js +94 -42
- package/src/helper/build/ursaMetadata.js +3 -26
- package/src/helper/contentHash.js +54 -1
- package/src/helper/menuLabels.js +136 -0
- package/src/helper/ursaVersion.js +26 -0
- package/src/jobs/generate.js +17 -3
- package/meta/default.css +0 -1206
- package/meta/menu.js +0 -898
- package/meta/sectionify.js +0 -46
package/meta/sectionify.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
2
|
-
const article = document.querySelector('article#main-content');
|
|
3
|
-
if (!article) return;
|
|
4
|
-
|
|
5
|
-
const children = Array.from(article.children);
|
|
6
|
-
let sections = [];
|
|
7
|
-
let currentSection = document.createElement('section');
|
|
8
|
-
currentSection.classList.add('sectionOuter');
|
|
9
|
-
|
|
10
|
-
for (let i = 0; i < children.length; i++) {
|
|
11
|
-
const el = children[i];
|
|
12
|
-
// Skip breadcrumb nav — it stays outside sections
|
|
13
|
-
if (el.classList && el.classList.contains('breadcrumbs')) continue;
|
|
14
|
-
if (el.tagName === 'H1' && currentSection.childNodes.length > 0) {
|
|
15
|
-
sections.push(currentSection);
|
|
16
|
-
currentSection = document.createElement('section');
|
|
17
|
-
currentSection.classList.add('sectionOuter');
|
|
18
|
-
}
|
|
19
|
-
currentSection.appendChild(el);
|
|
20
|
-
}
|
|
21
|
-
if (currentSection.childNodes.length > 0) {
|
|
22
|
-
sections.push(currentSection);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Preserve breadcrumb nav before clearing
|
|
26
|
-
const breadcrumbs = article.querySelector('.breadcrumbs');
|
|
27
|
-
|
|
28
|
-
// Remove all existing children
|
|
29
|
-
while (article.firstChild) {
|
|
30
|
-
article.removeChild(article.firstChild);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Re-insert breadcrumbs at the top, outside any section
|
|
34
|
-
if (breadcrumbs) {
|
|
35
|
-
article.appendChild(breadcrumbs);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Append new sections
|
|
39
|
-
sections.forEach(section => article.appendChild(section));
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// Optional: Add section numbers or other decorations
|
|
43
|
-
Array.from(article.querySelectorAll('section.sectionOuter')).forEach((section, index) => {
|
|
44
|
-
section.style.setProperty('--section-index', index + 1);
|
|
45
|
-
});
|
|
46
|
-
});
|