smartdown
Version:
A library for translating, rendering and interacting with Smartdown documents. Smartdown is an extension of Markdown that provides richer media support and reactive programming capability.
20 lines (17 loc) • 597 B
JavaScript
/* global smartdownBaseURL */
let baseURL = 'https://smartdown.site/';
if (typeof smartdownBaseURL === 'string') {
baseURL = smartdownBaseURL;
}
const starterScript = baseURL + 'lib/starter.js';
const head = document.head || document.getElementsByTagName('head')[0];
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = starterScript;
script.onerror = function loadError(error) {
throw new URIError('The script ' + error.target.src + ' is not accessible.');
};
script.onload = function () {
window.smartdownStarter();
};
head.appendChild(script);