DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:apidoc

APIdoc Plugin

Compatible with DokuWiki

No compatibility info given!

plugin Plugin for easy API documentation

Last updated on
2015-11-13
Provides
Syntax

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Tagged with apidoc

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 here, in the API Documentation (new) section..

To document a simple sample class:

<apidoc>
  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|
</apidoc>

Would render something like

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 apidoc 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

plugin/apidoc.txt · Last modified: 2018-05-04 21:20 by LarsDW223

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki