Recent Changes · Search:

Support the Project

Wikipublisher

PmWiki

edit SideBar

 

If a book contains a link to another page in the same book, Wiki Publisher automatically creates an intra-book reference to the page number of the referenced page. However, if the book contains a link to a page in a different book, Wikipublisher creates a link to the corresponding web page. When using Wikipublisher to produce several books in PDF, there can be a need to provide links from one book to another. This recipe provides a way to link to a page in a different PDF, rather than linking to the web address of the page.

Download bookxref.php Δ and install it in the pmwiki/cookbook/ directory. Then add the following code to local/config.php, after loading the wikipublisher extensions:

    include_once("$FarmD/cookbook/bookxref.php");

This adds a new intermap rule for Book:Bookpage#Page. The “Bookpage” is the pagename on which the author has listed the pages in the target book and the “Page” is the pagename in Bookpage being referenced. The recipe looks up “Page” on “Bookpage” and works out the anchor which Wikipublisher automatically assigns to it, of the form “wikipublisher.id”. In the PDF, it generates a link to “Bookpage.pdf#wikipublisher.id” with “Page” as the link text.

If “Page” omits the Group prefix, the recipe adds the Bookpage group name. If “Bookpage” omits the Group prefix, the standard PmWiki rules for assigning a Group apply. If the author writes Book:Bookpage#Page, the recipe generates a link to Bookpage.pdf. If the author writes Book:Group.Bookpage#Page, the recipe generates a link to Group.Bookpage.pdf.

The recipe works in theory and generates the expected Wikibook XML, but it awaits testing.

Contributors: John Rankin and Jeff Levinger, Sunday, 13 September 2009.

« Image Auto Resizing | Cookbook | One Click PDF »

Creative Commons License
Edit · History · Print · Recent Changes · Search · Links
Page last modified on 13 September 2009 at 04:50 PM