Hi. As far as I know, it is difficult to arbitrarily adjust the behavior of the inner template. For example, if a fixed font size/color is set in the inner template.
With this version, #set text(fill: maroon) is called before the parent-template logic (which has #set text(fill: blue)), so the parent-template logic will take precedence and all the text will remain blue. It is also possible to use the other order:
With this version, the text input by the user (“Content” is in example) will be maroon (given that it has seen this set-rule “last”, shadowing/hiding/replacing the set rule from template.with), but the title will remain in blue – and with the current document structure there is no easy way to change the color of the title, which I think is the point you were making.
I looked at the bookly package to try to understand how it enables modularity. (Minor point: I wonder if you @maucejo considered providing a HTML build of the manual, which would be convenient from a browser. I gave up trying to browse the PDFs and went to read the Typst sources directly.)
I collected the following aspects as related to modularity:
The obvious: the main template provides plenty of options. This is good but:
it does not scale super well, and users typically want to tweak something we forgot to make an option
if I remember correctly, when we do this it is tempting for intermediate packages to define “my preferred set of overrides for these parameters”, and Typst does not have language features to make this convenient (for example: it is possible to merge dictionaries with +, but this is a shallow merge when in fact we want a deep merge also merging sub-dictionaries)
Another approach you use is to make a lot of things convenience functions, provide as many functions as possible. (Ideally the main part of the template is mostly a composition of these convenience functions, and people interested in creating a derivative can reuse these compositions and tweak them without having to copy-paste too much logic). I think that it is important, and tends to come with the experience of trying to keep things tweakable.
Actually, bookly is not necessarily the good entry point. community-cnam-thesis is better in this respect. Bookly does not aim to cover all the needs and standard Typst can be used for fine-grained tuning. When users want a feature that can be easily implemented outside bookly, I encourage them to do so.
(Regarding your question about a web documentation, I thought to create one after having written that of slydekit. But it won’t be done soon).