[Pmwiki-users] Publishing a WikiTrail (or a WikiBook)

Patrick R. Michaud pmichaud
Sun Aug 3 18:47:57 CDT 2003


On Mon, Aug 04, 2003 at 10:29:28AM +1200, John Rankin wrote:
> 
> Pressing Publish causes PmWiki to display the content of all the pages 
> on the trail, formatted for printing, as a single page. It also uses 
> the trail sequence and indentation to assign numbers to each page title.

Whoa, cool.  I had thought about displaying the contents of all of the
pages, but having it use the indentation for numbered page titles is
really cool.  :-)

> The script uses an array of
>   wiki:page1 page2 ...
> constructs to generate the set of pages to be displayed. The "page1" 
> becomes the stopname.
> 
> 1. It would be nice to tell PmWiki that "if this page doesn't exist, 
> output the default text". Right now, if the page doesn't exist, it 
> outputs nothing, so I have to do a check for page existence and 
> either output "wiki:stoppage" or "Describe <a ... /a> here."
> 
> The best idea I could come up with is 
>   wiki:page1 page2 ... ?

Could instead you do an array of 
   "wiki:page1 Main.PrintNonExistent", 
   "wiki:page2 Main.PrintNonExistent", 
   "wiki:page3 Main.PrintNonExistent",
    ...
The contents of Main.PrintNonExistent would then be displayed for any page
that didn't exist in the trail.  (Or is this what you're doing already?)

> 2. The <<|trail|>> and <|trail|> markup interpretation gets led astray. 
> Because $pagename is the name of the trail page, the trail markup returns 
> "<<|trail|>>" or "trail", unless the trail page is itself in the list. 
> I couldn't decide what was the best solution, so I made 2 adjustments to 
> the trails script.

Instead of adjusting the trails script, how about disabling the trail 
markups?  Just do
    unset($DoubleBrackets["/&lt;&lt;\\|($TrailLinkPattern)\\|&gt;&gt;/e"]);
    unset($DoubleBrackets["/\\^\\|($TrailLinkPattern)\\|\\^/e"]);
    unset($DoubleBrackets["/&lt;\\|($TrailLinkPattern)\\|&gt;/e"]);

Alternately, you could use the $DoubleBrackets array to display the trail
markup however you wish.

> 3. This is very, very minor. I found myself wanting to adjust the 
> <hr> size attribute in the GroupPrintHeader. To be consistent with 
> other PmWiki conventions:
> -
> --
> ---
> ----
> and so on woould produce lines of size 1, 2 3, 4 and so on. But that loses backward compatibility. Instead, how about:
> ----n
> producing
> <hr size='n' noshade='on' />

Hmm.  Maybe we could add or insert the following to $InlineReplacements:

    "/^----+(\d+)/" => "<hr size='$1' noshade='on' />"
  
Pm 



More information about the pmwiki-users mailing list