javascripts/hastyscribe.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
document.addEventListener('DOMContentLoaded', function(){ hljs.configure({tabReplace: ' '}); Array.prototype.forEach.call(document.querySelectorAll('.highlight pre code'), function(e){ hljs.highlightBlock(e); }); var link_to_top = '<a href="#document-top" title="Back to top">↑</a>'; Array.prototype.forEach.call(document.querySelectorAll('h2, h3, h4, h5, h6'), function(e){ e.appendChild(link_to_top); }); }) |