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

Ed W lists at wildgooses.com
Tue Jul 26 10:13:52 CDT 2005


>If we use "img:" for images and give it all sorts of special capabilities
>like resizing and floating, then it somehow breaks that model, or at
>least introduces something special beyond what InterMap links normally
>do.
>  
>

Yeah, but in a way isn't it very similar to attach, but the main 
difference being whether you want it inline or as an icon?  Media wiki 
uses "image:" when you want to see it, and "media:" when you want a link 
to it.  I guess it's useful sometimes to just have a link to a bunch of 
jpegs sometimes...


>>   or, floating to the right side of the page and with a caption (and CSS
>>   frame):
>>   [[Image:Wiki.png|frame|Wikipedia Encyclopedia]]
>>    
>>
>
>We don't have an equivalent for this yet, but we can see about
>developing one.  From an author perspective I have trouble seeing why
>this last one isn't using "frame" as the alternative text (compare
>to the "jigsaw globe" example immediately above).
>  
>

What they seem to do (haven't look at the code) is parse for any text 
which looks like an option and get rid of that.  Then whatever is left 
is used as the caption.  So if you put the caption and options in a 
random order it still works as long as you spell the options correctly.  
This implies that you can't have a caption of "left" or "20px", but I 
don't think this is a serious limitation

>Okay; one of the things that bugs me about this syntax is that whatever
>comes after the "|" is sometimes text and sometimes an option of some
>sort.
>  
>

Yep, see above.  It just breaks it up and doesn't care about ordering.  
Actually this seems to work quite well in practice.


>Well, in designing this let's keep in mind that (1) not every PHP
>installation has the ability (or resources) to resize graphic images
>on the server, and (2) not every image is stored locally on the server.
>  
>

If they can't resize then... erm I guess we don't resize it... Can't 
think of a safe way out of that.  I guess we could also send the 
dimensions that the image should be once resized to the browser and then 
at least it displays correctly the way the author intended...

Media wiki doesn't let you use this syntax for anything which isn't 
local, ie it only applies to the attach: syntax in the pm equivalent.  
This seems fair enough.  If you just put in a URL which ends in a .jpg, 
etc then I think this gets put inline, but that's about your lot in 
terms of formatting images on other people's websites.

>  
>
>>   How does this sound?  Notice how wikipedia use [[image:xxx]] in square
>>   brackets, do you want the syntax for pm to loose the [[..]]?
>>   http://en.wikipedia.org/wiki/Image_markup
>>    
>>
>
>I definitely don't want to change PmWiki's current meaning of the
>double square brackets, so yes, whatever syntax we come up with can't
>rely on them to denote "image".  
>  
>

Well, they use [[link]] exclusively for links as well.  In fact 
mediawiki doesn't have automatic linking, only manual linking.  The 
point is more that they use the [[ ]] to denote that it's is special and 
not plain text.

Actually just have a browse around the site:
http://en.wikipedia.com

The syntax looks extremely clear when you view a page.  Probably one of 
the most readable syntaxes that I have seen (only slightly different to 
pm really).  The pages themselves show that advanced formatting is 
possible and easy.  I think because they allow HTML (and have an HTML 
defang routine) it tends to mean that they stop forcing wiki syntax and 
allow raw HTML a lot earlier


>Which side does the image float to by default?
>  
>
Right.  Consider that the main use of mediawiki is an encyclopedia it 
means that you can stick in images and have the text flow around them so 
that they are more incidental.


>>   Other syntax not discussed, but it should be possible is to use the image
>>   as the display item of a link, ie something like this should be valid.:
>>
>>   [[Topic|image:somepicture.jpg]]
>>    
>>
>
>In PmWiki:  [[Topic | Attach:somepicture.jpg]], or even
>   [[Topic | Attach:somepicture.jpg"alt text"]]
>  
>

Agreed.

Can we get a conclusion on this then?

Seems to me that from the above, since it's basically an extension to 
"attach:", it might equally make sense to have a  image: syntax which is 
mostly a copy of the code, but allows for a slightly different upload 
form, and more exotic syntax which wouldn't make sense for the generic 
attach: tag.  Perhaps the attach tag can still read the same files 
though, it's just that it generates a link to the file instead of  
inlining the file (although that would break all existing sites...)

What do you think?

Ed W




More information about the pmwiki-users mailing list