www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Diet template syntax highlighting / alternatives?

reply Foo Bar <email example.com> writes:
While I've always been a big fan of vibe.d, diet templates have 
never really tickled my pickle. I don't like how much different 
it is from plain HTML, and I always prefer something like EJS 
(https://ejs.co).

I was hoping that there was some sort of alternative to diet 
templates, something with more similar syntax to EJS. Are there 
any such alternatives?

If there are no alternatives, are there any sort of syntax 
highlighting plugins for vim that support diet? That would at 
least make diet a little easier to work with.

Thanks!
Mar 14 2019
next sibling parent Johannes Loher <johannesloher fg4f.de> writes:
Am 14.03.19 um 23:22 schrieb Foo Bar:
 While I've always been a big fan of vibe.d, diet templates have never
 really tickled my pickle. I don't like how much different it is from
 plain HTML, and I always prefer something like EJS (https://ejs.co).
 
 I was hoping that there was some sort of alternative to diet templates,
 something with more similar syntax to EJS. Are there any such alternatives?
 
 If there are no alternatives, are there any sort of syntax highlighting
 plugins for vim that support diet? That would at least make diet a
 little easier to work with.
 
 Thanks!
I don't really think there is a real alternative at the moment if you plan to only use D. Some other frameworks use a different template syntax, e.g. Diamond MVC , which builds on top of vibe.d (https://github.com/DiamondMVC/Diamond) or hunt-framework, which is completely independent and developed by the Chinese community (https://github.com/huntlabs/hunt-framework). If you want to stick with "plain" vibe.d, but simply want syntax highlighting for diet templates, I suggest to use Laurent Treguier's extension for VS Code (https://github.com/LaurentTreguier/diet-vscode). In my experience, it worked really well.
Mar 15 2019
prev sibling next sibling parent =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig+d outerproduct.org> writes:
Am 14.03.2019 um 23:22 schrieb Foo Bar:
 While I've always been a big fan of vibe.d, diet templates have never 
 really tickled my pickle. I don't like how much different it is from 
 plain HTML, and I always prefer something like EJS (https://ejs.co).
 
 I was hoping that there was some sort of alternative to diet templates, 
 something with more similar syntax to EJS. Are there any such alternatives?
 
 If there are no alternatives, are there any sort of syntax highlighting 
 plugins for vim that support diet? That would at least make diet a 
 little easier to work with.
 
 Thanks!
Have a look at https://code.dlang.org/packages/vayne I haven't used it myself, but I would guess that this is currently the best supported alternative. There are also some similar approaches: https://code.dlang.org/packages/mustache-d https://code.dlang.org/packages/temple The latter is probably closest to EJS, syntax-wise.
Mar 15 2019
prev sibling parent rjframe <dlang ryanjframe.com> writes:
On Thu, 14 Mar 2019 22:22:33 +0000, Foo Bar wrote:

 If there are no alternatives, are there any sort of syntax highlighting
 plugins for vim that support diet? That would at least make diet a
 little easier to work with.
Any pug syntax highlighter will work for diet; e.g., https://github.com/digitaltoad/vim-pug ftdetect: autocmd BufRead,BufNewFile *.pug,*.jade,*.diet set filetype=pug --Ryan
Mar 20 2019