|
@ -5,7 +5,9 @@ $(document).ready(function() { |
|
|
function parseMd() { |
|
|
function parseMd() { |
|
|
var GITHUB = 'https://raw.githubusercontent.com/gto76/python-cheatsheet/master/README.md'; |
|
|
var GITHUB = 'https://raw.githubusercontent.com/gto76/python-cheatsheet/master/README.md'; |
|
|
jQuery.get(GITHUB, function(text) { |
|
|
jQuery.get(GITHUB, function(text) { |
|
|
|
|
|
console.log(text) |
|
|
text = removeMdToc(text); |
|
|
text = removeMdToc(text); |
|
|
|
|
|
console.log(text) |
|
|
var converter = new showdown.Converter(); |
|
|
var converter = new showdown.Converter(); |
|
|
html = converter.makeHtml(text); |
|
|
html = converter.makeHtml(text); |
|
|
aDiv = $('#main_container'); |
|
|
aDiv = $('#main_container'); |
|
@ -38,7 +40,7 @@ function insertLinks() { |
|
|
$('h2').each(function() { |
|
|
$('h2').each(function() { |
|
|
aId = $(this).attr('id'); |
|
|
aId = $(this).attr('id'); |
|
|
$(this).append('<a href="#'+aId+'" name="'+aId+'">#</a>'); |
|
|
$(this).append('<a href="#'+aId+'" name="'+aId+'">#</a>'); |
|
|
}) |
|
|
|
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function addToc() { |
|
|
function addToc() { |
|
|