Action

图片输出

Last update about 6 years ago - Unlisted

文字图片输出,需要借助 Pin 的动作,请提前下载。

Steps

  • script

    // See online documentation for examples
    // https://docs.getdrafts.com/docs/actions/scripting
    
    // Process Markdown to HTML
    var mmd = MultiMarkdown.create();
    var html = mmd.render(draft.content);
    
    // Wrap raw MMD output with HTML template with styles to set base fonts.
    
    var template = `<html>
    <body>
      [[content]]
    </body>
    </html>
    `;
    
    var html = template.replace("[[content]]", html);
    
    // Place in clipboard as rich-text
    if (!app.htmlToClipboard(html)) {
    	context.fail("Error rendering rich text from HTML.");
    }
  • url

    template
    pin://textmage
    useSafari
    false
    encodeTags
    true

Options

  • After Success Default
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.