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, '<')
|
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/jqueryui/1.12.1/jquery-ui.min.js"></script>
|
21 | <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tocify/1.9.0/javascripts/jquery.tocify.min.js"></script>
|
22 | <script>
|
23 | $('#menu').tocify({
|
24 | selectors: 'h2',
|
25 | hashGenerator: 'pretty'
|
26 | });
|
27 | </script>
|
28 | </body>
|
29 | </html>
|