www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Diet-NG 1.0.0 released

reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
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 
<https://pugjs.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.

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 digitalmars.com


Source/DUB package:

https://code.dlang.org/packages/diet-ng
https://github.com/rejectedsoftware/diet-ng
Sep 23 2016
next sibling parent reply NVolcz <niklas.volcz gmail.com> writes:
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
I would like to see a html to diet converter for easy migration. (I'm working on one)
Sep 23 2016
parent =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 23.09.2016 um 22:26 schrieb NVolcz:
 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
I would like to see a html to diet converter for easy migration. (I'm working on one)
That would be great indeed, even though a HTML to Jade/pug converter (e.g. http://html2jade.org) should generally also work without issues.
Sep 25 2016
prev sibling next sibling parent reply Jinx <Jinx goole.com> writes:
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 <https://pugjs.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.

 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 digitalmars.com


 Source/DUB package:

 https://code.dlang.org/packages/diet-ng
 https://github.com/rejectedsoftware/diet-ng
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.
Sep 23 2016
parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
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 <https://pugjs.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.

 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 digitalmars.com


 Source/DUB package:

 https://code.dlang.org/packages/diet-ng
 https://github.com/rejectedsoftware/diet-ng
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.
Yeah, that's the gist of it. A real-world example with some "dynamic" content: html head -> _diet_output.put("<html><head></head><title>Hello "); _diet_output.htmlEscape("World"); _diet_output.put("</title></html>");
Sep 25 2016
parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
(small correction:)

_diet_output.put("<html><head><title>Hello ");
_diet_output.htmlEscape("World");
_diet_output.put("</title></head></html>");
Sep 26 2016
parent reply Emre Temelkuran <etemelkuran gmail.com> writes:
On Monday, 26 September 2016 at 13:00:46 UTC, Sönke Ludwig wrote:
 (small correction:)

 _diet_output.put("<html><head><title>Hello ");
 _diet_output.htmlEscape("World");
 _diet_output.put("</title></head></html>");
Sönke, I am your biggest fan, but you never reply me.
Sep 27 2016
parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 28.09.2016 um 03:28 schrieb Emre Temelkuran:
 On Monday, 26 September 2016 at 13:00:46 UTC, Sönke Ludwig wrote:
 (small correction:)

 _diet_output.put("<html><head><title>Hello ");
 _diet_output.htmlEscape("World");
 _diet_output.put("</title></head></html>");
Sönke, I am your biggest fan, but you never reply me.
Hm, definitely sorry about that! I miss a certain percentage of issues/forum messages these days because of the limited time I have left for processing them. But if you have a link, I'll try to reply ASAP!
Sep 28 2016
parent Martin Krejcirik <mk-junk i-line.cz> writes:
 Sönke, I am your biggest fan, but you never reply me.
Hm, definitely sorry about that! I miss a certain percentage of issues/forum messages these days because of the limited time I have left for processing them. But if you have a link, I'll try to reply ASAP!
Is this guy a bot ? Seems so to me.
Sep 28 2016
prev sibling next sibling parent Martin Nowak <code dawg.eu> writes:
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 <https://pugjs.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.
Great news, in particular I like safe, the new compile-time plugin, inline nested tags, and range support. Also having it idependent of vibe.d will be useful.
Sep 23 2016
prev sibling parent reply WebFreak001 <janju007 web.de> writes:
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 <https://pugjs.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.
Cool, does it also work for generating diet -> html at runtime without inline D code? Would be pretty neat to have for static pages.
Sep 24 2016
next sibling parent reply NVolcz <niklas.volcz gmail.com> writes:
On Saturday, 24 September 2016 at 13:04:01 UTC, WebFreak001 wrote:
 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 <https://pugjs.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.
Cool, does it also work for generating diet -> html at runtime without inline D code? Would be pretty neat to have for static pages.
I'm working on a small framework for that, inspired by Jekyll.
Sep 25 2016
parent =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 25.09.2016 um 09:57 schrieb NVolcz:
 On Saturday, 24 September 2016 at 13:04:01 UTC, WebFreak001 wrote:
 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 <https://pugjs.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.
Cool, does it also work for generating diet -> html at runtime without inline D code? Would be pretty neat to have for static pages.
I'm working on a small framework for that, inspired by Jekyll.
Is that based on Diet-NG? I guess it would make sense to integrate something like this (at least the basic functionality) directly into the base library. Vibe.d could then also add a switch to make this accessible (although generally the WIP "dub watch" command together with Stefans CTFE work will hopefully be the superior approach overall).
Sep 25 2016
prev sibling parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 24.09.2016 um 15:04 schrieb WebFreak001:
 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 <https://pugjs.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.
Cool, does it also work for generating diet -> html at runtime without inline D code? Would be pretty neat to have for static pages.
Not included, but that would be relatively trivial to implement by taking the diet.html module and modifying it to output HTML instead of D code. It would actually be really easy to build a Jade/pug compiler that way.
Sep 25 2016
parent Rory McGuire via Digitalmars-d-announce writes:
On Sun, Sep 25, 2016 at 10:46 AM, S=C3=B6nke Ludwig via Digitalmars-d-annou=
nce <
digitalmars-d-announce puremagic.com> wrote:

 Am 24.09.2016 um 15:04 schrieb WebFreak001:

 On Friday, 23 September 2016 at 11:47:23 UTC, S=C3=B6nke 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 <https://pugjs.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.
Cool, does it also work for generating diet -> html at runtime without inline D code? Would be pretty neat to have for static pages.
Not included, but that would be relatively trivial to implement by taking the diet.html module and modifying it to output HTML instead of D code. I=
t
 would actually be really easy to build a Jade/pug compiler that way.
If you just want to do runtime jade -> html right now you can use my Jade implementation [0]. I don't think it has any users though so your mileage may vary. Even I use Diet :) R [0] https://github.com/rjmcguire/jaded
Oct 04 2016