Skip to content

Instantly share code, notes, and snippets.

@Sjord
Last active January 5, 2022 10:15
Show Gist options
  • Save Sjord/121142fe50b6b46004e0d18a304ca903 to your computer and use it in GitHub Desktop.
Save Sjord/121142fe50b6b46004e0d18a304ca903 to your computer and use it in GitHub Desktop.
const lines = $$('.description .methodsynopsis').map(m => { return {
"name": m.querySelector('.methodname').innerText,
"params": Array.from(m.querySelectorAll('.parameter')).map(p => p.innerText)
}}).filter(info => info.params.includes("$filename")).map(info => {
let pos = info.params.indexOf("$filename");
let params = info.params.slice(0, pos + 1).map(p => p.toUpperCase());
return `${info.name}(${params.join(", ")}, ...)`;
}).join("\n");
document.body.textContent = lines;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment