docs: add example TOML
This commit is contained in:
parent
f70be57b1d
commit
52c6e6c8f1
29
README.org
29
README.org
|
@ -51,7 +51,7 @@ To start using guile-toml: ~(use-modules (toml))~
|
|||
(("a" ("b" ("c" . "hi world"))))
|
||||
#+end_src
|
||||
|
||||
- Read a TOML file and parse it (example from [[https://toml.io][toml.io]]):
|
||||
- Read a TOML file and parse it (example[2] from [[https://toml.io][toml.io]]):
|
||||
#+begin_src scheme
|
||||
> (use-modules (toml) (ice-9 textual-ports))
|
||||
> (toml->scm (call-with-input-file "example.toml" get-string-all))
|
||||
|
@ -75,3 +75,30 @@ To start using guile-toml: ~(use-modules (toml))~
|
|||
("name" . "Tom Preston-Werner"))
|
||||
("title" . "TOML Example"))
|
||||
#+end_src
|
||||
|
||||
[2]:
|
||||
#+begin_src toml
|
||||
# This is a TOML document
|
||||
|
||||
title = "TOML Example"
|
||||
|
||||
[owner]
|
||||
name = "Tom Preston-Werner"
|
||||
dob = 1979-05-27T07:32:00-08:00
|
||||
|
||||
[database]
|
||||
enabled = true
|
||||
ports = [ 8000, 8001, 8002 ]
|
||||
data = [ ["delta", "phi"], [3.14] ]
|
||||
temp_targets = { cpu = 79.5, case = 72.0 }
|
||||
|
||||
[servers]
|
||||
|
||||
[servers.alpha]
|
||||
ip = "10.0.0.1"
|
||||
role = "frontend"
|
||||
|
||||
[servers.beta]
|
||||
ip = "10.0.0.2"
|
||||
role = "backend"
|
||||
#+end_src
|
||||
|
|
Loading…
Reference in New Issue