Hi,
Just a quick notice, letting you know I'm currently working on a bot that get's documentation from the PHP classes (required rights, must be posted, parameter optional/required + description, examples etc.) into wikitext and saving to a wiki page.
Zak originally created something for this (example), but the source code remains unpublished and the format has changed a lot since then.
Roughly what I've got / aiming for (about 50% done)
- Extract module name/class pairs from
$mainApi = new ApiMain
- Loop over and instantiate it:
$module = new $class( $mainApi, $name );
- Buid a documentation page in wikitext format:
new ApiDoc4Wikitext( $module );
- {{API-head}} with parameter values from
getModulePrefix
,mustBePosted
etc. - Parameter section build with a function based on
makeHelpMsgParameters
but in wikitext format - Examples section based on array from
getExamples
, which is then dissected into parts for {{ApiEx}}, followed by an http request to exampleurl+format=xmlfm and output cleaned up and unescaped and fed to result-parameter of {{ApiEx}}. - Categories
- {{API-head}} with parameter values from
- Either write wikitext to a file and let another bot save to wiki, or write a simple wikibot and save right away.
To be done:
- Example section
- Saving mechanism
Any ideas / existing code I can look at ?