wisplike_sustainer

joined 1 year ago
[–] wisplike_sustainer@suppo.fi 3 points 7 months ago (1 children)

So, a new not-a-markup-language, only human readable and editable, and objectively better than its predecessor? Well, it's all according to tradition. I believe YAML got its start the same way.

[–] wisplike_sustainer@suppo.fi 0 points 7 months ago (10 children)

YAML to JSON is probably doable, JSON back to YAML not so much.

There are multiple ways to mark multiline strings in YAML. Then there are anchors, like bionicjoey mentioned. Also comments, YAML has them. You'd have to have some way to retain the extra information, if you want to make the full round trip.

Here's an example:

def-db: &def-db
    # here be dragons
    login: admin
    passwd: nimda
    
prod:
    db: *def-db
    desc: |
        I'm a teapot
        short and stout

dev:
    db: 
        <<: *def-db
        passwd: pass
    desc: "I'm a teapot\nshort and stout\n"

converted to JSON looks like this

{
    "def-db": {
        "login": "admin",
        "passwd": "nimda"
    },
    "prod": {
        "db": {
            "login": "admin",
            "passwd": "nimda"
        },
        "desc": "I'm a teapot\nshort and stout\n"
    },
    "dev": {
        "db": {
            "login": "admin",
            "passwd": "pass"
        },
        "desc": "I'm a teapot\nshort and stout\n"
    }
}
[–] wisplike_sustainer@suppo.fi 1 points 1 year ago

Most probably none of those are proper IPAs. The 'I' in IPA stands for India. IPA is only half-done, if it did not travel on a sailboat around the Africa from England to India.