libyaml binding for Emacs Lisp.
- Emacs 25 or higher(configured with
--with-modules) - libyaml
Parse string and return Emacs Lisp objects.
Read YAML file and return Emacs Lisp objects.
Dump Emacs Lisp object to YAML string.
| YAML | Emacs Lisp |
|---|---|
| 123 | integer |
| 123.4 | float |
| "123" | string |
| t, On, Yes, TRUE | t : symbol |
| n, No, Off, False | nil : symbol |
| - aaa - bbb |
vector |
| name: Foo year: 19 |
hash-table |
Example
(let ((hash (make-hash-table)))
(puthash 'a 12 hash)
(puthash 'b 12 hash)
(yaml-dump hash))---
a: 12
b: 12
...
Example
(let (hash
(hash-1 (make-hash-table))
(hash-2 (make-hash-table)))
(puthash 'a 12 hash-1)
(puthash 'b 12 hash-1)
(puthash 'a 12 hash-2)
(puthash 'b 12 hash-2)
(setq hash `[,hash-1 ,hash-2])
(yaml-dump hash))---
- a: 12
b: 12
- a: 12
b: 12
...