[SF] Prefix and Suffix for fields?

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

[SF] Prefix and Suffix for fields?

planetenxin
Hi folks,

I'm aware of using {{!}} to avoid issues with pipes in template
parameters. This works fine in general but not in my case where I'd like
to add PlantUML code via SF.

Example PlantUML code [1]:

<uml>
|Swimlane1|
start
:foo1;
|#AntiqueWhite|Swimlane2|
:foo2;
:foo3;
|Swimlane1|
:foo4;
|Swimlane2|
:foo5;
stop
</uml>

I cannot replace the pipes within the uml tags by {{!}} (which makes
sense in a way).

I found the nice PipeEscape extension [2] that does the trick. Now,
writing the following code, everything is fine:

{{#!:
<uml>
|Swimlane1|
start
:foo1;
|#AntiqueWhite|Swimlane2|
:foo2;
:foo3;
|Swimlane1|
:foo4;
|Swimlane2|
:foo5;
stop
</uml>
}}

It would be cool, if there would be a prefix/suffix parameter for SF
field to automatically add the {{#!:  }} parser function.

{{field|test|property=test|prefix={{!:|suffix=}} }}

Not sure if the parser would be confused by the curly brackets...

Any thoughts?

/Alexander


[1] http://plantuml.sourceforge.net/activity2.html#swimlane
[2] https://www.mediawiki.org/wiki/Extension:Pipe_Escape

--
________________________________________________
semantic::apps by gesinn.it
Business Applications with Semantic Mediawiki.
http://semantic-apps.com

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: [SF] Prefix and Suffix for fields?

Yaron Koren-2
Hi Alexander,

I can think of some approaches that might be easier:

1) Store the UML in the free text instead of in a template.
2) Store the UML in a page section instead of in a template - SF has
supported editing page sections for a while now, but it's still an
under-used feature.
3) Pass the UML in to the form as individual fields instead of one big
blob, then have the template itself construct the full tag. That may or may
not work, depending on how consistent the structure of your UML will be
across pages.

Would any of those be possible?

-Yaron

On Wed, Jan 14, 2015 at 10:21 AM, planetenxin <[hidden email]> wrote:

> Hi folks,
>
> I'm aware of using {{!}} to avoid issues with pipes in template
> parameters. This works fine in general but not in my case where I'd like
> to add PlantUML code via SF.
>
> Example PlantUML code [1]:
>
> <uml>
> |Swimlane1|
> start
> :foo1;
> |#AntiqueWhite|Swimlane2|
> :foo2;
> :foo3;
> |Swimlane1|
> :foo4;
> |Swimlane2|
> :foo5;
> stop
> </uml>
>
> I cannot replace the pipes within the uml tags by {{!}} (which makes
> sense in a way).
>
> I found the nice PipeEscape extension [2] that does the trick. Now,
> writing the following code, everything is fine:
>
> {{#!:
> <uml>
> |Swimlane1|
> start
> :foo1;
> |#AntiqueWhite|Swimlane2|
> :foo2;
> :foo3;
> |Swimlane1|
> :foo4;
> |Swimlane2|
> :foo5;
> stop
> </uml>
> }}
>
> It would be cool, if there would be a prefix/suffix parameter for SF
> field to automatically add the {{#!:  }} parser function.
>
> {{field|test|property=test|prefix={{!:|suffix=}} }}
>
> Not sure if the parser would be confused by the curly brackets...
>
> Any thoughts?
>
> /Alexander
>
>
> [1] http://plantuml.sourceforge.net/activity2.html#swimlane
> [2] https://www.mediawiki.org/wiki/Extension:Pipe_Escape
>
> --
> ________________________________________________
> semantic::apps by gesinn.it
> Business Applications with Semantic Mediawiki.
> http://semantic-apps.com
>
>
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>



--
WikiWorks · MediaWiki Consulting · http://wikiworks.com
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user