====== APIdoc Plugin ====== ---- plugin ---- description: Plugin for easy API documentation author : Marcus Runsten email : marcus.runsten@stilit.se type : syntax lastupdate : 2015-11-13 compatible : depends : conflicts : similar : tags : apidoc downloadurl: http://www.stilit.se/?smd_process_download=1&download_id=120 bugtracker : sourcerepo : donationurl: screenshot_img : http://www.stilit.se/wp-content/uploads/2015/11/apidoc.png ---- ===== Installation ===== Simply unpack the .tgz file into the lib/plugins directory of your DokuWiki. Didn't like the plugin? Just delete the apidoc folder from the lib/plugins and it's all undone. ===== Examples/Usage ===== See the plugin in action [[http://vortex.stilit.se/wiki/doku.php?id=vortex:api|here]], in the API Documentation (new) section.. To document a simple sample class: CLASS|TestKlass|/classes/test.php|[[http://www.stilit.se]] test|This is just a class for testing the APIDoc DokuWiki plugin.| FIELD|VAL|const VAL = 0x001;|A constant just for testing| METHOD|constructor|public function __construct()|Test|test METHOD|get|get( $name ) {test;}|A string containting the requested value or null if not available|Returns the requested field from the testclass| PARAMETER|$name|String||The name of the field to get| PARAMETER|$atest|Integer||A test for sorting| METHOD|atest|public function atest()|A test for sorting "strings here" or "strings there"|Test just| FIELD|XTAL|const XTAL[test] = 0x002|A test for sorting| FIELD|TEST|const TEST = 0x004|A test| Would render something like {{http://www.stilit.se/wp-content/uploads/2015/11/screenshot_apidoc_1.1.png}} ===== Syntax ===== The syntax of the parsed data is a keyword, followed by a set of parameters separated by the | character. The following keywords and parameters are currently supported. * CLASS * ClassName - the name of the documented class * FileName - the path to the file where the class is implemented * Extends - list of classes and interfaces that this class extends or implements * Description - elaborate description of this class * FIELD * FieldName - the name of the field, usually only publically accessable fields are documented * Definition - a code snippet showing how this field is declared * Description - elaborate description of this field * METHOD * MethodName - name of the method * Definition - a code snippet showing how this field is declared * Returns - type and description of what this method returns * Description - elaborate description of this method * PARAMETER * ParameterName - name of the parameter * ParameterType - type of this parameter * Default value - default value, if any * Description - elaborate description of this parameter **OBSERVE** The CLASS keyword can occur only once, and must be the first keyword in the dataset. \\ The PARAMETER keyword is used to document a parameter associated with a method. This keyword needs to be superceded by a METHOD keyword or an error will be raised. All parameters will be associated with the last previously defined method. ===== Configuration and Settings ===== No configuration needed. ===== Development ===== === Change Log === * **2015-11-10** * Version 1.0: Initial version released * **2015-11-12** * Version 1.1: Added [[]] link parsing and implemented better keyword parsing, now keywords can be left out === Known Bugs and Issues === None at the moment === ToDo/Wish List === Todo: * Add a Throws parameter to the METHOD keyword ===== FAQ =====