Skip to content

Commit 26396d0

Browse files
committed
docs: Improved tree
1 parent 35f52bd commit 26396d0

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

internal/documentation/.vitepress/config.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,38 @@ function guide() {
323323
}
324324

325325
tree.items = tree.items[0].items; // Display items inside @ui5 as root
326+
327+
const moveIndex = [];
328+
329+
for (let index = 0; index < tree.items.length; index++) {
330+
const treeItem = tree.items[index];
331+
if (!treeItem.link) treeItem.text = "@ui5/" + treeItem.text;
332+
333+
if (treeItem.link) {
334+
let to;
335+
for (let index2 = 0; index2 < tree.items.length; index2++) {
336+
const item = tree.items[index2];
337+
console.log(item, !item.link, item.text, treeItem.text.replace("@ui5/", ""))
338+
if (!item.link && item.text.replace("@ui5/", "") === treeItem.text.replace("@ui5/", "")) {
339+
to = index2;
340+
break;
341+
}
342+
}
343+
344+
moveIndex.push({
345+
from: index,
346+
to: to
347+
});
348+
}
349+
}
350+
351+
for (const moveItem of moveIndex) {
352+
const item = tree.items[moveItem.from];
353+
item.text = "main";
354+
tree.items[moveItem.to].items.push(item);
355+
delete tree.items[moveItem.from];
356+
}
357+
326358
return tree;
327359
})()
328360
];

internal/documentation/.vitepress/theme/custom.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535

3636
/* Makes the page wider for the api docs */
3737
--vp-layout-max-width: 80%;
38+
39+
/* Makes the sidebar wider */
40+
--vp-sidebar-width: 300px;
3841
}
3942

4043
.dark {
@@ -321,3 +324,7 @@ li .learn-more {
321324
.jsdoc-object + .header-anchor {
322325
padding: 15px;
323326
}
327+
328+
.VPSidebarItem p {
329+
overflow-wrap: anywhere !important;
330+
}

0 commit comments

Comments
 (0)