[Pmwiki-users] action=source ignored; PmWiki "macros" and [[include:]]

Steven Leite steven_leite
Wed Jun 2 00:09:47 CDT 2004


I can think of one way to make "macros" .. using inline replacements.

For example, if you know you are using the same complex table formatting
in many places, but you don't want to keep typing all the code (or
wikimarkup), then you could type it once, and store it in your
config.php as an inline replacement.  Then when you use that syntax, for
example $my_code_here, would be replaced with the code (or wikimarkup)
that you stored in your config.php.

I'm not sure if that's close to what you want or not.  It doesn't really
allow for authors to change/make modifications to the "macro".

I think it wouldn't be that hard to write a plug-in to accomplish the
same task (which would allow author's to make macro's), but I'd be
worried about security (only because I'm not a seasons php veteran, and
I don't know enough about how users can manipulate the code).

If you can give some more detailed examples, I might toy around with the
idea, but I can't make any promises - I'm involved in two other big
projects right now and I'd like to see those finished before I start a
new one.

-S
----- Original Message ----- 
From: "Jesse Jacobsen" <selnecker at gmx.net>
To: <pmwiki-users at pmichaud.com>
Sent: Tuesday, June 01, 2004 10:07 PM
Subject: [Pmwiki-users] action=source ignored;PmWiki "macros" and
[[include:]]


> Dear PmWiki-users,
>
> I have newly subscribed to the list, after my previous attempt at
> posting apparently didn't work.  I have two questions.
>
> 1.  What would cause current versions of PmWiki to ignore
> "&action=source"?  Other actions (edit, crypt) work fine, but it seems
> PmWiki doesn't recognize source.  You can try it yourself at
> http://www.grace-els.org/boc/pmwiki.php?pagename=Main.HomePage
>
> 2.  On the site above, I'm experimenting with using [[include:...]]s
as
> a kind of macro simplification for nicer repetition of some uglier
> AdvancedTables code.  It seems to work well enough, though it uses
> multiple pages to do it.  Is this an intended application, or is there
a
> better way to do macro substitution in PmWiki?  For example, it might
> seem less brutish to assign a piece of arbitrary text/code to some
token
> for later expansion.  The [[include:page#from#to]] idea (especially
some of
> the things I read on the list archives) comes close, but it seems that
> the current implementation forces the "macro" call to know either the
> length of the included piece or the next anchor name on the included
> page.  Just for example, here's the sort of macro expansion that would
> work well for me, with some randomly chosen markup.
>
> @@tstarttoken@@
> [[table width=100%]]
> [[cell width=35% valign=top]]
> @@
>
> ...
>
> [[@@tstarttoken@@]]
>  Cell content...
> [[@@tnextcell@@]]
>  Cell content
> [[@@tend@@]]
>
> As an alternative, if a [[include:page#from]] variant included
> everything in the following "paragraph" (up to at least two newlines
> without intervening space?) it would serve the same general purpose.
> Even better if it included everything up to some marker like
> [[endinclude]].
>
> Best Regards,
>
> Jesse Jacobsen
>
>
> -- 
> Pmwiki-users mailing list
> Pmwiki-users at pmichaud.com
> http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
>
>




More information about the pmwiki-users mailing list