Generate valid html for the apidoc navigation

Only `<li>` can be a direct descendant of `<ul>` tags.
This commit is contained in:
Maximilian Krög
2020-02-09 18:12:24 +01:00
parent 5d922fc53b
commit 300cc282e4
3 changed files with 14 additions and 12 deletions

View File

@@ -15,22 +15,24 @@ function getItemCssClass(type) {
}
const printList = v => { ?>
<li data-name="<?js= v.longname ?>"><?js
<li data-name="<?js= v.longname ?>"><?js
}
const printListWithStability = v => {
const cls = v.stability && v.stability !== 'stable' ? ' class="unstable"' : ''; ?>
<li data-name="<?js= v.longname ?>"<?js= cls ?>><?js
<li data-name="<?js= v.longname ?>"<?js= cls ?>><?js
}
function listContent(item, title, listItemPrinter) {
const type = title.toLowerCase();
if (item[type] && item[type].length) { ?>
<ul class="<?js= type ?> itemMembers">
<span class="subtitle"><?js= title ?></span><?js
<div class="member-list">
<span class="subtitle"><?js= title ?></span>
<ul><?js
item[type].forEach(function (v) {
listItemPrinter(v); ?><?js= self.linkto(v.longname, toShortName(v.name)) ?><?js
}); ?>
</ul><?js
}); ?>
</ul>
</div><?js
}
}
?>