[Pmwiki-users] Re: %class=something% (was Re: Extending ...)

Patrick R. Michaud pmichaud
Mon Mar 1 09:58:33 CST 2004


On Mon, Mar 01, 2004 at 09:28:26AM +0100, Mathias Dzionsko wrote:
> Hello!
> 
> >> > 	%class=myCoolStyle%Some random text bla bla%%
> 
> I think an additional markup isn't needed: If the wikistyle surrounds
> a complete paragraph, pmwiki should generate a <div>. In all other
> cases a <span> like the current pmwiki version.

In general I agree, but what if the paragraph needs to contain another
wikistyle within it?  I.e.,

%class=myclass% blah blah blah blah %color=red% BLAH %% blah blah blah blah

Or are we going to say that it's not possible in PmWiki to create a 
<div>/block wikistyle that also contains <span>/inline wikistyles?  That
seems counterintuitive to me.

So far the best approaches I've come up with are:

Approach #1:  A wikistyle appearing at the beginning of a line 
applies to the entire line (block), generating a <div> as needed.

    %text-align=right bgcolor=blue% This paragraph is right-justified
    with a blue background.

The big problem with this approach is how to have leading text
be styled without affecting the entire paragraph.  For example:

    %color=red% This text is red %% and this is ...?

Workarounds to this would be

    %color=red% This text is red %color=black% and this is black
    and %% this is red again.

or

    [==] %color=red% This text is red %% and this is black
    because the wikistyle isn't at the beginning of the line.

or even

    %% %color=red% This text is red %% and this is black again.

but these seem nonintuitive to me.

Approach #2: A wikistyle that looks like %div ...% (or %block ...% 
or pick another word/markup) applies to the entire enclosing block, 
regardless of where it appears in a line.  Thus

    This paragraph is %block text-align=right bgcolor=blue% right-justified. 

would draw the entire paragraph in a box with a blue background
and right-justified, including the "This paragraph is" part.  Thus
   
    %color=red% This text is red %% and this is black

still works, while

    %block color=red% This text is red %color=black% and this is black
    and %% this is red again.

also works fairly intuitively.  This might also make it easy to do styles
in bullet lists:

    %define=ROMAN block list-style-type=upper-roman%
    %define=alpha block list-style-type=lower-alpha%

    # %ROMAN% This numbered list uses uppercase roman numerals, as in
    "I.", "II.", "III.", etc.
    ## %alpha% This numbered list uses lowercase alpha numerals, as in "a.",
    "b.", "c.", etc.
 
But somehow I'd prefer a different word besides (or in addition to) 
"div" or "block" that is more accessible to people who aren't 
familiar with HTML/CSS.

Pm



More information about the pmwiki-users mailing list