[pmwiki-users] IMG with border. Possible?
Patrick R. Michaud
pmichaud at pobox.com
Fri Apr 28 17:18:29 CDT 2006
On Sat, Apr 29, 2006 at 10:03:38AM +1200, Allister Jenks wrote:
> On 4/29/06, malexism at free.fr <malexism at free.fr> wrote:
> >
> > try %border='4px solid black' apply=img%Attach:MyPic.jpg%%
> >
>
> Excellent. Thanks!
>
> I did wonder what apply= is for but the WikiStyles page doesn't
> actually say anything other than it exists.
In case someone wants to update the documentation, I'll give a brief
explanation here and others can work on making it understandable. :-)
Normally a wikistyle applies to a span of (inline) text, but
the apply= attribute allows a style to be applied to something
else. The predefined apply= values are:
apply=img apply the style to any image that follows
apply=p apply the style to the current paragraph*
apply=pre apply the style to the current preformatted text
apply=list apply the style to the current list*
apply=item apply the style to the current list item*
apply=div apply the style to the current div
apply=block apply the style to the current block,*
whether it's a paragraph, list, list item,
heading, or division.
The starred items also have wikistyle shortcuts already defined,
thus %p color=blue% is the same as %apply=p color=blue%, and
%list ROMAN% is the same as %apply=list list-style=upper-roman%.
(It's a fair question as to why the unstarred items above don't
have shortcuts -- perhaps they should.)
Some wikistyle shortcuts also make use of apply, thus %right%
is a shortcut for %text-align=right apply=block%.
An applied wikistyle will only take effect if it's on the
line that starts the thing it's supposed to modify. In other
words, a wikistyle in the third markup line of a paragraph
can't change the attributes of the paragraph:
here is some text in
a paragraph and if
we try to %apply=p color=blue% change
the color of the paragraph in the middle
it won't work because the style comes
after the paragraph has already been started.
However, this %p color=red% paragraph
''will'' be in red because its block style does
occur in the first line of its text.
* Here's a list item
* %list red% Oops, too late to affect the list!
Pm
More information about the pmwiki-users
mailing list