diff --git a/main.js b/main.js index 1dad1ee..1ca2d73 100644 --- a/main.js +++ b/main.js @@ -216,10 +216,14 @@ var commands = [ action: downloadnotewithsubs }, { - hint: "Download all notes (zip file)", + hint: "Download all notes (md files in zip archive)", action: downloadnotes, shortcut: "ctrl+shift+S" }, +{ + hint: "Download all notes (html files in zip archive)", + action: downloadhtmlnotes +}, { hint: "Download all notes (json file)", action: downloadnotesjson @@ -1067,6 +1071,20 @@ function downloadnotes() }); } +function downloadhtmlnotes() +{ + var zip = new JSZip(); + localdata.forEach(note => + { + zip.file(getfilename(note.title).replace(".md", ".html"), md2html(note.content)); + }); + zip.generateAsync({type:"blob"}) + .then(function(content) + { + saveAs(content, "notes-html-" + timestamp() + ".zip"); + }); +} + function headerandtext(note) { var content = note.content;