A Clojure library designed to parse front matter from a file.
Supported front matter formats are follwoing:
- YAML
- JSON
- EDN
Add following dependency to your profject.clj
.
(require '[frontmatter.core :as fm])
(fm/parse "foo.txt")
;=> {:frontmatter {:foo "bar"}
:body "this is body"}
- YAML front matter is separated by
---
.
---
hello: "world"
nums:
- one
- two
- three
---
this is body
- JSON front matter is separated by
;;;
.
;;;
"hello": "world",
"nums": [
"one",
"two",
"three"
]
;;;
this is body
- EDN front matter is separated by
###
.
###
:hello "world"
:nums [
"one"
"two"
"three"
]
###
this is body
Copyright (C) 2014 Masashi Iizuka (@uochan)
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.