sile-typesetter/casile

Move CaSILE runtime configuration from makefile to YAML

alerque opened this issue · 4 comments

Many projects make not need a project specific Makefile at all. Given the option to invoke CaSILE as a CLI tool instead of as a submodule or other fixed path relative to the project, it seem like some options will be better set a different way.

I'm thinking specifically of the language, layout, and output location options. We already have a project wide meta data YAML option, extending that to cover some basic settings seems to make sense to me.

This will require the rules file parsing the YAML (we already depend on yq so that should be easy), and also probably a Rust crate so the CLI can do it directly. Alternatively the Rust CLI can just read it and output the relevant values in Makefile format to be sourced before the CaSILE rules file.

Or TOML? Because Rust loves it...

As of #63 the CLI can read configuration at runtime from the ENV vars. It should be pretty easy to merge in values from a file, See config::File. TOML or YAML or JSON or whatever ... it shouldn't matter that much programmatically. I tend to gravitate towards YAML, but it might make sense to go with TOML to make it easier to differentiate between project meta data and CaSILE runtime configuration (which to this point have been kind of conflated anyway).

This is needed to resolve the conundrum in #90.

Done. Works for basic flags and strings, doesn't work yet for arrays.