Not a developer? Go to MovableType.com

Documentation

A YAML Primer: Yet Another Markup Language

The Movable Type registry is expressed using a simple syntax known as YAML. Before we introduce you to YAML and give you enough of a grasp of its fundamentals to use this manual, please understand that there are many more useful and more detailed guides to YAML online if you wish to further your understanding and appreciation this alternative markup language.

About YAML

YAML was developed by engineers who need to create simple hierarchical documents, but were tired of the verbosity of XML. In fact, YAML does virtually all that XML, in its basic form, was designed to do, but does it in a way that is easier to read and faster to type. Therefore, if you have a basic understanding of XML, you will come up to speed on YAML in no time. Take a look at these two examples, one in XML and the other YAML:

XML

<?xml version="1.0">
<address>
    <first_name>Byrne</first_name>
    <last_name>Reese</last_name>
    <email>byrne@majordojo.com</email>
    <company>
        <name>Six Apart, Ltd.</name>
        <street_address>
          548 4th Street, San Francisco, CA 94107
        </street_address>
    </company>
</address>

YAML

address:
    first_name: Byrne
    last_name: Reese
    email: byrne@majordojo.com
    company:
        name: Six Apart, Ltd.
        street_address: 548 4th Street, San Francisco, CA 94107

Aaahhh, its like a breath of fresh air.

Ok, that is not entirely fair, as XML is a very powerful markup language capable of expressing extraordinarily complex data types. However, for simple structures, YAML is much simpler — which makes it the perfect syntax for Movable Type’s registry.

Author’s Note: Technically, the designers of YAML made it possible to do everything you can do in XML in YAML. However, Movable Type’s YAML parser does not support the full YAML specification - just the minimal subset to keep this simple and fast.

Back

Leave a Comment