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

H. Fox haganfox at gmail.com
Thu Jul 28 19:41:06 CDT 2005


On 7/28/05, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> Okay, the current implementation of image floating is now available
> on pmwiki.org for people to test and play with.  I've put up a
> draft "Images" documentation page at
> 
>     http://www.pmwiki.org/wiki/PmWiki/Images
> 
> There will likely be small adjustments to the HTML and CSS default
> outputs for images that will continue through the 2.0.0 release, but
> thus far the basic syntax is in place and seems to be working.

Fantastic!  It really came out nicely.  I like the little frame that
looks like a Polaroid photo when you add the caption.

I suggest adding 3px or 4px of margin-top so the blocks visually line
up with the first line of text.  A pixel or two of bottom margin will
keep text from bumping against the bottom of the frame, too.  Wait... 
Vertical margin may not be an option since you styled the span and not
the div (on purpose, no doubt).

I'm glad the <img>'s title= attribute made the cut.  Firefox surfers
will be happy to see their tooltips now.  :-)

Why not use the image filename (with the extension stripped) as a
default when the author doesn't provide alt text?  The alt text is for
screen readers and such, right?  Wouldn't the image name be better
than an empty string there?  (I've always seen the empty string as a
way to "get around" the validator by following the rule but violating
the spirit of it.)

That and, well, "people like tooltips".

Could this be a recipe or configuration option at least?

I strip extensions like this, but you no doubt have a better way.  :-)

    $alt = substr($img, 0, -strlen(strrchr($img, '.')));

I would have liked to see text float around images (that are on their
own line) by default, since almost never would anyone want a big image
to be inline, with no margin or padding, and lots of white space
adjacent to the image. IOW the following two would be equivalent.

    Attach:image.jpg
    Some text.

would be equivalent to

    %rfloat% Attach:image.jpg
    Some text.

rather than

    Attach:image.jpg Some text.

I understand that it would break some existing pages, but I would
think not many.  As a compromise the default might be to float to the
left so the change is less dramatic.  Broken sites wold just need to
change #1 above to #3 by deleting the newline.

Regardless of any of that, the new image treatment fills a gap that
deserved to be filled before the release of PmWiki 2.0.  Nice work.

Hagan




More information about the pmwiki-users mailing list