Author Topic: macros coming...  (Read 8906 times)

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
macros coming...
« on: November 04, 2007, 11:20:08 PM »
symbol %urlvar% is no more.

it is different from other symbols, it requires more power.
it's a new thing, it's a macro, and urlvar is the first of this new generation. wow ::)

the syntax is different.
initially i thought to keep the %old syntax%, but this can be ambiguous for the user and slow for the computer (because % is both beginning and ending).
i introduce a new syntax that should be easy to see and to type.
so it would be {{urlvar|sort}} to read the content of 'sort'.

any suggestion for a different syntax should be adequately justified.
i was uncertain about using {single pairs}, but this way it should be more visbile and hardly collide with other syntaxes. to type twice the same char is fast.

[[double square brackets]] are easier to type, but can easily collide with [section] names in the template.

if this experiment with macros is successful, then user symbols %sym-anything% will be deprecated. they will be subsituted by the macro {{section|name}}.

all this will be since build #139
« Last Edit: November 15, 2007, 12:00:23 AM by rejetto »

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: macros coming...
« Reply #1 on: November 05, 2007, 12:05:38 AM »
for those geek who like to know WHY macros. :)

macros are somewhat faster for the template engine. because its value is calculated only when it is met. it is not calculated if it is not there.

macros can be void. if you use %urlvar-thing% but there is no thing parameter in URL instead of a having an empty space you will get %urlvar-thing% printed on your page. this can't be solved with the symbols engine.

with the %sym-thing% you are constrained in calling your section [sym-thing]. you can't just name it [yeah].
with macros you will be able to recall the content of [yeah] with {{section|yeah}}.

macros can have any number of parameters separated by |.
i could eventually create a macro "add" and it would work like {{add|3|5}} and 8 would be the output.
"add" is not very useful, but it's just to show you what it can do more than %symbols%.

Offline bacter

  • Operator
  • Tireless poster
  • *****
  • Posts: 682
    • View Profile
Re: macros coming...
« Reply #2 on: November 05, 2007, 12:27:41 AM »
I'am not sure to have understood the syntax of the macro feature.

When in next build [sym-thing] is deprecated can I do a quick change in the template like this:

Supose y have now [sym-info], [sym-header]... that replace %sym-info%... etc.

Can y simply leave my [sym-thing] sections and change the calls (%sym-info%...) to
{{section|sym-info}}, {{section|sym-header}} ?

Is it correct that we will have initially two macros 'section' and 'urlvar' ?
your computer has no brain - use your own !

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: macros coming...
« Reply #3 on: November 05, 2007, 12:30:33 AM »
yes, all correct

Offline ELEVENNNN

  • Tireless poster
  • ****
  • Posts: 257
  • havent been here lately, still wont be here?
    • View Profile
Re: macros coming...
« Reply #4 on: November 05, 2007, 01:33:00 AM »
This is great; but even better is that it is coming out before the two major releases, thunderchicken of glory and terayon will be able to implement the new changes before their release, only two or so weeks away!

As usual, good work Massimo.

-Kurt
This is going to take a long time
.................+...........................................
...................+.............+.................+.........
......................................

Offline Foggy

  • Tireless poster
  • ****
  • Posts: 806
    • View Profile
Re: macros coming...
« Reply #5 on: November 05, 2007, 05:22:54 AM »
This is great; but even better is that it is coming out before the two major releases, thunderchicken of glory and terayon will be able to implement the new changes before their release, only two or so weeks away!

If rejetto keeps adding new features we might have to wait even longer for them, but I can live with that because I always like a new feature to play with ;D

Offline TSG

  • Operator
  • Tireless poster
  • *****
  • Posts: 1934
    • View Profile
    • RAWR-Designs
Re: macros coming...
« Reply #6 on: November 05, 2007, 06:21:36 AM »
http://www.rawr-designs.com/tog/todo.php

Now that I have time from university, I have pushed 2 projects to the next build, only 2 more until release of 3.0.0.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: macros coming...
« Reply #7 on: November 14, 2007, 06:37:50 PM »
i have been working hard on the macros engine.
now it supports macro in macro.
this is an argumen for "experts", so if you truly have no idea of what i'm talking about, it's normal, pass on. :)

in next build i will use this syntax to make the search appear only when the recursive listing is enabled:

{{if| {{get|recursive}} | {{section|search }} /if}}

the final /if is optional, it's only for readability, to avoid confusion with many parenthesis. every macro can have it, it's just ignored by hfs.
to increase readability you can even split the macros over several lines, indenting.
« Last Edit: November 15, 2007, 12:13:22 AM by rejetto »

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1895
    • View Profile
Re: macros coming...
« Reply #8 on: November 14, 2007, 10:47:39 PM »
Il va falloir sérieusement remettre à jour la version de "tpl.hlp.rtf" dans les sources cher ami rejetto. ;D

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: macros coming...
« Reply #9 on: November 15, 2007, 03:06:27 AM »

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: macros coming...
« Reply #10 on: November 15, 2007, 03:44:57 AM »
hey templaters, you shall look at the way i'm changing the tpl for build #144
you'll be surprised of what macros can do :)

Offline TSG

  • Operator
  • Tireless poster
  • *****
  • Posts: 1934
    • View Profile
    • RAWR-Designs
Re: macros coming...
« Reply #11 on: November 15, 2007, 04:04:53 AM »
I can't wait for this :)

Offline Foggy

  • Tireless poster
  • ****
  • Posts: 806
    • View Profile
Re: macros coming...
« Reply #12 on: November 15, 2007, 05:18:50 AM »
Imagine the possibilities. :O

Offline MarkV

  • Tireless poster
  • ****
  • Posts: 746
    • View Profile
Re: macros coming...
« Reply #13 on: November 15, 2007, 08:02:09 AM »
Imagine the possibilities. :O

Slogan for HFS maybe?  ;)
http://worldipv6launch.org - The world is different now.

Offline TSG

  • Operator
  • Tireless poster
  • *****
  • Posts: 1934
    • View Profile
    • RAWR-Designs
Re: macros coming...
« Reply #14 on: November 15, 2007, 04:15:41 PM »
Imagine the possibilities. :O

Slogan for HFS maybe?  ;)

I like it. :)

Imagine the possibilities... :o