Markdown Preview with iCloud CSS

Posted by agiletortoise, Last update almost 6 years 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 ="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
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.