Recent Changes
Recent Changes · Search:
 

I have a blog-style website that I wish to turn into a book. I have a (:pagelist:) directive that generates a sorted list of blog entries and want to typeset this as if it were a wiki trail. Is it possible to treat a dynamically-generated page list like a static trail for publishing purposes?

This recipe makes it relatively easy! It takes advantage of an option in the (:typeset-book:) directive that allows us to use a custom “extract trail stops” function to build our own trail.

  1. Download extract-pagelist.php Δ and put it in the cookbook/ directory.
  2. For the dynamic trail page, say called Journal.TrailPage, create a local/Journal.TrailPage.php file that contains:
    • include_once("$FarmD/cookbook/extract-pagelist.php");
  3. On Journal.TrailPage, add a (:pagelist:) directive using a format that returns a trail list, add (:typeset-book:) and save the page.

When you press the Typeset Book button, you should get a book of the blog.

The recipe extracts trail stops from the raw wiki markup returned by (:pagelist:) — that is, it looks for lines starting with list item markup (one or more * or # characters). This means wiki markup embedded in the pagelist format instructions is not processed. However, Page Lists often need conditional directives to produce the desired output. For example, the blog book may want to have a new chapter for each month, with a section for each day. So typically, pagelist format instructions contain one or more (:if:) directives. The recipe therefore processes any conditional text markup to create a list in the author’s expected format.

If the administrator needs other wiki markup rules to be interpreted before passing the list to the function that extracts trail stops, this will require a custom version of the recipe.

Contributors: John Rankin and Gustav Andersson, Friday, 21 November 2008.

« SVG Image Support | Cookbook | Typeset Trail of Trails »

Page last modified on 21 November 2008 at 09:22 AM