s |
focus search bar ( enter to select, ▲ / ▼ to change selection) |
g a |
go to api |
g e |
go to examples |
g g |
go to guides |
h |
toggle this help ( esc also exits) |
lsdoc follows familiar JavaDoc and ASDoc conventions for parsing api documentation from metadata inside documentation comment blocks.
Source code is described in a documentation comment block (a multi-line comment beginning with two asterisks: /** ... */
) on the line above the subject:
/**
Main description.
Additional description.
@param baz parameter description
@return Return value description
*/
public function bar(baz:String):Vector.<Bat> {}
The first line in a doc comment forms the main description. Additional descriptive lines fill out the detailed description. Conventionally in generated documentation, main descriptions are rendered where a short form is necessary, and detailed descriptions are included where a long form is appropriate.
To include code snippets in documentation comments, use the fenced markdown syntax (with optional language hint) within the documentation comment:
/** Main description. Additional description, with code snippet ```as3 var f:Foo = new Foo(); for each(b:Bar in f) { ⇥//... } ``` */
The following constructs can be documented in LoomScript:
construct | syntax |
---|---|
Types | class , interface , struct |
Methods | function , delegate , operator |
Properties | get , set |
Fields | var , const |
Tags supported by lsdoc start with the at sign (@
) followed by a key, a space, and value: @key value
.
Tags must always be on their own line. Each tag is described in more detail in the following sections.
tag | syntax | effect |
---|---|---|
copy | @copy <source> |
duplicates the description from a named source |
deprecated | @deprecated <since-version> |
marks the subject with a deprecated label |
param | @param <description> |
adds a parameter description to the method details table |
return | @return <description> |
adds a returns description row to the method details table |
see | @see <target> |
creates a hyperlink to the specified target url |
Usage: @copy <source>
Re-use a description already defined by <source>
, e.g. from an interface, or a parent class.
The source value must be a fully qualified package (e.g. example.ExampleSuperClass
), with a member named identically to the documentation subject.
/**
@copy example.ExampleSuperClass#parent_field
Additional doc comments (optional)
*/
public var my_field:String = 'foo';
Usage: @deprecated <since-version>
Mark the documentation subject with a deprecated label.
/**
@deprecated v2.1.3
*/
public function get legacy_property():String;
Usage: @param <name⎵description>
Describe a method parameter. Include one @param
line for each parameter.
The parameter name is expected as the first part of the description, separated from the rest by a single space.
/**
@param param1 The first parameter
@param rest Optional additional params
*/
public function my_method(param1:String, ...rest):void;
Usage: @return <description>
Describe the return value.
/**
@return A `Dictionary` of `String` keys and `Number` values.
*/
public function get templated_property():Dictionary.<String,Number> { return null; }
Usage: @see <target>
Create hyperlinks to members, types, and general web targets.
Use an octothorpe (#
) to specify a member of a type.
If a fully qualified type is not provided, the current type is assumed.
/**
@see #localMethod
@see example.ExampleInterface
@see example.ExampleInterface#method
@see http://foo.bar.baz
*/
Compare the source code files included with the lsdoc library and the resultant documentation on this site:
lsdoc
2018 pixeldroid
https://github.com/pixeldroid/lsdoc |
programming pages theme v0.5.10 (https://github.com/pixeldroid/programming-pages) |
s |
focus search bar ( enter to select, ▲ / ▼ to change selection) |
g a |
go to api |
g e |
go to examples |
g g |
go to guides |
h |
toggle this help ( esc also exits) |