[Pmwiki-users] PmWiki 2 questions

John Rankin john.rankin
Sun Sep 19 17:06:16 CDT 2004

Conversion of some PmWiki 1 cookbook recipes is progressing: wikilog works and publish mostly works.

PmWiki 2 is looking very good, but converting long customisation scripts is a challenge.

1. What is the preferred method for changing markup behaviour between browse and print/publish?

Specifically, I want to change the way trail markup is rendered on printable views. In the extendmarkup script, it's a simple 'if' (eg for insert and delete text, and breakpage), but what's the best way to do this with a standard markup element?

2. Is there any plan to reintroduce a PrintText function? (I have added this to PITS)

I have made my own which does an echo MarkupToHTML($pagename,$text);

Or is there another way to do this?

3. Is there a preferred method for extending the LinkPage and LinkIMap functions?

Specifically, I want to provide a different rendering for links that refer to the current page (self-references) and a tooltip on links to pages that start with ! or : ... : markup. This can be done, as long as one traps cases where MakeLink has been called with a $fmt set, for example to return the $PageName or $LinkText.

Similarly, I want to have a custom rendering of url links to provide a list of referenced links at the end of a published page collection. I think to do this easily I need $LinkImap to be a variable reference that I can reset. I think it also needs the url link format to be a variable.

4. ? and & in link references
The wikilog used to use [[ThisPage:?logdate=... ...]] and there was a configuration variable that changed this to ThisPage:&logdate=.... if necessary. Now I can write [[PageName&logdate=.... | ...]]

Do I still need to make this a & for sites that have page links of the form http:...?pagename=...

5. Has something changed in the way variables are handled?
I have been very lazy about initialising variables and checking whether they have been set before using them. Now I get a lot of notices about undefined variables. They all go away when I add code to set variables to '' or 0 or use an isset($variable) command.

While this has forced me to practice more disciplined coding which I'm sure is good for one's immortal soul, is this a deliberate change?

6. Is there a plan to support inline markups in link text? Should there be?
The page table of contents scripts from PmWiki 1 relied on another local customisation that handled inline markup in link text. That way, a heading that contains, say, italics markup appears correctly rendered in the contents list. As a bonus, [[{{some page}} a ''really'' interesting page]] also just worked.

How do I invoke processing of selected markups on link text in PmWiki 2?

John Rankin

More information about the pmwiki-users mailing list