56216ac160
Usage: Set 'src' attribute to <xmp> tag to include external Markdown file. Example : <xmp theme="sandstone" style="display:none;" src="lz4_Block_format.md"></xmp>
25 lines
493 B
JavaScript
25 lines
493 B
JavaScript
$(document).ready(function() {
|
|
var strapdown = function() {
|
|
var script = document.createElement('script');
|
|
script.src = "strapdown/v/0.2/strapdown.js";
|
|
document.body.appendChild(script);
|
|
};
|
|
|
|
var xmpEl = $("xmp:first");
|
|
if(xmpEl) {
|
|
var xmpSrc = xmpEl.attr("src");
|
|
if(xmpSrc) {
|
|
$.ajax({
|
|
url : xmpSrc,
|
|
dataType : "text",
|
|
success : function(data) {
|
|
xmpEl.text(data);
|
|
strapdown();
|
|
}
|
|
});
|
|
} else {
|
|
strapdown();
|
|
}
|
|
}
|
|
});
|