[pmwiki-users] Feature request: Action lists in skins
Patrick R. Michaud
pmichaud at pobox.com
Fri Apr 8 16:33:28 CDT 2005
On Fri, Apr 08, 2005 at 10:52:10PM +0200, Joachim Durchholz wrote:
> >>Now I've seen the slice&dice concept. It made my head hurt: the regex
> >>was inscrutable, and I was imagining the skin author who tried to
> >>determine whether his all-new way of writing action links would be
> >>recognized by the slice&dice function. (If he was aware of that function
> >>in the first place...)
> >No, the idea is that the skin author would write his own slice&dice
> >function to extract the links based on the <a> tags, then put them
> >together in his all-new way of formatting action links. That's all
> >there is to it.
> Er... you're asking skin writers to deal with regexps... now I really
> wonder who's asking difficult things of skin writers!
There's a difference here -- I'm not forcing a skin writer to do it
this way. If a simple list that can be styled is all that is needed
(as it will be for most of the cases), then the skin writer doesn't
need regexps at all. And there's nothing to stop someone nice
from writing a
<!--function:JosActionHandler pre="<start>" sep=" ~ " end="<end>"-->
that will do it for the skin writer. :-)
> I'd find it definitely simpler to ask him to insert a special "actions
> go here" markup in the proper place.
looks pretty darn simple to me.
> >No, it just needs to parse <a> tags, which is easy, and PmWiki
> >isn't likely to get rid of those.
> Not easy at all. Try to deal with
> <a href="..." title="This has an <a> tag.">...</a>
> Sure, that's unlikely to happen with an action link,
It's not only unlikely to happen, it's illegal HTML. The "<a>"
in the title attribute has to be coded as ">a<" .
But the regexp I provided earlier would *still* capture
your example perfectly.
> For a more realistic example, take with multiple <a href>...</a> links
> on the same line, which runs our poor skin designer into greediness
> issues in no time.
The regexp I provided already handles this just fine.
> >Functions in skins are always called *after* all substitutions
> >have taken place.
> Which means that the line will contain text that the skin designer
> doesn't see in the skin.
> ... um, well, I just realize that this problem is always there,
> regardless of how one does it.
Right, it's a non-issue for this discussion.
> I could imagine stuff like
> ConfigureAction('edit', 'Edit Page');
> ConfigureAction('print', 'Printable View', 'target="_blank"');
I can't. We would have to provide a bewildering array of options
and arguments to the recipe writer or wiki administrator, and
neither one is going to have a clue what is output at the end.
> >It's really not that complex or difficult, and again, only skin
> >authors that want to modify the actions beyond simple lists would
> >ever have to write something like it.
> Um... I could say just the same about the <!--function:ActionXxx
> approach... actually it's what I *have* said...
No, the difference is that with <!--function:ActionXxx--> and an
array we're putting the learning curve and extra work on wiki
administrators (a larger, less capable group), while with
slice&dice we're putting the burden only those few skin designers
who want to publish skins with fancy action formatting or shared
actions across multiple skins.
More information about the pmwiki-users