New Diet template engine almost complete, ready for comments

Rory McGuire via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Mon Jul 25 22:45:13 PDT 2016


On Tue, Jul 26, 2016 at 5:22 AM, Puming via Digitalmars-d-announce <
digitalmars-d-announce at puremagic.com> wrote:

> On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote:
>
>> The Diet template language is aimed at providing a way to define
>> procedurally generated HTML/XML pages (or other output formats), with
>> minimal visual noise. Syntax and feature set are heavily inspired by Jade <
>> http://jade-lang.org/>, but instead of JavaScript, all expressions and
>> statements are D statements, and everything that can be done at
>> compile-time is done at compile-time.
>>
>> [...]
>>
>
> A feature I want the most for Diet is the ability to parse Diet templates
> at RUNTIME instead of compile time with a switch, similar to Regex/CtRegex.
>
> In this way one can do quick turnarounds in dev mode, tweaking little
> corners of the pages, and then when a page is finished, it can be switched
> to compile mode for faster render time.
>
> Do you think this is feasible?
>

Hi Puming,

You could use some sort of dialect of JS that is close to D, and then alter
the diet template engine so that is doesn't evaluate the code sections with
some sort of CT switch.
Or you could use my Jaded templates which is basically the same but runs at
compile time or runtime (at runtime you would again have to use a language
with an interpreter.)

I think if you took, vibe.d/diet-ng + arsd/jsvar as your compile time
stack, you could find a common denominator so that you could use (node.js +
webpack + pug) to do the fast (live) edits of the templates.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20160726/59a4472c/attachment.html>


More information about the Digitalmars-d-announce mailing list