rookie_yaml 0.5.0
rookie_yaml: ^0.5.0 copied to clipboard
A highly configurable parser and dumper for YAML (and optionally json).
rookie_yaml #
Note
The package is in a "ready-for-use" state. However, until a v1.0.0 is released, the package API may have (minor) breaking changes in each minor release.
A (rookie) Dart YAML 1.2+ parser.
What's Included #
Earlier YAML versions are parsed with YAML 1.2+ grammar rules. The parser will warn you if an explicit YAML version directive which is not supported is present.
- ✅ - Supported
- 🔁 - Supported but read
Notescolumn for more context. - ❌ - Not supported. May be implemented if package users express interest/need.
YAML parser #
The package implements the full YAML 1.2+ spec. See the table below for more information and any teething issues the parser has.
Tip
For enthusiasts, the underlying DocumentParser is now exported by this package (but with guard-rails). You can build a fine-grained parser on top of the low-level internal parser functions it uses. See the external resolvers section and consider extending the CustomTriggers class.
| Feature | Secondary Features | Supported | Notes |
|---|---|---|---|
| Input |
Strings Async Input Stream Sync UTF input |
✅ ❌ ✅ |
|
| Directives |
YAML directive Global Tags Reserved |
✅ ✅ 🔁 |
|
| Tag Handles |
Primary Secondary Named |
✅ ✅ ✅ |
API for tag-handles-as-code available |
| Tags |
Local tags Verbatim tags Custom tags |
✅ ✅ ✅ |
|
| Tag Resolution |
YAML Schema External Resolvers |
✅ ✅ |
|
| Other node properties |
Anchors Aliases Recursive aliases |
✅ ✅ ❌ |
You can configure whether list and map aliases should be dereferenced (deep copied) when using the loader for built-in Dart types. Dereferencing isn't the default behaviour. |
| Nodes | _ | 🔁 |
|
YAML Dumper #
The package also exports some APIs that can dump objects back to YAML. The dumped object formatting will always match the current YAML version supported by the parser.
Start here for more information.
Documentation & Examples (Still in progress 🏗️) #
- The
docsfolder in the repository. Use the table of contents as a guide. - Visit pub guide which provides an automatic guided order for the docs above.
- The
examplefolder.
Contribution #
- See guide on how to make contributions to this repository.
- Run test suite guide and look for bugs to fix.