Please use toml-clj](https://github.com/tonsky/toml-clj).
clj-toml
is TOML for Clojure.
TOML is Tom's Obvious, Minimal Language.
TOML is like INI, only better (Tom Preston-Werner)
clj-toml
uses Instaparse for parsing.
Instaparse does all the heavy lifting, we're just sitting pretty.
clj-toml
support TOML v1.0.0.
Add the following line to your leiningen dependencies:
[com.github.vmfhrmfoaj/clj-toml "1.0.0-0.1"]
Require clj-toml
in your namespace header:
(ns example.core
(:require [clj-toml.core :as toml]))
REPL:
#_user> (use 'clj-toml.core)
;;=> nil
#_user> (def example "
title = \"TOML\"\n
[Foo]\n
bar=[1,2,3]")
#_user> (parse-toml example)
;;=> {"title" "TOML", "Foo" {"bar" [1 2 3]}}
#_user> (meta (parse-toml example))
;;=> {"title" #:clj-toml.core{:start 1, :end 15},
;; "Foo" {:clj-toml.core/start 17,
;; :clj-toml.core/end 22,
;; "bar" #:clj-toml.core{:start 24, :end 35}}}
#_user> (subs example 1 15)
;;=> "title = \"TOML\""
#_user> (subs example 17 22)
;;=> "[Foo]"
x.x.x-z.z < z.z: patch number
^^^^^
x.x.x: TOML version
Copyright © 2022 Jinseop Kim.