Closed uliska closed 5 years ago
I realized that this is not optional but a crucial possibility. Adding a configuration table can also override existing formatters.
This will be a typical means to customize templates provided by a package: A package defines a formatter tree, and the client document loads another tree to partially override formatters.
See also the referencing follow-up issue #14
Such a function must have an option deciding how to deal with name clashes. An added tree can be used as a customization (in which case formatters of the same name should be overwritten), or as an addition (when composing a macro library, in which case a warning -- or an error? -- should be triggered).
Partly obsolete through and partly discussed in #25
Currently the formatters are (only) initialized through
Templates:setup
, and while it is possible to patch additional formatters in later (like it is done to some extent with thedocstrings
functions) there should be a clean path to add formatters to an existing instance. This will for example make it possible to load config tables from various definition files for a modular composition of commands.This should be a method accepting the same structure as
setup()
. It has to be thought of how to handle the namespace. Should the namespace be automatically extended when adding new trees?