Jump to page: 1 2
Thread overview
Diet-NG 1.0.0 released
Sep 23, 2016
Sönke Ludwig
Sep 23, 2016
NVolcz
Sep 25, 2016
Sönke Ludwig
Sep 24, 2016
Jinx
Sep 25, 2016
Sönke Ludwig
Sep 26, 2016
Sönke Ludwig
Sep 28, 2016
Emre Temelkuran
Sep 28, 2016
Sönke Ludwig
Sep 28, 2016
Martin Krejcirik
Sep 24, 2016
Martin Nowak
Sep 24, 2016
WebFreak001
Sep 25, 2016
NVolcz
Sep 25, 2016
Sönke Ludwig
Sep 25, 2016
Sönke Ludwig
Oct 04, 2016
Rory McGuire
September 23, 2016
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
September 23, 2016
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)

September 24, 2016
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.



September 24, 2016
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.
September 24, 2016
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.
September 25, 2016
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.
September 25, 2016
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.
September 25, 2016
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
    title Hello #{"World"}

->

_diet_output.put("<html><head></head><title>Hello ");
_diet_output.htmlEscape("World");
_diet_output.put("</title></html>");
September 25, 2016
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.
September 25, 2016
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).
« First   ‹ Prev
1 2