Last active
March 21, 2022 16:10
-
-
Save m-bartlett/e56954102dca6cd3eb685ca005e74b4a to your computer and use it in GitHub Desktop.
Generate a markdown Table of Contents by visiting the README page of the repo and pasting this javascript into the browser developer console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copied and minified from https://gist.github.com/JamieMason/c43e7ee1d078fc63e7c0f15746845c2e | |
console.log([].map.call(document.querySelectorAll('.anchor'), function(el) {var indents = ' '.repeat(parseFloat(el.parentNode.nodeName.charAt(1)) - 1);var label = el.parentNode.innerText;var link = el.getAttribute('href');return `${indents}* [${label}](${link})`}).join('\n')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment