Giter Site home page Giter Site logo

awesome-yaml's Introduction

The design goals for YAML:

- YAML is easily readable by humans.
- YAML data is portable between programming languages.
- YAML matches the native data structures of agile languages.
- YAML has a consistent model to support generic tools.
- YAML supports one-pass processing.
- YAML is expressive and extensible.
- YAML is easy to implement and use.

Awesome YAML (Ain't Markup Language)

A collection of Awesome YAML (Ain't Markup Language) goodies for structured (meta) data in text.

Contributions welcome. Anything missing? Send in a pull request. Thanks.

Formats

"Standard" YAML

YAML HQ

"Safe" YAML, "Strict" YAML

  • strictyaml - a type-safe YAML parser that parses and validates a restricted subset of the YAML specification
    • YAML Features Removed
      • NO Implicit Typing
      • NO Direct representations of objects
      • NO Duplicate Keys Disallowed
      • NO Explicit tags
      • NO Node anchors and refs
      • NO Flow style

Nested Text - YAML Simplified, YAML Evolved

"Safer" YAML - YAML Redux

  • nestedtext.org, (github) - a human friendly data format similar to YAML but without the complexity and risk of YAML

Example:

# Contact information for our officers

president:
    name: Katheryn McDaniel
    address:
        > 138 Almond Street
        > Topeka, Kansas 20697
    phone:
        cell: 1-210-555-5297
        home: 1-210-555-8470
            # Katheryn prefers that we always call her on her cell phone.
    email: [email protected]
    additional roles:
        - board member

Articles

Tips & Gotchas

Strings with Colons (:)

When to use quotes for your strings?

If your string includes a colon (:) followed by a space you MUST quote your string. Otherwise, the colon is interpreted as a key/value separator (e.g. key: value). Example:

title: "Text Processing with Ruby: Extract Value from the Data That Surrounds You"
title: "Sinatra: Up and Running - Ruby for the Web, Simply"
title: "Using JRuby: Bringing Ruby to Java"

Note: You can quote your strings using double quotes ("") e.g. "Using JRuby: Bringing Ruby to Java" or single quotes('') e.g. 'Using JRuby: Bringing Ruby to Java'.

No Tabs (\t) for Indentation - Use Spaces, Period

Note: Always use spaces for indentation, period. Make sure no tabs (\t) have somehow ended up in your datafile leading to unexpected results.

Predefined Boolean 'n' No Value Constants - True/False, Yes/No, On/Off, ~/Null

Note: The boolean true and false constants e.g.:

true, True, TRUE
y, Y, yes, YES, YES
on, ON, ON
false, False, FALSE
n, N, no, No, NO
off, Off, OFF

will become boolean values e.g. true or false. If you want end-up with a string e.g.:

recommend: Yes       # note: will become => true (boolean)

make sure you use a quoted version e.g.:

recommend: "Yes"     # note: will become => "Yes" (string)

Note: The same holds for the no value null constants e.g.:

~
null, Null, NULL

will become => null (no value). Note: A key without a value will end-up with a null value (and not an empty string, for example). To get an empty string use "" e.g.:

key1:           # note: value will become => null (no value); same as key1: null  or key1: ~
key2: ""        # note: value will become => "" (string)

JSON

JSON is (a subset of) YAML, that is YAML is JSON but JSON is NOT YAML ;-)

Example: Use the inline style for lists (that is, JSON arrays) and hashes (that is, JSON objects) for an alternative "JSON-style" syntax:

[
  { "title": "football.db - Open Football Data",
    "url":   "https://github.com/openfootball" 
  },
  { "title": "beer.db - Open Beer, Brewery 'n' Brewpub Data",
    "url":   "https://github.com/openbeer" 
  }
]

is the same as:

- title : football.db - Open Football Data
  url   : https://github.com/openfootball
- title : beer.db - Open Beer, Brewery 'n' Brewpub Data
  url   : https://github.com/openbeer

Tools & Services

No Body Wants To Write YAML

No:
  Body:
    Wants:
      To:
        Write:
          - YAML
  • noyaml.com, (github) - a rant about the state of devops tooling / the infrastructure sector

Mandatory "No Body Wants To Write YAML" reading list:

Misc

Meta

License

The awesome list is dedicated to the public domain. Use it as you please with no restrictions whatsoever.

Questions? Comments?

Post them to the wwwmake forum. Thanks!

awesome-yaml's People

Contributors

francescobianco avatar geraldb avatar tomwright avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

awesome-yaml's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.