Crates.io | yaml-include |
lib.rs | yaml-include |
version | 0.7.0 |
source | src |
created_at | 2023-06-08 20:15:04.542025 |
updated_at | 2023-07-04 00:33:38.197144 |
description | A lib and a CLI for recursively parsing "!include" data in yaml files |
homepage | |
repository | https://github.com/leNEKO/yaml-include |
max_upload_size | |
id | 885691 |
size | 64,949 |
A cli tool for processing yaml with include documents through !include <path>
tag.
it kinda works with json as well see data/simple/other.json
cargo install yaml-include
yaml
(and json
) filesmarkdown
and txt
text filesbase64
encoded binary data.!circular
tagyaml-include --help
A simple cli that output to stdout recursively included data from a yaml file path
Usage: yaml-include [OPTIONS] <FILE_PATH>
Arguments:
<FILE_PATH> main yaml file path to process
Options:
-o, --output-path <OUTPUT_PATH> optional output path (output to stdout if not set)
-p, --panic-on-circular panic on circular reference (default: gracefully handle circular references with !circular tag)
-h, --help Print help
-V, --version Print version
Ex.:
yaml-include data/sample/main.yml > main_inlined.yml
Basically, turns this:
main.yml
:
data:
- !include file_a.yml
- !include file_b.yml
file_a.yml
:
something:
- this
- that
file_b.yml
:
other:
- text: !include file_c.txt
- markdown: !include file_d.md
file_c.txt
:
This is some "long" multiline
text file i don't want to edit
inline in a long yaml file
file_d.md
:
# This is some markdown data
## I don't want to edit
- inline
- in a long yaml file
Into that:
data:
- something:
- this
- that
- other:
- text: |-
This is some long multiline
text i don't want to edit
inline in a long yaml file
- markdown: |
# This is some markdown data
## I don't want to edit
- inline
- in a long yaml file
see data/sample