UNPKG

1.59 kBHTMLView Raw
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
9 function highlight(js) {
10 return js
11 .replace(/</g, '&lt;')
12 .replace(/>/g, '&gt;')
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 // Only use tocbot for main docs, not test docs
23 if (document.querySelector('#superagent')) {
24 tocbot.init({
25 // Where to render the table of contents.
26 tocSelector: '#menu',
27 // Where to grab the headings to build the table of contents.
28 contentSelector: '#content',
29 // Which headings to grab inside of the contentSelector element.
30 headingSelector: 'h2',
31 smoothScroll: false
32 });
33 }
34 </script>
35 </body>
36</html>