You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tail.html 1.6KB

123456789101112131415161718192021222324252627282930313233343536
  1. </div>
  2. <a href="http://github.com/visionmedia/superagent"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub"></a>
  3. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  4. <script>
  5. $('code').each(function(){
  6. $(this).html(highlight($(this).text()));
  7. });
  8. function highlight(js) {
  9. return js
  10. .replace(/</g, '&lt;')
  11. .replace(/>/g, '&gt;')
  12. .replace(/('.*?')/gm, '<span class="string">$1</span>')
  13. .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
  14. .replace(/(\d+)/gm, '<span class="number">$1</span>')
  15. .replace(/\bnew *(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
  16. .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>')
  17. }
  18. </script>
  19. <script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/3.0.0/tocbot.js"></script>
  20. <script>
  21. // Only use tocbot for main docs, not test docs
  22. if (document.querySelector('#superagent')) {
  23. tocbot.init({
  24. // Where to render the table of contents.
  25. tocSelector: '#menu',
  26. // Where to grab the headings to build the table of contents.
  27. contentSelector: '#content',
  28. // Which headings to grab inside of the contentSelector element.
  29. headingSelector: 'h2',
  30. smoothScroll: false
  31. });
  32. }
  33. </script>
  34. </body>
  35. </html>