sile-typesetter / casile

The CaSILE toolkit, a book publishing workflow employing SILE and other wizardry.
GNU Affero General Public License v3.0
53 stars 6 forks source link

Move CaSILE runtime configuration from makefile to YAML #57

Open alerque opened 4 years ago

alerque commented 4 years ago

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.

alerque commented 4 years ago

Or TOML? Because Rust loves it...

alerque commented 4 years ago

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).

alerque commented 3 years ago

This is needed to resolve the conundrum in #90.

alerque commented 3 years ago

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