Drafts Action Directory

Markdown Preview with iCloud CSS

Posted by agiletortoise, Last update 5 months ago

Read CSS file named “markdown-style.css” in the iCloud “Drafts5” folder, and use it as the style for a Markdown preview.



  • script

    // read stylesheet from file in iCloud
    var fm = FileManager.create(false);
    var css = fm.read("markdown-style.css");
    // place in template tag
    draft.setTemplateTag("css", css);
  • htmlpreview

    <!DOCTYPE html>
    <html dir="auto">
    <meta name="viewport" content="width=device-width, initial-scale=1">


  • After Success Nothing
    Notification Info
    Log Level Error


Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.