myWord icon indicating copy to clipboard operation
myWord copied to clipboard

Support YAML

Open and1truong opened this issue 11 years ago • 1 comments

We write faster in YAML format, can you support this format?

and1truong avatar Feb 17 '15 06:02 and1truong

andytruong,

I've played with myword a little and if you just want a work around this'll work. Here's some myword-ready yaml.

authorname: "Elmer Fudd"
title: "Kill the Rabbit"
when: Thu, 16 Apr 2015 15:26:39 -0400
flMarkdown: true
subs:
    - |
        Your markdown here. Note that lists will render better when the items are separated by blank lines.

        - bugs

        - daffy

        - porky

Convert the yaml to json with this one liner (compliments of http://www.commandlinefu.com/commands/view/12218/convert-yaml-to-json).

python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < file.yaml > file.json

Scripting this with bash is very simple and works for me, but I bet you're thinking of a javascript based solution. yaml.org links to https://github.com/nodeca/js-yaml .

trauber avatar Apr 16 '15 19:04 trauber