// noinspection JSUnresolvedVariable const {$, doAfterLoad, footer, header, nav, stringToHtml} = window.fwdekker; /** * Transforms the given (nested) entry into a list item to be displayed in HTML. * * @param entry the entry to transform * @param depth the current level of nesting * @returns {string} the HTML form of the given entry */ const unpackEntry = (entry, depth = 0) => { const subEntries = entry.entries.length === 0 ? "" : ``; return "" + `` + `${entry.name}` + subEntries + ``; }; /** * Displays the given entries on the page. * * @param entries the entries to display */ const showEntries = entries => { const toolEntries = entries.entries.find(it => it.name === "Tools").entries; const entryHtml = stringToHtml(``, "ul"); $("#listing").append(entryHtml); }; doAfterLoad(() => { $("#nav").appendChild(nav("/Tools/", showEntries)); $("#header").appendChild(header({title: "Tools", description: "An overview of tools I have created"})); $("#footer").appendChild(footer({ vcsURL: "https://git.fwdekker.com/FWDekker/tools/", version: "v%%VERSION_NUMBER%%" })); $("main").classList.remove("hidden"); });