[pmwiki-users] improved markup for floating images...?

Patrick R. Michaud pmichaud at pobox.com
Thu Jul 28 11:44:44 CDT 2005


On Thu, Jul 28, 2005 at 11:49:27AM -0400, Neil Herber wrote:
> What would the downside of using more explicit markup be?
> 
> For example: %rframe% Attach:image.gif alt="text" caption="My Caption"
> 
> I realize that there may be problems parsing this, but to my human eyes, 
> the notation seems more obvious than the proposed rule: "enclose alt text 
> in quotes and put captions after a vertical bar as the last thing on the 
> line".

Enclose alt-text in quotes isn't a proposed rule, it's an existing one.  :-)

I think it's important to note that HTML 4 doesn't have any special
constructs for image captions, thus what we're calling a "caption" here
is really just "anything that appears below the image but within the
same frame".  "  In fact, with

    %rframe% Attach:image.gif | caption

the vertical brace is doing nothing more than generating a <br /> tag
in the output.  It's also important to note that a caption isn't (or
shouldn't be) limited to simple text, it can have its own styling, 
links, and even images within the caption itself.

    %rframe% Attach:cover.gif"cover image" | The Book \
    of Wiki [[Attach:book.pdf | Attach:pdf-icon.png"PDF" ]]

> The fact that the proposed notation is more compact is not lost on me, but 
> how often will most authors use this notation? I suspect, not very often 
> compared to other markup, and they will have to look up the rules every 
> time. [...] I hope we aren't losing sight of PmWiki goal number 1, which 
> is "favor writers over readers".

Well, in the case of alt= I think that the shortcut form helps far
more than it hurts.  But that may be just me.  A traditional issue 
with HTML was getting authors to place alt= attributes in all image tags
(it's a required attribute), and, at least for me, the repeated
typing of the alt= and quotes was irritating.  Having a convenient 
shortcut to adding the alt= attribute is a big help to me as a writer, 
and one that I would use exclusively over any available longer
alt="..." syntax.

The other concern I have with an explicit alt= and caption= syntax is 
that they look a little too much like wikistyles, which means that 
authors are likely to try to enclose them in %'s and write things like:

   Attach:image.gif  %alt="alt text" caption="My Book"%

That said, it's a very interesting idea.  If we were to extend
to allow this, would we necessarily stop at images?  In other 
words, would we also allow the following...?

   [[http://www.pmwiki.org/ title="PmWiki" target="_blank" | PmWiki]]

This starts to feel a little slippery to me.  It's certainly doable --
we could get the various link parsers to start grabbing any
value=variable looking things that immediately follow... but I'm not
entirely comfortable with it yet.

> Plus, if a new author attempts to edit a page that has this notation 
> on it, they will probably need to toggle back and forth between the display 
> and edit view to figure out what it does.

I actually think new authors will be able to grok the new syntax
just fine... but if I'm wrong there's very little preventing us from
adding a new-and-improved syntax for it later.  :-)

Pm




More information about the pmwiki-users mailing list