// This file is only loaded in tridacyl's help pages import * as config from "./config" /** Creates the element that should contain alias information */ function initTridactylAliases(elem: HTMLElement) { let aliasNode = elem.getElementsByClassName("TridactylAliases")[0] // If the node already exists if (aliasNode) { // Empty it Array.from(aliasNode.children) .filter(e => e.tagName == "LI") .forEach(e => e.parentNode.removeChild(e)) } else { // Otherwise, create it aliasNode = document.createElement("ul") aliasNode.className = "TridactylAliases" aliasNode.textContent = "Aliases: " elem.insertBefore(aliasNode, elem.children[2]) } return aliasNode } /** Returns an object that maps excmd names to excmd documentation element */ function getCommandElements() { return Array.from( document.querySelectorAll("section.tsd-panel-group:nth-child(3) h3"), ).reduce((all, elem) => { all[elem.textContent] = elem.parentElement return all }, {}) } /** Updates the doc with aliases fetched from the config */ async function setCommandAliases() { let commandElems = getCommandElements() // We're ignoring composite because it combines multiple excmds delete commandElems["composite"] // Initialize or reset the