ZOTI-YAML¶
ZOTI-YAML is a YAML language extension that supports describing document trees distributed across several modules. It consists of:
special keywords (e.g.,
!ref
,!attach
,!include
,!default
) that help constructing document trees with information spread across several files;a module system, i.e. a document preamble structure and a custom loader;
a CLI tool to convert ZOTI-YAML modules to regular YAML or JSON files;
an API to import the various utilities in your own project, e.g. query-like path extraction.
1module: main
2import:
3 - {module: mod1}
4 - {module: sub.mod, as: mod2}
5
6---
7
8!default
9- root:
10 - mark: DEFAULT_MARKING
11- root:
12 - name: n1
13 nodes:
14 - name: n1_n1
15 nodes:
16 - name: n1_n1_n1
17 data:
18 !attach
19 ref: !ref {path: "../../../nodes[n1_n2]/extra"}
20 - name: n1_n2
21 extra: "I am referenced by n1_n1_n1!"
22 data:
23 !attach
24 ref: !ref {module: mod1, path: "/root/node[n_who]/data"}
25 - !attach
26 ref: !ref {module: mod2, path: "/root/nodes[n1]"}
27 name: n2
28 zoti-args:
29 i-need-this: "This field is used only to pass caller argument and will be destroyed"
30 content-extra: "I will be ignored!"
31
This language extensions has been developed as a convenience frontend for the ZOTI project and its tools, but can also be used as an independent tool.