Created — forked from guilhermechapiewski/github_wiki_toc.js

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View github_wiki_toc.js
1 2 3 4 5 6 7 8 9 10 11
$(function () {
var toc = $("<ul>").css("margin-bottom", "20px !important");
$("div.main div.wikistyle h2").each(function() {
var id = $(this).text().replace(/\s+/g, "_").replace(/[^0-9a-zA-Z_.-]/g, "")
$(this).attr("id", id)
toc.append(
$("<li>").append($("<b>").append($("<a>").attr("href", "#" + id).text($(this).text())))
)
});
$("div.wikistyle").prepend(toc).prepend($("<h2>").text("Table of Contents"));
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.