Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate mediawiki-ready documentation from reflection and xml comments

Could someone suggest a good workflow that,

  • Independently on the number of disparate tools that could be required
  • and how much manual work would have to be performed,

could allow me to incorporate my project documentation (reflection + xml comments) into mediawiki syntax, which I would then use to incorporate on my development team wikia?

like image 917
Alexandre Bell Avatar asked Jun 22 '11 00:06

Alexandre Bell


1 Answers

There is going to be some manual labor involved, but it should be doable using the resources outlined below.

My first thought was just doing some googling, by which I came across http://www.mediawiki.org/wiki/Alternative_parsers. All of these parsers seem to take data and convert it to XML, not from XML, also none of them are .NET based, which may not be super important in the long run if no coding had been involved. Who knows though, there may be something here worth looking at.

Then I found http://www.mediawiki.org/wiki/Manual:Importing_XML_dumps. I figure if you can import data in an XML format then all you really need to know is what the schema is so that you can reformat your data in the appropriate way. The best thing is that this page has a link to http://www.mediawiki.org/wiki/Manual:XML_Import_file_manipulation_in_CSharp, a C# example of how to work with Media Wiki XML Import files. Given the example it seems like only a small step to create the classes required for generating the required xml from scratch and dumping your data in. Here is a link to the official schema documentation: http://www.mediawiki.org/xml/export-0.3.xsd.

Depending on whether you want to write PHP or not another option presents itself. You could write an XMLTransform Extension, as talked about here: http://www.ehartwell.com/TechNotes/MediaWikiXmlExtension.htm. This site seems to say that you could keep your XML in it's native format and write a custom XSL sheet to display the contents in the desired format.

Good luck!

like image 125
Peter Avatar answered Sep 28 '22 01:09

Peter