Skip to content
Snippets Groups Projects
Select Git revision
  • 94de08e56932d1db42409b6fbac3c58b8c77c3be
  • master default protected
2 results

sourceembed.js

Blame
  • sourceembed.js 357 B
    
    window.initializeSourceEmbed = function(filename) {
      $("#rmd-download-source").click(function() {
        var src = $("#rmd-source-code").html();
        var a = document.createElement('a');
        a.href = "data:text/x-r-markdown;base64," + src;
        a.download = filename;
        document.body.appendChild(a);
        a.click();
        document.body.removeChild(a);
      });
    };