[Pmwiki-users] More on attachments

Patrick R. Michaud pmichaud at sci.tamucc.edu
Tue Nov 19 16:18:10 CST 2002


On Tue, 19 Nov 2002, Davis, James C. wrote:

> It would be nice to have both options.
> 
> A proposed markup would be:
> 
> [[newwindow http:/www.pmichaud.com/toast Pop-Tarts]]

How about substituting "target" for "newwindow" here, to more closely
match the <a...> tag definition?  Or perhaps allow either one as being 
synonymous?

> and
> [[newwindow:poptarts http://www.pmichaud.com/toast Pop-Tarts]]

I don't like the use of the colon after newwindow--looks too much like
a URL or intermap link.  I'd prefer "newwindow=" or "target=" there instead,
as in:

    [[target=poptarts http://www.pmichaud.com/toast Pop-Tarts]]

And, just to make the syntax a little easier for PmWiki to parse, require
the = after the word "target" or "newwindow" even for new windows, as in

    [[target= http://www.pmichaud.com Pop-Tarts in a new window]]


> I don't like the idea of having the attributes come after the url because
> there is nothing separating them from the link text. I think it should
> assume that everything before the url is an attribute and everything after
> the url is link text.

Hmmmmmmmmmmmmmm.  I agree that the attributes should go before the url.
I'm not so sure about the "assume everything before the url is an attribute",
BUT it does bring up an interesting double bracket stylesheet possibility.
What if we *really* abuse the double brackets and generalize it to be
something like [[attributes url text]], where any of the three parts are 
optional.  Then we could do things like:

    [[color=red This text is Red]]

    [[class=foobar rendered with the foobar stylesheet attribute]]

    [[color=red target=new http://www.pmichaud.com/toast Pop-Tarts
      link displayed in red text and opening in a new window]]

In general, if "attr" is a set of "attribute=value" pairs, then
we could do:

[[url]]			link to url rendered as <a href=url>[1]</a>
[[url text]]		link to url rendered as <a href=url>text</a>
[[url url.jpg]]		link to url rendered as
			   <a href=url><img src=url.jpg></a>

[[attr url]]  		link to url rendered as <a href=url attr>[1]</a>
[[attr text]]		text rendered as <span attr>text</span>
[[attr url.jpg]]	image rendered as <img src=url.jpg attr>

[[attr url text]] 	link to url rendered as 
			   <a href=url attr><span attr>text</span></a>
[[attr url url.jpg]]	link to url rendered as
			   <a href=url attr><img src=url.jpg attr></a>

Of course, PmWiki might have to be a little smart about knowing which
attributes belong to which tags, or we'd have to be willing to accept that
wiki authors could create documents that aren't really HTML compliant
even according to the transitional DTD.

I'm not sure that I like this idea.  I'm not sure that I don't like it.
Any comments?

Pm





More information about the pmwiki-users mailing list