Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A simple Google Apps script to convert a properly formatted Google Drive Documen
- Tools > Script Manager
- Select "ConvertToMarkdown" function.
- Click Run button (First run will require you to authorize it. Authorize and run again)
- Converted doc with images attached will be emailed to you. Subject will be "[MARKDOWN_MAKER]...".
- Converted doc will be saved as `"Markdown_"+original_file_name+".md"` in your gdocs


## Interpreted formats
Expand Down
11 changes: 4 additions & 7 deletions converttomarkdown.gapps
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,10 @@ function ConvertToMarkdown() {

}

attachments.push({"fileName":DocumentApp.getActiveDocument().getName()+".md", "mimeType": "text/plain", "content": text});

MailApp.sendEmail(Session.getActiveUser().getEmail(),
"[MARKDOWN_MAKER] "+DocumentApp.getActiveDocument().getName(),
"Your converted markdown document is attached (converted from "+DocumentApp.getActiveDocument().getUrl()+")"+
"\n\nDon't know how to use the format options? See http://github.com/mangini/gdocs2md\n",
{ "attachments": attachments });
var resname = DocumentApp.getActiveDocument().getName();
var resdoc = DocumentApp.create("Markdown_"+resname+".md");
var resbody = resdoc.getBody();
resbody.setText(text);
}

function escapeHTML(text) {
Expand Down