Documentation/Dashboard/Wiki Books
From OpenOffice.org Wiki
This page is currently being edited Fpe 17:00, 13 November 2007 (CET)
Wiki Books Project
The objective of this project is to implement a solution that allows compilations of wiki pages to be exported as books in ODF and/or PDF.
Steps
Define a sequence of wiki pages to make up a book
The documentation wiki makes use of TOC templates to define a wiki book.
Export wiki pages
This includes recursively parsing the pages referenced by the main TOC (for sub-TOCs) and remembering the page level for later heading adjustments. Transcluded content needs to be resolved.
The wiki page needs to be fetched as wiki text, not rendered HTML. This can either be done using the mediawiki api.php or the export page. Note, that both pages use a different XML wrapper for the output.
parse(mainTOC)
sub parse(TOC)
load(TOC)
foreach entry(TOC)
parse(entry)
if contains(subTOC)
level++
parse(subTOC)
endif
resolvetransclusions
endfor
endsub
Fetching a page using the api
/api.php?action=query&titles=$pagename&prop=revisions&rvprop=content
Fetching a page using the Export function
/wiki/Special:Export/$pagename

