From the WikiPublisher

Wikipublisher: Customise

The Wikipublisher library supports all standard PmWiki markup, plus a number of markup extensions. Many site administrators will have taken advantage of the flexibility PmWiki offers and created local extensions to the standard markup. In most cases, such extensions will be ignored when typesetting a page, unless the extension author provides a wikibook-compliant alternate markup rule.

Wiki link format variables

The library provides alternate link and page list formats that are compatible with the Wikibook DTD and appropriate for print. Again, the administrator must make sure that local customisations do not over-write these with formats appropriate for XHTML. Wiki link presentation is controlled with the following variables:

    SDV($WPLinkPageExistsFmt, "\$LinkText<tbook:visual markup='sup'>" .
        " (<tbook:url name='\$LinkUrl'>w</tbook:url>)</tbook:visual>");
    SDV($WPLinkPageExistsAnchorFmt, 
        str_replace('>w<','>w#$LinkAnchor<',$WPLinkPageExistsFmt));
    SDV($WPLinkPageCreateFmt, 
        "\$LinkText<tbook:url name='\$PageUrl?action=edit'>" .
        '<tbook:visual markup="sup">?</tbook:visual></tbook:url>');

An administator can over-ride the default $WPLinkPage…Fmt values by setting replacement values in local/config.php before including the wikipublisher script library.

Url link format variables

A link to an external site is typeset to show the address in a footnote, as follows:

    $UrlLinkFmt = "<tbook:url name='\$LinkUrl'>\$LinkText</tbook:url>";
    $UrlLinkTextFmt = "<tbook:visual markup='sl'>\$LinkText</tbook:visual>".
        "<tbook:footnote>\$LinkUrl</tbook:footnote>";
    $UrlLinkFootnoteFmt = "<tbook:url name='\$PageUrl'>\$LinkText</tbook:url>";

An administator can over-ride the default $UrlLink…Fmt values by setting replacement values (inside an if ($format==‘pdf’) check) in local/config.php after including the wikipublisher script library. (Code needs tidying to use $WPUrlLink…Fmt variables.)

Local markup

Any additional markup rules will require both xhtml and wikibook xml versions. For example, suppose an administrator has created markup for the <b> and <i> xhtml tags, using

   Markup(“ ‘*”, ‘inline’, “/’\*(.*?)\*’/”, ‘<b>$1</b>’);
   Markup(“ ‘~”, ‘inline’, “/’~(.*?)~’/”, ‘<i>$1</i>’);

To make marked-up text appear correctly in a pdf, the administrator writes the following rules after loading the wikipublisher library (which sets $format) and before setting the html rules (so the pdf rules take priority):

   if ($format==‘pdf’) {
       Markup(“ ‘*”, ‘inline’, “/’\*(.*?)\*’/”, 
           ‘<tbook:visual markup=“bf”>$1</tbook:visual>’);
       Markup(“ ‘~”, ‘inline’, “/’~(.*?)~’/”, 
           ‘<tbook:visual markup=“it”>$1</tbook:visual>’);
   }

The scripts stdmarkup.php and altmarkup.php in the cookbook/wikipublisher/latex/ directory contain lots of examples. Together, they provide print support for all the standard markups defined in PmWiki plus the Cookbook:MarkupExtensions.

User Guide

Copyright © 2005–2017 the Wikipublisher wiki and its authors

Retrieved from http://www.wikipublisher.org/wiki/Wikipublisher/Customise

Page last modified on 21 November 2016 at 02:53 PM