A .Net YAML library providing bindings for LibYAML
Pull request Compare This branch is even with harryw:develop.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
netyaml
yaml-0.1.4
.gitignore
LICENSE
README.md

README.md

NetYaml

NetYaml is a .Net library providing managed bindings for the LibYAML native YAML library.

Usage

The API is intended to be unobtrusive and loosely-typed.

Example Yaml.Parse usage:

string yaml =
@"---
x: 
- a
- b
y:
  f: [g,h]
  i: jk";

var doc = Yaml.Parse(yaml).First();
Console.WriteLine(doc["y"]["f"][0]); // prints 'g'

Example Yaml.Dump usage:

var doc = new YDocument(
  new YMapping(new Dictionary<YScalar, YNode> {
    {"x", new YSequence(new YScalar("a"), new YScalar("b"))},
    {"y", new YMapping(new Dictionary<YScalar, YNode> {
      {"f", new YSequence(new YScalar("g"), new YScalar("h"))},
      {"i", new YScalar("jk")}
    })},
  })
);
string yaml = Yaml.Dump(doc);
Console.WriteLine(yaml); // prints the YAML from the above parse example

Copyright

Copyright (c) 2011 Harry Wilkinson. See LICENSE for details.

LibYAML is Copyright (c) 2006 Kirill Simonov.