[New Rendering] Macro syntax

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[New Rendering] Macro syntax

vmassol
Administrator
Hi,

Right now wikimodel implements the following syntax for xwiki macros:

1)

{{macro param1="value1" param2="value2"}}content{{/macro}}
{{macro param1=value1 param2=value2}}content{{/macro}}

This is different from the original proposal of:

2)

{{macro:param1="value1"|param2="value2"}}content{{/macro}}

Notes:
* I think 1) is cleaner and easier to read
* There's no default param in 1) so you don't write something like:  
{{include:Main.WebHome}}. You have to write: {{include  
document=Main.WebHome}}
* 2) is the same as the current syntax

Which do we want?

I don't have any particular preference.

Thanks
-Vincent

_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [New Rendering] Macro syntax

Thomas Mortagne
Administrator
On Thu, Jul 31, 2008 at 12:37 PM, Vincent Massol <[hidden email]> wrote:

> Hi,
>
> Right now wikimodel implements the following syntax for xwiki macros:
>
> 1)
>
> {{macro param1="value1" param2="value2"}}content{{/macro}}
> {{macro param1=value1 param2=value2}}content{{/macro}}
>
> This is different from the original proposal of:
>
> 2)
>
> {{macro:param1="value1"|param2="value2"}}content{{/macro}}
>
> Notes:
> * I think 1) is cleaner and easier to read
> * There's no default param in 1) so you don't write something like:
> {{include:Main.WebHome}}. You have to write: {{include
> document=Main.WebHome}}
> * 2) is the same as the current syntax
>
> Which do we want?

I prefer 1) for readability.

>
> I don't have any particular preference.
>
> Thanks
> -Vincent
>
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
>



--
Thomas Mortagne
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [New Rendering] Macro syntax

Marius Dumitru Florea
In reply to this post by vmassol
> Hi,
>
> Right now wikimodel implements the following syntax for xwiki macros:
>
> 1)
>
> {{macro param1="value1" param2="value2"}}content{{/macro}}

It looks to me like a custom tag, with curly brackets instead of angle
brackets so +1.

> {{macro param1=value1 param2=value2}}content{{/macro}}
>
> This is different from the original proposal of:
>
> 2)
>
> {{macro:param1="value1"|param2="value2"}}content{{/macro}}
>
> Notes:
> * I think 1) is cleaner and easier to read
> * There's no default param in 1) so you don't write something like:
> {{include:Main.WebHome}}. You have to write: {{include
> document=Main.WebHome}}
> * 2) is the same as the current syntax
>
> Which do we want?
>
> I don't have any particular preference.
>
> Thanks
> -Vincent
>
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
>


_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [New Rendering] Macro syntax

Guillaume Lerouge
In reply to this post by Thomas Mortagne
I'm +1 for the first one too (I don't liek those pipes within macro
parameters).
Guillaume

On Thu, Jul 31, 2008 at 12:46 PM, Thomas Mortagne <[hidden email]
> wrote:

> On Thu, Jul 31, 2008 at 12:37 PM, Vincent Massol <[hidden email]>
> wrote:
> > Hi,
> >
> > Right now wikimodel implements the following syntax for xwiki macros:
> >
> > 1)
> >
> > {{macro param1="value1" param2="value2"}}content{{/macro}}
> > {{macro param1=value1 param2=value2}}content{{/macro}}
> >
> > This is different from the original proposal of:
> >
> > 2)
> >
> > {{macro:param1="value1"|param2="value2"}}content{{/macro}}
> >
> > Notes:
> > * I think 1) is cleaner and easier to read
> > * There's no default param in 1) so you don't write something like:
> > {{include:Main.WebHome}}. You have to write: {{include
> > document=Main.WebHome}}
> > * 2) is the same as the current syntax
> >
> > Which do we want?
>
> I prefer 1) for readability.
>
> >
> > I don't have any particular preference.
> >
> > Thanks
> > -Vincent
> >
> > _______________________________________________
> > devs mailing list
> > [hidden email]
> > http://lists.xwiki.org/mailman/listinfo/devs
> >
>
>
>
> --
> Thomas Mortagne
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
>



--
Guillaume Lerouge
Product Manager - XWiki
Skype ID : wikibc
http://blog.xwiki.com/
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [New Rendering] Macro syntax

Jean-Vincent Drean
In reply to this post by vmassol
On Thu, Jul 31, 2008 at 12:37 PM, Vincent Massol <[hidden email]> wrote:
> [snip]
>
> Notes:
> * I think 1) is cleaner and easier to read

Right, when you have multiple args the XMLish syntax helps.

> * There's no default param in 1) so you don't write something like:
> {{include:Main.WebHome}}. You have to write: {{include
> document=Main.WebHome}}

I guess we have to keep the "" : {{include document="Main.WebHome"}}, right ?
BTW it's close from the current #includeInContext("Main.WebHome")
macro in terms of char length.

>
> Which do we want?
>

+1 to adopt 1).

JV.
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [New Rendering] Macro syntax

vmassol
Administrator

On Jul 31, 2008, at 12:54 PM, Jean-Vincent Drean wrote:

> On Thu, Jul 31, 2008 at 12:37 PM, Vincent Massol  
> <[hidden email]> wrote:
>> [snip]
>>
>> Notes:
>> * I think 1) is cleaner and easier to read
>
> Right, when you have multiple args the XMLish syntax helps.
>
>> * There's no default param in 1) so you don't write something like:
>> {{include:Main.WebHome}}. You have to write: {{include
>> document=Main.WebHome}}
>
> I guess we have to keep the "" : {{include  
> document="Main.WebHome"}}, right ?

No the 2 syntaxes are allowed by wikimodel. The quotes are only needed  
when there's a space and probably also when there's an equal sign too  
in the value.

> BTW it's close from the current #includeInContext("Main.WebHome")
> macro in terms of char length.

Not quite since that would be:

{{include document="Main.WebHome" context="current"/}}

Right now the default is context = new.

Thanks
-Vincent

>> Which do we want?
>>
>
> +1 to adopt 1).
>
> JV.
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [New Rendering] Macro syntax

Tiago Rinck Caveden
In reply to this post by vmassol
Won't you break old documents if you change the syntax?

On Thu, Jul 31, 2008 at 12:37 PM, Vincent Massol <[hidden email]> wrote:

> Hi,
>
> Right now wikimodel implements the following syntax for xwiki macros:
>
> 1)
>
> {{macro param1="value1" param2="value2"}}content{{/macro}}
> {{macro param1=value1 param2=value2}}content{{/macro}}
>
> This is different from the original proposal of:
>
> 2)
>
> {{macro:param1="value1"|param2="value2"}}content{{/macro}}
>
> Notes:
> * I think 1) is cleaner and easier to read
> * There's no default param in 1) so you don't write something like:
> {{include:Main.WebHome}}. You have to write: {{include
> document=Main.WebHome}}
> * 2) is the same as the current syntax
>
> Which do we want?
>
> I don't have any particular preference.
>
> Thanks
> -Vincent
>
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
>



--
Tiago Rinck Caveden
http://caveden.multiply.com
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Tiago Rinck Caveden
http://caveden.multiply.com
Reply | Threaded
Open this post in threaded view
|

Re: [New Rendering] Macro syntax

Guillaume Lerouge
Hi Tiago

Won't you break old documents if you change the syntax?


It sure will. However, 2 things are to be noted :

   - The current XWiki 1.0 syntax will remain available and usable along the
   XWiki 2.0 one thanks to Wikimodel
   - All pages from the standard XE / XWS / XWatch / XEM applications will
   be rewritten to match the new syntax

So from an user PoW you should be able to minimize potential issues.

Guillaume



>
>
> On Thu, Jul 31, 2008 at 12:37 PM, Vincent Massol <[hidden email]>
> wrote:
>
> > Hi,
> >
> > Right now wikimodel implements the following syntax for xwiki macros:
> >
> > 1)
> >
> > {{macro param1="value1" param2="value2"}}content{{/macro}}
> > {{macro param1=value1 param2=value2}}content{{/macro}}
> >
> > This is different from the original proposal of:
> >
> > 2)
> >
> > {{macro:param1="value1"|param2="value2"}}content{{/macro}}
> >
> > Notes:
> > * I think 1) is cleaner and easier to read
> > * There's no default param in 1) so you don't write something like:
> > {{include:Main.WebHome}}. You have to write: {{include
> > document=Main.WebHome}}
> > * 2) is the same as the current syntax
> >
> > Which do we want?
> >
> > I don't have any particular preference.
> >
> > Thanks
> > -Vincent
> >
> > _______________________________________________
> > devs mailing list
> > [hidden email]
> > http://lists.xwiki.org/mailman/listinfo/devs
> >
>
>
>
> --
> Tiago Rinck Caveden
> http://caveden.multiply.com
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
>



--
Guillaume Lerouge
Product Manager - XWiki
Skype ID : wikibc
http://blog.xwiki.com/
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [New Rendering] Macro syntax

vmassol
Administrator

On Jul 31, 2008, at 3:29 PM, Guillaume Lerouge wrote:

> Hi Tiago
>
> Won't you break old documents if you change the syntax?
>
>
> It sure will. However, 2 things are to be noted :
>
>   - The current XWiki 1.0 syntax will remain available and usable  
> along the
>   XWiki 2.0 one thanks to Wikimodel

Actually we'll keep the 1.0 syntax because we won't remove the old  
code for a long time so that we don't break current users. Wikimodel/
Doxia/new rendering is used only for the new 2.0 syntax.
When you edit a page you can choose which syntax it uses.

Thanks
-Vincent

>
>   - All pages from the standard XE / XWS / XWatch / XEM applications  
> will
>   be rewritten to match the new syntax
>
> So from an user PoW you should be able to minimize potential issues.
>
> Guillaume
>
>
>
>>
>>
>> On Thu, Jul 31, 2008 at 12:37 PM, Vincent Massol <[hidden email]>
>> wrote:
>>
>>> Hi,
>>>
>>> Right now wikimodel implements the following syntax for xwiki  
>>> macros:
>>>
>>> 1)
>>>
>>> {{macro param1="value1" param2="value2"}}content{{/macro}}
>>> {{macro param1=value1 param2=value2}}content{{/macro}}
>>>
>>> This is different from the original proposal of:
>>>
>>> 2)
>>>
>>> {{macro:param1="value1"|param2="value2"}}content{{/macro}}
>>>
>>> Notes:
>>> * I think 1) is cleaner and easier to read
>>> * There's no default param in 1) so you don't write something like:
>>> {{include:Main.WebHome}}. You have to write: {{include
>>> document=Main.WebHome}}
>>> * 2) is the same as the current syntax
>>>
>>> Which do we want?
>>>
>>> I don't have any particular preference.
>>>
>>> Thanks
>>> -Vincent
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [New Rendering] Macro syntax

Artem Melentyev-3
In reply to this post by vmassol
+1 for 1) because of readability.

Vincent Massol wrote:

> Hi,
>
> Right now wikimodel implements the following syntax for xwiki macros:
>
> 1)
>
> {{macro param1="value1" param2="value2"}}content{{/macro}}
> {{macro param1=value1 param2=value2}}content{{/macro}}
>
> This is different from the original proposal of:
>
> 2)
>
> {{macro:param1="value1"|param2="value2"}}content{{/macro}}
>
> Notes:
> * I think 1) is cleaner and easier to read
> * There's no default param in 1) so you don't write something like:  
> {{include:Main.WebHome}}. You have to write: {{include  
> document=Main.WebHome}}
> * 2) is the same as the current syntax
>
> Which do we want?
>
--
   Artem Melentyev
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [New Rendering] Macro syntax (SUMMARY)

vmassol
Administrator
In reply to this post by vmassol
ok it has been implemented as 1), i.e.

{{macro param1="value1" param2="value2"}}content{{/macro}}
{{macro param1=value1 param2=value2}}content{{/macro}}

Thanks
-Vincent

On Jul 31, 2008, at 12:37 PM, Vincent Massol wrote:

> Hi,
>
> Right now wikimodel implements the following syntax for xwiki macros:
>
> 1)
>
> {{macro param1="value1" param2="value2"}}content{{/macro}}
> {{macro param1=value1 param2=value2}}content{{/macro}}
>
> This is different from the original proposal of:
>
> 2)
>
> {{macro:param1="value1"|param2="value2"}}content{{/macro}}
>
> Notes:
> * I think 1) is cleaner and easier to read
> * There's no default param in 1) so you don't write something like:
> {{include:Main.WebHome}}. You have to write: {{include
> document=Main.WebHome}}
> * 2) is the same as the current syntax
>
> Which do we want?
>
> I don't have any particular preference.
>
> Thanks
> -Vincent
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs