Dokuwiki as Document Manager using export_xhtmlbody

So, it seems I may be able to use Dokuwiki, at least to edit the documents, after all.

I’ve become aware of the “?do=export_xhtmlbody” command which can be added to any DokuWiki link. This allows me to view the body of a DokuWiki document as XHTML. This uses <h3> for the Creole plugin’s === header, for example. From that point I can just read the XML-whatever into an array and process it.

The PHP script will work by loading the export_xhtmlbody version of the site, the name of which can be derived from the part of the bible being read (ex. “Genesis 1:20” could work out to loading the genesis_1 page. Then it will process the XHTML into an array, then look for special heading names like “Notes”, “Cross-Reference” or “Genesis 1”. It will then output the document in a custom layout — anything is possible now, collapsible commentary, or any custom layout template. The end goal is to have the load and process in a series of functions which will then import a layout template, so that users can select their favourite view for reading the Bible; change the font, colors, text size, and so forth. Enable/disable red or blue letters, italics, hide notes, view commentary in-line or in a column, and so forth. Those will be analyzed from the <h2> tags. It should be relatively straightforward; and, if I wanted to use a Database anyways, this would be a great time to import/update whatever was needed into the database!

That was actually surprisingly easy. I don’t need a custom CRUD application after all! It can all work automatically. In fact, this could be a back-end script, which creates pre-rendered (static) pages. This would be useful if the site becomes really popular because then the pages would be cached. Since I am processing search results into a standard format, even search results could be cached, that is, at least the more popular ones. And I am just sitting here dreaming of all the statistics I can collect and analyze over this, such as what the most popular bible verses are, or the other possibilities, such as a fuzz/ai question script that lets users ask questions about the Bible and produces answers in the form of verses. There are a lot of possibilities here.

And if I don’t have Dokuwiki, I can use my own custom XML format to organize the data from text documents, and the program will still work. Not a bad solution.

Leave a Reply

Your email address will not be published.