Skip to content

Instantly share code, notes, and snippets.

@said-and-done
Created September 9, 2019 14:08
Show Gist options
  • Save said-and-done/1e80df737fa6f0094a1b6ad771b833a7 to your computer and use it in GitHub Desktop.
Save said-and-done/1e80df737fa6f0094a1b6ad771b833a7 to your computer and use it in GitHub Desktop.
Github Wiki: generate table of contents from sidebar
out = '';
document.querySelectorAll('li.Box-row').forEach((t) => {
var a = t.querySelector('a');
var text = a.innerText;
var link = a.getAttribute('href');
out += `## [${text}](${link})\n`;
});
console.log(out);
copy(out);
//paste clipboard content into Home.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment