Created
August 26, 2015 02:51
-
-
Save advayDev1/aa53d140ae25ae484fd3 to your computer and use it in GitHub Desktop.
Update a ToC in Markdown
This file contains 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
// To update the TOC, replace 'h3' with the level | |
// of your headings, | |
// open a debugging console on the file.md page on GitHub | |
// and execute: | |
$('article>h3').map(function(i){ | |
var txt = $(this).text(); | |
var href= $(this).find('a').attr('href'); | |
return "- [" + txt + "](" + href + ")"; | |
}).get().join('\n'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment