all repos — hastyscribe @ b388098916e6f848dbaad9ef3b816e1591caac56

A professional markdown compiler.

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">&#8593</a>';

  Array.prototype.forEach.call(document.querySelectorAll('h2, h3, h4, h5, h6'), function(e){
    e.appendChild(link_to_top);
  });

})