Description
It would be useful if a series of wiki pages could be exported as a single DocBook file (book). For that purpose, a certain type of page could be created that represents the table of contents of the project as a nested list of links to the individual wikipages that are to be part of the book. This would to some degree resemble the functionality to the *Group pages. All links to pages that are not listed on the project page should be removed from the resulting DocBook file. Here is an example of how this could look like:
#docbook author Michael Kaiser #docbook dedication To my parents = On Nature = The mares, which carry me as far as my heart desires, were escorting me. They brought and placed me upon the well-spoken path of the Goddess, which carries everywhere unscathed the mortal who knows. Thereon was I carried, for thereon the wise mares did carry me, straining to pull the chariot, with maidens guiding the way. The axle, glowing in its naves, gave forth the shrill sound of a musical pipe, urged on by two rounded wheels on either end, even whilst maidens, Daughters of the Sun, were hastening to escort me, after leaving the House of Night for the light, having pushed back the veils from their heads with their hands. * [:/Introduction: Introduction] * [:/ChapterOne: Chapter 1] * [:/ChapterTwo: Chapter 2] * [:/ChapterTwoOne: Chapter 2.1] * [:/ChapterTwoTwo: Chapter 2.2] * [:/AndSoOn: And so on] * [:/Appendix: Appendix]
Then there should be a tool (lets call it docbook-export) that creates an proper DocBook file that includes all the pages given in the table of contents (i.e. nested list) on that project page.
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> <book> <title>On Nature</title> <bookinfo> <author><firstname>Michael</firstname><surname>Kaiser</surname></author> </bookinfo> <dedication> <para> To my parents </para> </dedication> <preface><title>Preface</title> <para> The mares, which carry me as far as my heart desires, were escorting me. They brought and placed me upon the well-spoken path of the Goddess, which carries everywhere unscathed the mortal who knows. Thereon was I carried, for thereon the wise mares did carry me, straining to pull the chariot, with maidens guiding the way. The axle, glowing in its naves, gave forth the shrill sound of a musical pipe, urged on by two rounded wheels on either end, even whilst maidens, Daughters of the Sun, were hastening to escort me, after leaving the House of Night for the light, having pushed back the veils from their heads with their hands. </para> </preface> <chapter><title>Chapter 1</title> <para> Include the \ChapterOne page here </para> </chapter> <chapter><title>Chapter 2</title> <para> Include the \ChapterTwo page here </para> <sect1><title>Chapter 2.1</title> <para> Include the \ChapterOne page here </para> </sect1> <sect1><title>Chapter 2.2</title> <para> Include the \ChapterOne page here </para> </sect1> </chapter> <chapter><title>And so on</title> <para> Include the \AndSoOn page here </para> </chapter> <appendix><title>Appendix</title> <para> And finally, include the \Appendix page. </para> </appendix> </book>
This feature would be of interest for users that want to create and maintain larger technical documents (manuals etc.) in a wiki since they are usually spread over several wiki pages but need to go into one file when they are published. This could also be extended to the export LaTeX files and other means of structured documents as well.
- Can you create a minimal example of such project? one project page with links to other pages or sub pages, then two or three minimal pages with real working docbook code. Also create an example of the complete document from these sources.
We already have such possibility. You can create page and include other pages using macro 'Include'. Patch which allows this should be on the way to the new release (I've send it to Alexander Schremmer), if you are intrested I can send you patch against 1.3.5. -- Petr Pytelka, pyta@lightcomp.cz --
- BTW, I am currently moving house and therefore without Internet and enough free time mostly, but I will merge it into 1.5 before it will be released.
Done. What the Include macro does (as far as I know) is actually including the subpages, also in the wikipages. In my case that would generate huge wiki pages (as the page \ChapterTwo would display the contents of \ChapterTwoOne and \ChapterOneTwo and all the levels below) that become quite unhandy. Also changing the order is much more complex as you have to edit the actual pages and subpages and modify the Include statements whereas in my solution there would be a single page which holds all the information concering the actual sequence. Last but not least, the current DocBook export generates <article>s which IMHO are rather uncommon. You can include them in a <book> but this is more like a hack than a clean solution. -- Michael Kaiser
Articles are not uncommon for me. -- EduardoMercovich 2005-10-14 16:03:01
I plan on starting the implementation of this feature. Are there any suggestions about what is the best way in MoinMoin to get the described features? I figure I have to write a formatter, but are there any special tricks, that could help me to get that going?
-- Michael Kaiser
It is not clear that you need a formatter. Writing an action might be simpler and more straightforward in this case (of course you will need to modify the existing DocBook formatter.)
There is already a docbook parser/formatter. I'm not sure how docbook formatting should work, but you need code that iterate over the pages in the "project" page, then either render all of them and send combined output, or maybe compile all of them into one source and format it.
If the needed output is multiple rendered documents, you can collect all of them into a compressed tar file on the fly, and send the tarball file to the browser, see WikiBackup action.
WikiBackup can render multiple pages and transmit the rendered output file?
This will be solved as part of my SummerOfCode project: http://fedoraproject.org/wiki/SummerOfCode/2006/MikkoVirkkil%C3%A4 -- Mikko Virkkilä