2015-12-29 17:38:22 +00:00
# NimYAML - YAML implementation for Nim
2021-10-22 16:36:29 +00:00
![Test Status ](https://github.com/flyx/NimYAML/actions/workflows/action.yml/badge.svg )
2016-09-20 16:33:52 +00:00
2016-06-08 19:28:07 +00:00
NimYAML is a pure Nim YAML implementation without any dependencies other than
Nim's standard library. It enables you to serialize Nim objects to a YAML stream
and back. It also provides a low-level event-based API, and a document object
model which you do not want to use because serializing to native types is much
more awesome.
2015-12-29 17:38:22 +00:00
2016-06-08 19:28:07 +00:00
Documentation, examples and an online demo are available [here][1]. Releases are
available as tags in this repository and can be fetched via nimble:
nimble install yaml
2021-05-17 22:57:01 +00:00
2018-08-30 07:49:02 +00:00
## Status
2016-06-08 19:28:07 +00:00
2021-10-22 16:36:29 +00:00
The library is fairly stable, I only maintain it and will not add any features due to lack of time and interest. NimYAML passes all tests of the current YAML
test suite which makes it 100% conformant with YAML 1.2.
2018-08-30 07:49:02 +00:00
PRs for bugs are welcome. If you want to add a feature, you are free to; but be aware that I will not maintain it and am unlikely to review it in depth, so if I accept it, you will be co-maintainer.
## Features that have been planned, but will not be implemented by myself
2015-12-29 17:38:22 +00:00
* Serialization:
- Support for more standard library types
2016-06-08 19:28:07 +00:00
- Support for polymorphism
- Support for generic objects
2015-12-29 17:38:22 +00:00
2016-02-16 10:05:36 +00:00
## Developers
```bash
2020-10-04 20:18:15 +00:00
nim test # runs all tests
2016-10-09 13:05:18 +00:00
nim lexerTests # run lexer tests
nim parserTests # run parser tests (git-clones yaml-dev-kit)
2016-02-16 10:05:36 +00:00
nim serializationTests # runs serialization tests
2016-10-09 13:05:18 +00:00
nim quickstartTests # run tests for quickstart snippets from documentation
2016-02-16 10:05:36 +00:00
nim bench # runs benchmarks, requires libyaml
nim clean # guess
nim build # build a library
```
2021-05-17 22:57:01 +00:00
NimYAML supports Nim 1.4.0 and later.
Previous versions are untested.
NimYAML v0.9.1 is the last release to support Nim 0.15.x and 0.16.0.
2016-02-16 10:05:36 +00:00
2018-10-09 16:25:55 +00:00
When debugging crashes in this library, use the `d:debug` compile flag to enable printing of the internal stack traces for calls to `internalError` and `yAssert` .
2022-06-03 23:45:41 +00:00
### Web Documentation
The online documentation on [nimyaml.org ](https://nimyaml.org ), including the
testing ground, is generated via [Nix Flake][3] and easily deployable on NixOS.
Just include the NixOS module in the flake and do
```nix
services.nimyaml-webdocs.enable = true;
```
This will run the documentation server locally at `127.0.0.1:5000` . You can
change the `address` setting to make it public, but I suggest proxying via nginx
to get HTTPS.
2015-12-29 17:38:22 +00:00
## License
2016-06-08 19:28:07 +00:00
[MIT][2]
2021-10-22 16:36:29 +00:00
## Support this Project
If you like this project and want to give something back, you can check out GitHub's Sponsor button to the right. This is just an option I provide, not something I request you to do, and I will never nag about it.
2016-06-08 19:28:07 +00:00
[1]: http://flyx.github.io/NimYAML/
2017-06-30 14:34:02 +00:00
[2]: copying.txt
2022-06-03 23:45:41 +00:00
[3]: https://nixos.wiki/wiki/Flakes