Thursday, August 16, 2018, 1:19:55 PM, Dékány Dániel wrote:

[snip]
> A more interesting question is if this plugin could support the
> other approach as well, where you have one template per output file,
> and usually one shared data-model. That's the logic that FMPP
> follows for example (with some twist, like its XML file
> transformation feature works more like this plugin). Of course, FMPP
> targets a different use case than this plugin, but maybe it can do both 
> without becoming messy.
[snip]

Continuing my above thought... I think we could have 2 kind of source
sub-directories:

- "generators" (instead of "data"):
  So these are currently the <outoutFileName>.json files. Each file in
  the generator subdirectory generates an output file with similar
  name (after removing the last file extensions). Why not "data"?
  Because my idea is that we should allow FreeMarker templates here as
  well. Those aren't templates that a json file can refer to, but a
  template that will generate an output file itself. Kind of like it
  does in FMPP (see figures on
  http://fmpp.sourceforge.net/qtour.html). BTW, if there's a need, of
  course we can add support xml files there as well (which is then
  processed similarly to a json, but the data-model is created by the
  usual FreeMarker XML wrapper).

- "templates":
  Like in the current version. Used by the generator files. How the
  output generator refers to them depends on the output generator
  format (currently the only one format is a JSON object with the
  reserved "templateName" key).

We can further extend this with allowing the definition of a global
data-model that's accessible for all output generators, as Woosan
said. If we support templates as "generators", that's essential.

-- 
Thanks,
 Daniel Dekany

Reply via email to