rejetto forum

macros coming...

rejetto · 24 · 14151

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
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: 13510
    • View Profile
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: 681
    • View Profile
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: 13510
    • View Profile

Offline ELEVENNNN

  • Tireless poster
  • ****
    • Posts: 257
  • havent been here lately, still wont be here?
    • View Profile
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
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: 1935
    • View Profile
    • RAWR-Designs
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: 13510
    • View Profile
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: 2059
    • View Profile
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: 13510
    • View Profile
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: 1935
    • View Profile
    • RAWR-Designs

Offline Foggy

  • Tireless poster
  • ****
    • Posts: 806
    • View Profile

Offline MarkV

  • Tireless poster
  • ****
    • Posts: 764
    • View Profile

Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs