@@ -2,57 +2,24 @@ $(document).ready(function() {
2
2
parseMd ( )
3
3
} ) ;
4
4
5
- // parseMd()
6
-
7
5
function parseMd ( ) {
8
6
var GITHUB = 'https://raw.githubusercontent.com/gto76/python-cheatsheet/master/README.md'
9
7
var RAWGIT = "https://rawgit.com/gto76/python-cheatsheet/master/README.md"
10
8
jQuery . get ( GITHUB , function ( text ) {
11
9
var converter = new showdown . Converter ( )
12
- // text = '#hello, markdown!'
13
- // var converter = new showdown.Converter({extensions: ['prettify']})
14
10
html = converter . makeHtml ( text )
15
- aDiv = $ ( '#bla ' )
11
+ aDiv = $ ( '#main_container ' )
16
12
nodes = $ . parseHTML ( html )
17
13
aDiv . after ( nodes ) ;
18
- // PR.prettyPrint()
19
14
insertLinks ( )
20
- // $("code").removeClass("xml")
21
- // $.getScript("https://bost.ocks.org/mike/highlight.min.js")
22
- // hljs.configure({
23
- // languages: ['python']
24
- // })
25
- // hljs.initHighlighting();
26
-
27
- // d3.selectAll("code:not([class])").classed("javascript", 1);
28
-
29
- // d3.selectAll("code").classed("javascript", 1);
30
-
31
15
d3 . selectAll ( "code" ) . each ( function ( ) { hljs . highlightBlock ( this ) ; } ) ;
32
16
33
17
} ) ;
34
18
}
35
19
36
- // function parseMd() {
37
- // var GITHUB = 'https://raw.githubusercontent.com/gto76/python-cheatsheet/master/README.md'
38
- // var RAWGIT = "https://rawgit.com/gto76/python-cheatsheet/master/README.md"
39
- // jQuery.get(GITHUB, function(text) {
40
- // var converter = new showdown.Converter({extensions: ['prettify']})
41
- // // text = '#hello, markdown!'
42
- // html = converter.makeHtml(text)
43
- // aDiv = $('#bla')
44
- // nodes = $.parseHTML(html)
45
- // aDiv.after(nodes);
46
- // PR.prettyPrint()
47
- // insertLinks()
48
- // });
49
- // }
50
-
51
20
function insertLinks ( ) {
52
21
$ ( 'h2' ) . each ( function ( ) {
53
- // title = $(this).text()
54
22
aId = $ ( this ) . attr ( 'id' )
55
- // titleNoSpace = title.replace(" ", "-");
56
23
$ ( this ) . append ( '<a href="#' + aId + '" name="' + aId + '">#</a>' )
57
24
} )
58
25
}
0 commit comments