GitXplorerGitXplorer
s

emacs-libyaml

public
27 stars
5 forks
2 issues

Commits

List of commits on branch master.
Verified
d735621d3efd1043b26580f24053bb81c65bc453

Merge pull request #8 from syohex/support-list

ssyohex committed a year ago
Verified
524a4e1329834f986823105f6523b75869a95eb1

Add test

ssyohex committed a year ago
Verified
a5ba056dc59bb4c63cd0a6beb7ae2c845db77788

Support list

ssyohex committed a year ago
Verified
3834a36446114e86721d3f364ba86f02d15b289f

Merge pull request #6 from rdrg109/master

ssyohex committed a year ago
Unverified
3d99e6c15d288407d35f2b7982982ad78e2456ad

add examples for yaml-dump

committed a year ago
Verified
961e0d8b9ef47464c049e07be7fcefd3903f8cbc

Enable lexical binding

ssyohex committed 3 years ago

README

The README file for this repository.

libyaml.el

libyaml binding for Emacs Lisp.

Requirements

  • Emacs 25 or higher(configured with --with-modules)
  • libyaml

Interfaces

(yaml-read-from-string string)

Parse string and return Emacs Lisp objects.

(yaml-read-file file)

Read YAML file and return Emacs Lisp objects.

(yaml-dump obj)

Dump Emacs Lisp object to YAML string.

Conversion Rule

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

Examples

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
...