Re: [Cppcms-users] razor like syntax for templates
Brought to you by:
artyom-beilis
|
From: Marcel H. <ke...@co...> - 2013-05-20 10:12:43
|
On 20.05.2013 07:48, Lee Elenbaas wrote:
> Thanks Artyom,
>
> Marcel when you say razor like template system - are you talking about
> building the templates differently - so that the end result CPP will
> be compatible with the skin system, but that templates needs to be
> restructured to the new system?
I said (like the title does) razor like syntax, not razor like template
system ;)
> or do you see the same existing <% ... %> code structure converted to
> something more readable like the @ prefix?
I first thought so, but see below.
> if you think on the second approach - it will be much faster, i would
> base it on the existing cppcms_tmpl_cc script, but the end result will
> not feel razor IMO since you will not be able to use C++ language
> constructs freely inside the page
I tried this. I replaced all the regex pattern with a simple @ and it
works, but it's still not what I want. This is because of you have still
to write
@if
...
@endif
and this sucks! Really. So in fact I'd like to write the cppcms_tmpl_cc
new and make that the thing I want. But let's see what I can do in the
next few weeks.
> If you think about the first - i suggest do it from scratch, and
> generate cpp (and perhaps h files) from the template
> file independently of the cppcms_tmpl_cc - also adopt some limitation
> on the generated cpp code that will make your life easier (like each
> file have only one implicit template in it - or that @section "name"{
> ... } will define another template, but have it follow a predefined
> signature), and i would also adopt a separate extension like cpphtml
> to follow the razor convention for c# and vb
Just to clarify. I will not convert the whole razor c# language to
cppcms_tmpl, because this is too big for me (, now). I will create a
basic template for using if-statements, for/while loops and variables.
I will orientate myself to the existing commands [0]. If you don't like
it, feel free to write what has to be improved or changed regarding to
the currhttp://cppcms.com/wikipp/en/page/cppcms_1x_templates_comment
standard.
> i do not have the time to pick up this project on my own right now -
> but if you say what direction you are going, i'll try and help
Me neither. I study in the 4th semester and it's not easy as some of you
might know. And that has more priority than this. Sorry about that, but
whenever I have some time, I will spend some of it.
Maybe I will setup a git repo for this in the next days, so you can see
the actual development and say: "Stop! that's crap". and put your
patches to it. I would really appreciate that.
Regards
Marcel
[0] http://cppcms.com/wikipp/en/page/cppcms_1x_templates_comm
Oh by the way, Artyom.... why not migrating to git? Git has a nice
feature for this ;) and of course it's 1000x better than svn.
https://www.youtube.com/watch?v=4XpnKHJAok8
|