The output routines in lib/weblib.php should pass their output through the plug-ins, if they exist. These plug-ins could then parse the output and make conversions. I have the following applications in mind:
1) a Glossary/Dictionary that scans the output for words for which it has definitions and automatically links them to the entries.
2) Mathematics: we mathematicians like to use a specialized syntax (TeX) for writing formulas. The plugin would convert this mark-up to MathML for display in the browser.
Can anyone else think of a reason why they might want Moodle to give them the possibility to parse through the output before it reaches the page?
Actually, there is already a hook in place for the library add-on - it's simply a matter of expanding the concept to make it support arbitrary numbers of plugins efficently. The existing text filtering that happens (eg text-to-html, wiki-to-html etc) can also be integrated into the same pipeline as standard modules.
This is a must-have improvement in my view. I'd like to see a filter for linking to resources, user names etc, and maybe one day a language-translation plugin.
What I am not so clear about in my head is how to daisy-chain the various filters? So for example I may want my forum posts to go through BOTH the text-to-html filter AND the mathematics filter. But of course I don't want them to go through both the text-to-html and the wiki-to-html filter.
I know about XSL, I'm just having trouble thinking of a practical use for it in this case.
In a demo tool called Toot-O-Matic (with limited functionality ) created by IBM , you have to create the pages with pictures in an XML-tree. I show teachers the working demo in this order:
- Visit first the created webpages on a webserver
- then show them that the same pages are stored under a button on the HTML-pages as PDF
- also show that the set of HTML-pages is stored as a ZIP under another button
- then show them the XML-tree and point to the structure they saw on the website
- then change for example the name of the author (the demo has bugs like line max=80)
- then recompile...
- SHOW that all the resources: the HTML, the PDF and the set in the ZIP are changed!!
For the first time they undestand how powerfull XML can become for education
Old review of TOM:
http://www.techwr-l.com/techwhirl/archives/0110/techwhirl-0110-01594.html
The IBM resource:
http://www-106.ibm.com/developerworks/xml/library/x-toot/index.html
The next step is a matter of giving up flexibilty: If you accept that a resource could have a preformatted book-a-like structure, you could place a set of fill-in pages on top of this kind of toot-o-matic idea and then generate a PDF, together with a set of HTML files, all together stored in a zip file and easy to upload and unzip in the resources area
Would be nice to fill these pages and then let Moodle put all the parts on the right place..