editor.md
editor.md copied to clipboard
export PDF
Unfortunately cannot export PDF
May help somebody out there but if EditorMD is used as a component in an application using NW.js or similar then it is quite easy to implement as a toolbar button.
Code:
toolbarIconsClass : {
undo : "fa-undo",
...
"print-preview" : "fa-print"
},
lang : {
name : "en",
description : "Open source online Markdown editor.",
tocTitle : "Table of Contents",
toolbar : {
undo : "Undo(Ctrl+Z)",
...
"print-preview" : "fa-print"
},
editormd.toolbarHandlers = {
...
"print-preview" : function() {
var content = this.preview[0].outerHTML;
var printWindow = window.open('', '_blank');
// printWindow.document.write('<html><head>' + tryadonkey + '</head><body>');
printWindow.document.write('<html><head><link rel="stylesheet" type="text/css" href="../../components/resources/thirdparty/editormd/css/editormd.css"></head><body>');
printWindow.document.write(content);
printWindow.document.write('</body></html>');
printWindow.document.close();
printWindow.print();
}
}
Note: tryadonkey is CSS within <style> tags which worked OK - couldn't get the style link rel to work tho'.
var hippoeditor = editormd("hippoeditor", {
...
toolbarIcons : function() {
return ["undo", ... ,"print-preview"]
}
});