www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Diamond - MVC / Template engine

reply Bauss <jj_1337 live.dk> writes:
Just finished up the base for Diamond and its initiate state with 
Github and Dub, as well the first guide on using Diamond with 
vibe.d for websites.

Diamond is a MVC / Template framework originally made for a hobby 
project, but as I developed it further I saw some potential in it 
and have now decided to make it open-source.

It can be used to write websites/webservices on-top of vibe.d 
Allowing you to easily create and run websites/webservices 
without a lot of configurations to vibe.d since it's all done 
through simple configuration files in json, as well handled 
behind the scenes within the core framework of Diamond.

Diamond however is also a template framework for views 
(Originally designed for web-views only.) and thus can be used to 
render MVC websites using its own syntax, heavily inspired by the 
ASP.NET razor syntax; not entirely though.

It's currently in its first stable alpha version (0.2.2)

For more information please view below.

Dub repository:
https://code.dlang.org/packages/diamond

Github:
https://github.com/bausshf/Diamond
May 21 2016
next sibling parent reply Chris <wendlec tcd.ie> writes:
On Saturday, 21 May 2016 at 08:20:00 UTC, Bauss wrote:
[snip]

Sounds interesting. Are you planning to add a tutorial / more 
examples?

Typo on your Github page:

"on every playform that can compile D"

playform => platform
May 21 2016
parent reply Bauss <jj_1337 live.dk> writes:
On Saturday, 21 May 2016 at 10:02:17 UTC, Chris wrote:
 On Saturday, 21 May 2016 at 08:20:00 UTC, Bauss wrote:
 [snip]

 Sounds interesting. Are you planning to add a tutorial / more 
 examples?

 Typo on your Github page:

 "on every playform that can compile D"

 playform => platform
Thank you and yes, there's a few wiki pages at the moment.
May 21 2016
parent reply Bauss <jj_1337 live.dk> writes:
On Saturday, 21 May 2016 at 11:02:41 UTC, Bauss wrote:
 On Saturday, 21 May 2016 at 10:02:17 UTC, Chris wrote:
 On Saturday, 21 May 2016 at 08:20:00 UTC, Bauss wrote:
 [snip]

 Sounds interesting. Are you planning to add a tutorial / more 
 examples?

 Typo on your Github page:

 "on every playform that can compile D"

 playform => platform
Thank you and yes, there's a few wiki pages at the moment.
Just finished stand-alone support and added a "guide" on how to use it. There are currently 3 guides on using it for websites, webservices and as stand-alone. Next thing coming up is a website for the whole thing :) This marks the last "initial" alpha version 0.2.3 The plan is to have monthly releases with stable versions.
May 21 2016
parent reply Chris <wendlec tcd.ie> writes:
On Saturday, 21 May 2016 at 19:32:58 UTC, Bauss wrote:
 On Saturday, 21 May 2016 at 11:02:41 UTC, Bauss wrote:
 On Saturday, 21 May 2016 at 10:02:17 UTC, Chris wrote:

 Thank you and yes, there's a few wiki pages at the moment.
Just finished stand-alone support and added a "guide" on how to use it. There are currently 3 guides on using it for websites, webservices and as stand-alone. Next thing coming up is a website for the whole thing :) This marks the last "initial" alpha version 0.2.3 The plan is to have monthly releases with stable versions.
Thanks for the quick guides. Typo on homepage: rewamped => revamped
May 23 2016
parent Bauss <jj_1337 live.dk> writes:
On Monday, 23 May 2016 at 11:22:38 UTC, Chris wrote:
 On Saturday, 21 May 2016 at 19:32:58 UTC, Bauss wrote:
 On Saturday, 21 May 2016 at 11:02:41 UTC, Bauss wrote:
 On Saturday, 21 May 2016 at 10:02:17 UTC, Chris wrote:

 Thank you and yes, there's a few wiki pages at the moment.
Just finished stand-alone support and added a "guide" on how to use it. There are currently 3 guides on using it for websites, webservices and as stand-alone. Next thing coming up is a website for the whole thing :) This marks the last "initial" alpha version 0.2.3 The plan is to have monthly releases with stable versions.
Thanks for the quick guides. Typo on homepage: rewamped => revamped
Thank you, it has been fixed :)
May 23 2016
prev sibling next sibling parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Saturday, 21 May 2016 at 08:20:00 UTC, Bauss wrote:
 Just finished up the base for Diamond and its initiate state 
 with Github and Dub, as well the first guide on using Diamond 
 with vibe.d for websites.
The name is taken :) https://github.com/CyberShadow/Diamond I don't mind though.
May 21 2016
parent Bauss <jj_1337 live.dk> writes:
On Saturday, 21 May 2016 at 19:46:38 UTC, Vladimir Panteleev 
wrote:
 On Saturday, 21 May 2016 at 08:20:00 UTC, Bauss wrote:
 Just finished up the base for Diamond and its initiate state 
 with Github and Dub, as well the first guide on using Diamond 
 with vibe.d for websites.
The name is taken :) https://github.com/CyberShadow/Diamond I don't mind though.
Well I didn't see it in the dub repository, so I didn't assume anyone had used the name, so didn't assume anything existed with it. I apologize for the inconvenience though.
May 21 2016
prev sibling next sibling parent reply =?UTF-8?B?THXDrXM=?= Marques <luis luismarques.eu> writes:
On Saturday, 21 May 2016 at 08:20:00 UTC, Bauss wrote:
 For more information please view below.

 Dub repository:
 https://code.dlang.org/packages/diamond

 Github:
 https://github.com/bausshf/Diamond
The dub repository seems to have a problem properly escaping your example template. Could you check on that, and if the problem is on the dub registry create a bug report there?
May 23 2016
parent Bauss <jj_1337 live.dk> writes:
On Monday, 23 May 2016 at 16:15:08 UTC, Luís Marques wrote:
 On Saturday, 21 May 2016 at 08:20:00 UTC, Bauss wrote:
 For more information please view below.

 Dub repository:
 https://code.dlang.org/packages/diamond

 Github:
 https://github.com/bausshf/Diamond
The dub repository seems to have a problem properly escaping your example template. Could you check on that, and if the problem is on the dub registry create a bug report there?
Yes, I didn't even notice that :)
May 23 2016
prev sibling parent reply Kagamin <spam here.lot> writes:
The values are injected unescaped by default?
May 24 2016
parent reply Bauss <jj_1337 live.dk> writes:
On Tuesday, 24 May 2016 at 13:09:28 UTC, Kagamin wrote:
 The values are injected unescaped by default?
Yes. To escape there is the escape function. Take a look at the comparison for the result. I'm going to figure out a syntax for escaping though, so there'll be one for both. Not sure what symbols to use though. $=value_to_escape; is probably going to be the result.
May 24 2016
parent reply Bauss <jj_1337 live.dk> writes:
On Tuesday, 24 May 2016 at 14:54:27 UTC, Bauss wrote:
 On Tuesday, 24 May 2016 at 13:09:28 UTC, Kagamin wrote:
 The values are injected unescaped by default?
Yes. To escape there is the escape function. Take a look at the comparison for the result. I'm going to figure out a syntax for escaping though, so there'll be one for both. Not sure what symbols to use though. $=value_to_escape; is probably going to be the result.
Note: If you have a better suggestion, feel free to come with one :)
May 24 2016
next sibling parent reply Bauss <jj_1337 live.dk> writes:
On Tuesday, 24 May 2016 at 14:57:03 UTC, Bauss wrote:
 On Tuesday, 24 May 2016 at 14:54:27 UTC, Bauss wrote:
 On Tuesday, 24 May 2016 at 13:09:28 UTC, Kagamin wrote:
 The values are injected unescaped by default?
Yes. To escape there is the escape function. Take a look at the comparison for the result. I'm going to figure out a syntax for escaping though, so there'll be one for both. Not sure what symbols to use though. $=value_to_escape; is probably going to be the result.
Note: If you have a better suggestion, feel free to come with one :)
No wait I forgot it already is possible. Using (value_to_escape)
May 24 2016
parent reply Bauss <jj_1337 live.dk> writes:
On Tuesday, 24 May 2016 at 15:00:34 UTC, Bauss wrote:
 On Tuesday, 24 May 2016 at 14:57:03 UTC, Bauss wrote:
 On Tuesday, 24 May 2016 at 14:54:27 UTC, Bauss wrote:
 On Tuesday, 24 May 2016 at 13:09:28 UTC, Kagamin wrote:
 The values are injected unescaped by default?
Yes. To escape there is the escape function. Take a look at the comparison for the result. I'm going to figure out a syntax for escaping though, so there'll be one for both. Not sure what symbols to use though. $=value_to_escape; is probably going to be the result.
Note: If you have a better suggestion, feel free to come with one :)
No wait I forgot it already is possible. Using (value_to_escape)
I am such a mess today and also wish there was an edit button for forum posts. (value_to_escape) will only escape text and not variables, so a syntax for an expression/variable is still up. I will go with the $= syntax for now
May 24 2016
parent Bauss <jj_1337 live.dk> writes:
On Tuesday, 24 May 2016 at 15:03:28 UTC, Bauss wrote:
 On Tuesday, 24 May 2016 at 15:00:34 UTC, Bauss wrote:
 On Tuesday, 24 May 2016 at 14:57:03 UTC, Bauss wrote:
 On Tuesday, 24 May 2016 at 14:54:27 UTC, Bauss wrote:
 On Tuesday, 24 May 2016 at 13:09:28 UTC, Kagamin wrote:
 The values are injected unescaped by default?
Yes. To escape there is the escape function. Take a look at the comparison for the result. I'm going to figure out a syntax for escaping though, so there'll be one for both. Not sure what symbols to use though. $=value_to_escape; is probably going to be the result.
Note: If you have a better suggestion, feel free to come with one :)
No wait I forgot it already is possible. Using (value_to_escape)
I am such a mess today and also wish there was an edit button for forum posts. (value_to_escape) will only escape text and not variables, so a syntax for an expression/variable is still up. I will go with the $= syntax for now
A commit has now been done with escaping for variables / expressions. Can be seen here: https://github.com/bausshf/Diamond/commit/e082d63d2a351a9e57cfc7f8bee8182711919759 It'll come in version 0.2.4
May 24 2016
prev sibling parent reply Kagamin <spam here.lot> writes:
On Tuesday, 24 May 2016 at 14:57:03 UTC, Bauss wrote:
 Note: If you have a better suggestion, feel free to come with 
 one :)
I'd say do what razor does: raw output should require extra syntax. Weren't templates created in order to not build html in code?
May 25 2016
parent Bauss <jj_1337 live.dk> writes:
On Wednesday, 25 May 2016 at 12:29:03 UTC, Kagamin wrote:
 On Tuesday, 24 May 2016 at 14:57:03 UTC, Bauss wrote:
 Note: If you have a better suggestion, feel free to come with 
 one :)
I'd say do what razor does: raw output should require extra syntax. Weren't templates created in order to not build html in code?
So you suggest to switch them around? :) =value; will become encoded and $=value; will become raw? That could work out.
May 25 2016