MiniYAML is a library that complements libyaml. It was created in an effort to to ease the development of C structures serializers/deserializers for the RobinHood project.
Install libyaml (either from source of using your favorite package manager).
MiniYAML was developped using libyaml >= 0.1.7
; feel free to test it with an
older version.
Download MiniYAML's sources:
git clone https://github.com/cea-hpc/miniyaml.git
cd miniyaml
Build and install with meson and ninja:
meson builddir
ninja -C builddir
sudo ninja -C builddir install
To build the API documentation, use doxygen:
# Generate a template configuration file for doxygen (Doxyfile)
doxygen -g
# Change some of the default parameeters:
doxyconfig() {
sed -i "s|\($1\s*\)=.*$|\1= ${*:2}|" Doxyfile
}
doxyconfig PROJECT_NAME MiniYAML
doxyconfig INPUT include
doxyconfig EXTRACT_ALL YES
doxyconfig EXTRACT_STATIC YES
doxyconfig ALIASES error=@exception
# Run doxygen
doxygen
There is a toy emitter and a toy parser in the examples directory. They should provide users with a good enough overview of how to use miniyaml.
$ ./builddir/examples/emitter
--- !person
"name": "test"
"age": 32
...
$ ./builddir/examples/emitter | ./builddir/examples/parser
person = {.name = test, .age = 32}