[Pmwiki-users] Re: Suggestion: new "Attach:" behavior for existing attachments
Patrick R. Michaud
pmichaud
Thu May 13 09:27:44 CDT 2004
On Sun, May 09, 2004 at 12:01:46AM +0200, Christian Ridderstr?m wrote:
> On Fri, 7 May 2004, Fabio Reis Cecin wrote:
>
> I liked Fabio's idea of letting
> Attach:filename
> render as
> filename
> by default.
I have a number of ideas on this--here's the first. Attach:filename is
really processed as though it were some form of InterMap link. In
addition, in the past some people have asked that it be possible to
suppress the prefix used in other InterMap references or otherwise
easily change the HTML produced by such references.
What if we extend the InterMap code to make it possible to specify the text
displayed by an InterMap link, or even the complete HTML code to be used for
such a link. This may be a bit complex, so bear with me or just skip to the
part about how this would enable Fabio's idea for Attach: rendering.
Where an localmap.txt entry now reads:
Google http://www.google.com/search?q=$1
a wikiadmin could instead do
Google html <a class='google' href='http://www.google.com/search?q=$1'>Search Google for '$1'</a>
so that "Google:pmwiki" in the markup would render as
"Search Google for 'pmwiki'" on output.
The "html" keyword distinguishes this new form from the previous
form of intermap links, to preserve compatibility with existing
intermap.txt and localmap.txt files. Alternately, or as an interim
step, we could make it possible to do the equivalent of the html
mapping above solely in config.php files and leave the
InterMap config file format alone. (I think I prefer the
interim step.)
The Attach: markup can then be set to render as anything
desired -- e.g.:
Attach html <a class='attachlink' href='$UploadUrlFmt$UploadPrefixFmt$1'>$1</a>
so that "Attach:filename" displays as "filename", or even
Attach html <a class='attachlink' href='$UploadUrlFmt$UploadPrefixFmt$1'><img src='attachment.gif' /></a>
so that "Attach:filename" displays as an icon for
downloading ('attachment.gif').
Comments?
Pm
More information about the pmwiki-users
mailing list