feat: work on displaying more complex doc structure

This commit is contained in:
Stevan Freeborn
2023-04-11 15:52:48 -05:00
parent 7739cf2958
commit 68d6dd5f59
8 changed files with 82 additions and 11 deletions
+7 -5
View File
@@ -81,11 +81,13 @@ export function loadSections(
sections: DocSection[] = []
): DocSection[] {
for (const doc of docs) {
sections.push({
title: doc.title,
copy: getCopyChild(version, doc),
example: getExampleChild(version, doc),
});
if (doc.copy && doc.example) {
sections.push({
title: doc.title,
copy: getCopyChild(version, doc),
example: getExampleChild(version, doc),
});
}
if (doc.children && doc.children.length > 0) {
loadSections(version, doc.children, sections);