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.5.0/jquery.min.js"></script>
|
4 | <script>
|
5 | $('code').each(function(){
|
6 | $(this).html(highlight($(this).text()));
|
7 | });
|
8 |
|
9 | function highlight(js) {
|
10 | return js
|
11 | .replace(/</g, '<')
|
12 | .replace(/>/g, '>')
|
13 | .replace(/('.*?')/gm, '<span class="string">$1</span>')
|
14 | .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
|
15 | .replace(/(\d+)/gm, '<span class="number">$1</span>')
|
16 | .replace(/\bnew *(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
|
17 | .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>')
|
18 | }
|
19 | </script>
|
20 | <script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/3.0.0/tocbot.js"></script>
|
21 | <script>
|
22 |
|
23 | if (document.querySelector('#superagent')) {
|
24 | tocbot.init({
|
25 |
|
26 | tocSelector: '#menu',
|
27 |
|
28 | contentSelector: '#content',
|
29 |
|
30 | headingSelector: 'h2',
|
31 | smoothScroll: false
|
32 | });
|
33 | }
|
34 | </script>
|
35 | </body>
|
36 | </html>
|