[pmwiki-users] Re: commented version of wikistyles.php

Patrick R. Michaud pmichaud at pobox.com
Thu Oct 20 20:12:17 CDT 2005


On Fri, Oct 21, 2005 at 01:57:43PM +1300, John Rankin wrote:
> Patrick, would it be possible to release a version of 
> pmwiki that has comments in the wikistyles.php code? 
> PublishPDF keeps tripping over this and I'd like to 
> put some effort into sorting it out.

I'd love to comment wikistyles.php, but I have no clue
how it works.

... just kidding!  Yes, I'll write up some detailed comments,
either in the file itself or as a page on pmwiki.org.

> Specifically, the following is an example of the kind 
> of thing we need to do (from Basic Editing):
> 
> >>purple<<
> All of the text in this block
> is purple.
> * Purple cow
> * Purple people eater
> >>red<<
> * Now this list is red
> >><<
> * And this is normal
> 
> We are trying to translate this into:
> 
> <p><style color='#800080'>All of the text in this block
> is purple.
> </style></p><itemize><item><style color='#800080'>Purple cow
> </style></item><item><style color='#800080'>Purple people eater
> </style></item><item><style color='#FF0000'> Now this list is red
> </style></item><item>And this is normal
> </item></itemize> 

I never envisioned wikistyles as repeating themselves throughout
their contents as you've given above (and wikistyles apply on
a line-by-line basis), so I suspect a totally different algorithm 
will be needed for this.  

It almost sounds like the distribution ought to be done as
a post-processing rule (after all of the markup has been processed),
rather than performing them inline.  Then any pattern matching

    <div style='color:#800080'>
    ...
    </div>

would be transformed to put <style color='#800080'> around the text of
all of the blocks that occur within the <div>.  Or something like
that.

> By comparison, the xhtml is:
> 
> <p style='color: purple;' >All of the text in this block
> is purple.
> </p><ul><li style='color: purple;' >Purple cow
> </li><li style='color: purple;' >Purple people eater
> </li><li style='color: red;' > Now this list is red
> </li><li>And this is normal
> </li></ul>

Is this the xhtml that your extensions are producing?  I would
expect PmWiki to produce:

<div style='color:purple'>
<p>All of the text in this block
is purple.
</p><ul><li>Purple cow
</li><li>Purple people eater
</li></ul></div><div style='color:red'>
<ul><li>Now this list is red
</li></ul></div>
<ul><li>And this is normal
</li></ul>

> Some comments in the code would be a great help, or
> even just a few hints for the bewildered.

I'll do my best.

Pm




More information about the pmwiki-users mailing list