Sönke Ludwig Posted in reply to Jinx



Permalink Reply

Am 24.09.2016 um 02:49 schrieb Jinx: > On Friday, 23 September 2016 at 11:47:23 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 >> pug < >> and statements are D statements, and everything that can be done at >> compile-time is done at compile-time. >> >> The library is now considered ready for (careful) production use and >> can be used with the latest pre-release versions of vibe.d (just add >> it as a dependency to your project and vibe.d will use it for >> rendering Diet templates automatically). >> >> For more information about the improvements of this library over the >> original implementation that (still) comes with vibe.d, see the >> original announcement: >> https:// forum. dlang.org/ thread/ nn4m62$14r5$1@ digital mars.com >> >> >> Source/DUB package: >> >> https:// code.dl ang.org/ packages/ diet-ng >> https:// github.com/ rejected software/ diet-ng The Diet template language is aimed at providing a way to defineprocedurally generated HTML/XML pages (or other output formats), withminimal visual noise. Syntax and feature set are heavily inspired bypug < https://pugjs.org/ >, but instead of JavaScript, all expressionsand statements are D statements, and everything that can be done atcompile-time is done at compile-time.The library is now considered ready for (careful) production use andcan be used with the latest pre-release versions of vibe.d (just addit as a dependency to your project and vibe.d will use it forrendering Diet templates automatically).For more information about the improvements of this library over theoriginal implementation that (still) comes with vibe.d, see theoriginal announcement:Source/DUB package: > > Does this basically convert the dt file in to a d file with a embedded > html output statements? > > e.g., > > dt file > html1 > d1 > html2 > d2 > > corresponding d file: > > output(html1); > d1 > output(html2); > d2 > > output outputs the html text directly and the d code is executed. Of > course, I guess some fixups need to happen on the html code for embedded > variables and such. > > Just wondering about how it is done conceptually. > > > On Friday, 23 September 2016 at 11:47:23 UTC, Sönke Ludwig wrote:Does this basically convert the dt file in to a d file with a embeddedhtml output statements?e.g.,dt filehtml1d1html2d2corresponding d file:output(html1);d1output(html2);d2output outputs the html text directly and the d code is executed. Ofcourse, I guess some fixups need to happen on the html code for embeddedvariables and such.Just wondering about how it is done conceptually. _diet_output. put("<htm l><head></ head><ti tle>Hello "); _diet_output. htmlEscape(" World"); _diet_output. put("</ title></ html>");