con2 / emrichen

A Template engine for YAML & JSON
MIT License
107 stars 11 forks source link

Include tag #20

Closed japsu closed 5 years ago

japsu commented 5 years ago

TODO:

Further improvement:

akx commented 5 years ago

Does it make sense to include multi-document templates?

I think

!Include
  path: ./foo.xyx
  multi: true

or

!MultiInclude ./foo.xyx

makes sense. It could expand into multiple top-level documents where supported (YAML output) or a plain list where not.

Include multiple files by glob?

Definitely makes sense. Makes it easy to do ./conf.d style things too (with the hopefully obvious requirement that the tag sorts the list of filenames before including them).

(Actually, for better composability, maybe just a !Glob tag and !Include accepting a list of filenames?)