[dokuwiki] Re: Building a book from DokuWiki

  • From: Chris Tapp <dokuwiki@xxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 28 Apr 2010 09:25:11 +0100

Note to the solution with include+odt:
I don't prefer the "include" tag to combine multiple wiki pages, because I need a "not-included" version in DokuWiki. I would like to define the book as a list with links to the wiki pages and have thus also in the Wiki. If I use a list, I must transform the links to "includes" before export. I need 2 wiki pages, one with listed links and second with "includes" (redundancy!) or the construction of the "include page" occurs in the background.

I modified the include plugin to include a new flag "no-expand" which makes nested includes become links instead of being processed. I then have a single page that includes all the sections of the book. I can then:

1) Include the page from an "editing" page and use the "no-expand" flag. This gives a page of links to the sections. 2) Include the page from a "view all" page without the "no-expand" flag. This allows the whole document to be viewed and exported to .odt. You don't even need to view this page to export the document, as you can create an export link to it from anywhere (e.g. http://wiki.somewhere.com/doku.php?do=export_odt&id=full_document_view ).

It may be better to use "no-expand" on any includes that bring in lots of content and allow a higher include to specify "force-expand" to override when producing the export.

The only issue I found with include is it's recursion protection, which prevents the same page being included more than once even if the includes aren't actually recursive. This isn't generally an issue, but it does mean you can't use the same page content for (say) a cover page (with a background image, perhaps) and an interior page (without the image). This can be fixed very easily by modifying the include recursion defense so that it uses a stack of nested included pages rather than a list. I should put some code together for the latest include plugin and offer it to the project.

Chris

--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: