On Tuesday, 31 August 2021 at 14:06:32 UTC, Steven Schveighoffer
wrote:
The generation of code to output the page depends on the diet
file format (i.e. code islands are designated by the leading
`-`).
However, vibe-d does not require using the diet template system.
Does that means I can still get the code islands resolved on a,
say, plain-XHTML file ?
Or does that means that I should output HTML/XHTML from my own
functions instead ?
There are others which probably do what you want (search on
code.dlang.org), but I'm a huge fan of diet templates (I
actually prefer writing non-template html that way), so I don't
have any experience with others.
https://yuraiweb.org/ as pointed by another user seems something
I probably want to give it a try -it still relies on vibe.d but
switched to plain HTML with its own code-islands more-or-less
a-la ASP.net ... although it is still a work-in-progress.
Given how templating systems work (and how D allows strings to
be used as code using mixins), it's likely pretty trivial to
write a simple templating system to do this. All you need is an
escape protocol that is unlikely to appear in HTML, and you can
probably get away with a 10 line function that doesn't need to
actually parse the HTML.
Probably. Bit I am not a huge fan of modifying libraries for
minor functionality fixes (unless is really really necessary).
For whatever reasons I already have custom nginx builds etc etc
so I do not want to keep tracking and fixing more software -in
the end is a pain-in-the-ass.
However, I think vibe.d perhaps ought to provide a switch/flag to
enable/disable DIET constructs on source files (views) resolving
its code islands. Or more straightforward, if the requested file
already has another extension other than the one used by DIET
files just resolve the code-islands and be with it. No
client-side code changes -business as usual. Or use another
directory other than /views/ for bare files without DIET syntax.
Just thinking ... what do you think ?
-Steve