Search: Turn search results into a printed report
How can we use pagelist directives to create a flexible typeset-on-demand service?
Calligraphy from the 8th and 9th century
PmWiki’s pagelist directive is a powerful and flexible search system. One of the things we sometimes want to do is let a reader turn selected search results into a typeset report. Wikipublisher includes a special format option to do this, shown in Publish selected search results.
Publish selected search results
The first part of the directive is standard pagelist options: look for “citation” on pages in the current group, omitting the usual suspects like the Recent Changes page. The final option, fmt=custom, tells pagelist to use the special “custom” format included with Wikipublisher. This turns the output into a form, with a checkbox against each page found that meets the search criteria. In the PDF view of the page, in place of the form the results list reverts to the default definition list format.
The PDF version is currently formatted using the “report” template, which produces a fair bit of nice looking, but uninteresting, front matter before the actual content. A good case can be made that printed search results would be more useful if presented using the “article” template, which omits the cover pages and cuts straight to the chase. Perhaps this could become a configuration option in a future release.
The form feature uses PmWiki’s now-deprecated transitional “fplbygroup” function, rather than the preferred template and markup-based approach described in Page Lists. This is because the code pre-dates the template feature and we haven’t yet worked out how to:
This is left as an exercise for the interested reader.
Category: navigation aid