Move markdown handling to Python. Enable multi-language support for tutorial.

This commit is contained in:
Chris Wilson
2020-08-13 22:26:42 -04:00
parent 9352687d61
commit ecc599d097
5 changed files with 30 additions and 38 deletions

View File

@@ -1,17 +0,0 @@
window.addEventListener('load', () => {
new Promise((resolve, reject) => {
let ajax = new XMLHttpRequest();
ajax.onreadystatechange = () => {
if (ajax.readyState !== 4) { return; }
if (ajax.status !== 200) { reject('Unable to retrieve tutorial markdown file.') }
resolve(ajax.responseText);
};
ajax.open('GET', 'static/assets/tutorial.md', true);
ajax.send();
}).then((response) => {
let markdown = new showdown.Converter();
document.getElementById('tutorial-wrapper').innerHTML = markdown.makeHtml(response);
}).catch((error) => {
console.log(error);
});
});