I'm gathering the data for putting together a public training video for creating a nim web service, which will use Jester for it's routing DSL.
There are, as far as I can tell, three different general ways of generating the final html. The video will mention all three, as they are all legit, but then will plunge into the "recommended" way for the bulk of the training.
pros:
- easy to show and explain (I suspect; I need to do more research.)
cons:
- IMO, does not scale well (in human, non-technical terms) when developing a large and complex web site, esp when integrated with various other non-nim javascript components, etc.
- Design teams with coders and non-coders mixed together will be hampered by it.
pros:
- Many of the examples show this technique.
- Should be technically fast as now the templating is hard-coded into the app at compile-time.
cons:
- Design teams with coders and non-coders mixed together will be hampered by it.
- Two places to add code for a single page: one macro template and one route section.
pros:
- easier for the non-coding designers to collaborate on the .html templates.
- simpler storage of pages in SQL or NoSQL db
- more people are familiar with these types of templates.
cons:
- storing pages externally has some security risk (though one could hard code the template string into code as well.)
- not many nim examples of this in the wild that I've seen
- less powerful than proc templates
I'm leaning towards using moustachu as the primary method.
But, I thought I might ask the community what their experiences and opinions are. Thoughts?
refs:
@Hlaaftana, when I said "code macro template system" I should have called it "stdtmpl source code filter". I'm still getting used to Nim grammar. :)
That is, by far, the most common method I've seen for generating the HTML.