Browse Source

Toc test

pull/28/head
Jure Šorn 6 years ago
parent
commit
20a7e555a5
1 changed files with 9 additions and 0 deletions
  1. 9
      web/script.js

9
web/script.js

@ -12,6 +12,7 @@ function parseMd() {
aDiv.after(nodes);
insertLinks()
d3.selectAll("code").each(function() { hljs.highlightBlock(this); });
addToc()
});
}
@ -21,3 +22,11 @@ function insertLinks() {
$(this).append('<a href="#'+aId+'" name="'+aId+'">#</a>')
})
}
function addToc() {
headerMain = $('#main')
nodes = $.parseHTML(TOC)
headerMain.before(nodes)
}
var TOC = '<h2 id="toc">Contents<a href="#toc" name="toc">#</a></h2>'
Loading…
Cancel
Save