r4ds/rmarkdown-demos/12-website/_site/site_libs/navigation-1.1/sourceembed.js

10 lines
256 B
JavaScript

window.initializeSourceEmbed = function(filename) {
$("#rmd-download-source").click(function() {
var src = window.atob($("#rmd-source-code").html());
var blob = new Blob([src], {type: "text/x-r-markdown"});
saveAs(blob, filename);
});
};