CrossClj

1.0.0 docs

SourceDocs



RECENT

    co.nclk/clj-yaml

    Clojars

    May 23, 2017


    OWNER
    Tom Brennan
    United States
    tjb1982@gmail.com

    Readme

    Index of all namespaces


    The README below is fetched from the published project artifact. Some relative links may be broken.

    circleci/clj-yaml provides YAML encoding and decoding for Clojure via the snakeyaml Java library.

    CircleCI Status

    (This is a maintained fork of the original).

    Usage

    (require '[clj-yaml.core :as yaml])
    
    (yaml/generate-string
      [{:name "John Smith", :age 33}
       {:name "Mary Smith", :age 27}])
    "- {name: John Smith, age: 33}\n- {name: Mary Smith, age: 27}\n"
    
    (yaml/parse-string "
    - {name: John Smith, age: 33}
    - name: Mary Smith
      age: 27
    ")
    => ({:name "John Smith", :age 33}
        {:name "Mary Smith", :age 27})
    

    By default, keys are converted to clojure keywords. To prevent this, add :keywords false parameters to the parse-string function:

    (yaml/parse-string "
    - {name: John Smith}
    " :keywords false)
    

    Installation

    circleci/clj-yaml is available as a Maven artifact from Clojars:

    :dependencies [[circleci/clj-yaml "0.5.5"]  ...]
    

    Development

    $ git clone git://github.com/circleci/clj-yaml.git
    $ lein deps
    $ lein test
    $ lein install