lz4/js/strapdown-hook.js
Takayuki MATSUOKA 56216ac160 Add 'include' function to strapdown
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>
2015-05-05 11:36:56 +09:00

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();
}
}
});