plugin.js 414 B

1234567891011121314
  1. require(["gitbook"], function(gitbook) {
  2. gitbook.events.bind("page.change", function() {
  3. // do something
  4. var pre = document.getElementsByTagName('pre'), len = pre.length;
  5. for(var i=0; i < len; i++){
  6. pre[i].className = 'prettyprint mardown';
  7. }
  8. prettyPrint();
  9. });
  10. gitbook.events.bind("exercise.submit", function() {
  11. // do something
  12. });
  13. });