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.

index.html 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf8">
  5. <title>SuperAgent — elegant API for AJAX in Node and browsers</title>
  6. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tocbot/3.0.0/tocbot.css">
  7. <link rel="stylesheet" href="docs/style.css">
  8. </head>
  9. <body>
  10. <ul id="menu"></ul>
  11. <div id="content">
  12. </div>
  13. <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>
  14. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  15. <script>
  16. $('code').each(function(){
  17. $(this).html(highlight($(this).text()));
  18. });
  19. function highlight(js) {
  20. return js
  21. .replace(/</g, '&lt;')
  22. .replace(/>/g, '&gt;')
  23. .replace(/('.*?')/gm, '<span class="string">$1</span>')
  24. .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
  25. .replace(/(\d+)/gm, '<span class="number">$1</span>')
  26. .replace(/\bnew *(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
  27. .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>')
  28. }
  29. </script>
  30. <script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/3.0.0/tocbot.js"></script>
  31. <script>
  32. // Only use tocbot for main docs, not test docs
  33. if (document.querySelector('#superagent')) {
  34. tocbot.init({
  35. // Where to render the table of contents.
  36. tocSelector: '#menu',
  37. // Where to grab the headings to build the table of contents.
  38. contentSelector: '#content',
  39. // Which headings to grab inside of the contentSelector element.
  40. headingSelector: 'h2',
  41. smoothScroll: false
  42. });
  43. }
  44. </script>
  45. </body>
  46. </html>