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 |
|
20 | function highlight(js) {
|
21 | return js
|
22 | .replace(/</g, '<')
|
23 | .replace(/>/g, '>')
|
24 | .replace(/('.*?')/gm, '<span class="string">$1</span>')
|
25 | .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
|
26 | .replace(/(\d+)/gm, '<span class="number">$1</span>')
|
27 | .replace(/\bnew *(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
|
28 | .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>')
|
29 | }
|
30 | </script>
|
31 | <script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/3.0.0/tocbot.js"></script>
|
32 | <script>
|
33 |
|
34 | if (document.querySelector('#superagent')) {
|
35 | tocbot.init({
|
36 |
|
37 | tocSelector: '#menu',
|
38 |
|
39 | contentSelector: '#content',
|
40 |
|
41 | headingSelector: 'h2',
|
42 | smoothScroll: false
|
43 | });
|
44 | }
|
45 | </script>
|
46 | </body>
|
47 | </html>
|