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

Patrick R. Michaud pmichaud at pobox.com
Wed Jul 27 01:57:59 CDT 2005


On Tue, Jul 26, 2005 at 04:57:29PM -0700, H. Fox wrote:
> This creates a tooltip in IE but not in Gecko-based browsers.  For
> cross-browser consistency you could add a title= attribute to the
> <img> tag that contains the same text as the alt= attribute.

I seem to recall reading somewhere that W3C recommends not just
blindly copying alt= attributes to the title= attribute, that they
really have different semantic meanings.  That said, I don't have any
real problem with this particular proposal so we can certainly
implement it if there are no objections.

> Maybe have the default-to-the-right behavior only happen when the
> image is on its own line, like:
>
>     Attach:image.jpg
>     Some text.
>
> being equivalent to
>
>     %imright%Attach:image.jpg
>     Some text.
> 
> Is that confusing?  Even if slightly so, I think the current behavior
> of having text not wrap around images is more confusing, or maybe
> "confounding" is a better word.  :-)

I'll have to think about this a bit more.  In PmWiki 1 an image on its
own line ended up being on its own line in the output, not floating.
But something like this might resolve another problem I'm struggling with
at the moment, namely:

    %center% Attach:image.jpg
    Some text.

which centers the image but also centers "Some text" immediately after
it, as in

                             [IMAGE] Some text.

If we say that an image on a line by itself receives its own "block"
(which could be floated left, floated right, centered, left-justfied,
right-justified), then the text that follows works out naturally.

But "image on a line by itself" runs into a captioning problem, at
least as far as how I was planning to do captions, in that

    %framed% Attach:image.jpg [[<<]] Caption

(but with something better than [[<<]] for the <br />) means the 
image is not really "on a line by itself".  There's also the problem
of images that are links, as in

    [[http://www.pmwiki.org | Attach:pmwiki.gif]]

Is it sufficient to say that if the first thing on a line is an
image then it receives its own block, which by default floats right?
Then we would have:

    Attach:image.jpg                           # floating right w/margins
    %float=left% Attach:image.jpg              # floating left w/margins
    %framed% Attach:image.jpg                  # floating right w/frame
    %framed% Attach:image.jpg [[<<]] caption   # floating right w/frame+caption
    %thumb% Attach:image.jpg                   # floating right thumbnail
    %center% Attach:image.jpg                  # centered, no wrapping
    %right% Attach:image.jpg                   # right-aligned, no wrapping
    %left% Attach:image.jpg                    # left-aligned, no wrapping
    Some text Attach:image.jpg more text       # inlined in text

In the extremely rare case that someone needs to start a line with
an image that acts inlined, they can write things like:

    [==] Attach:image.jpg here is some text

I like it.  I like it a *lot*.  Implementing it may be a bit of 
a challenge, but it is by far cleaner than anything else I've seen
thus far.

Pm




More information about the pmwiki-users mailing list