Skip to content

Instantly share code, notes, and snippets.

@felixr
Created December 10, 2020 17:10
Show Gist options
  • Save felixr/c1935e6c66fddd10aa7cc01db67bbff4 to your computer and use it in GitHub Desktop.
Save felixr/c1935e6c66fddd10aa7cc01db67bbff4 to your computer and use it in GitHub Desktop.
Generate searchIndex entries for janet docset
function dtype(t) { return t=="function" ? "Function" : (t=="macro" ? "Macro": "Builtin");}
let s = "";
for (let b of document.querySelectorAll('.binding')) {
s += `INSERT OR IGNORE INTO searchIndex(name, type, path) VALUES ("${b.firstChild.id}","${dtype(b.children[1].innerText)}","api/index.html#${b.firstChild.id}");\n`;
}
s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment