Browse Source

Script.js cleanup

pull/23/head
Jure Šorn 6 years ago
parent
commit
3702b06a90
1 changed files with 0 additions and 20 deletions
  1. 20
      web/script.js

20
web/script.js

@ -5,9 +5,6 @@ $(document).ready(function() {
function parseMd() {
var GITHUB = 'https://raw.githubusercontent.com/gto76/python-cheatsheet/master/README.md';
jQuery.get(GITHUB, function(text) {
// console.log(text)
// text = removeMdToc(text);
// console.log(text)
var converter = new showdown.Converter();
html = converter.makeHtml(text);
aDiv = $('#main_container');
@ -20,23 +17,6 @@ function parseMd() {
});
}
function removeMdToc(text) {
var out = [];
lines = text.match(/[^\r\n]+/g);
insideContents = false;
for (line of lines) {
if (line.trim() === 'Contents') {
insideContents = true;
} else if (line.trim() === 'Main') {
insideContents = false;
}
if (!insideContents) {
out.push(line);
}
}
return out.join('\n');
}
function removeOrigToc() {
headerContents = $('#contents')
contentsList = headerContents.next()

Loading…
Cancel
Save