Source code

CERNY.js.doc.Generator

Generates documentation for a single script. The documentation should adhere to the rules presented by example in this file.

Used by

None

Functions

create

Create documentation for sourceCode.

sourceCode (string) : a string containing the source code to document
return (object) : an object conforming to CERNY.js.doc.Script
discoverPublicFunctions

Discover the public functions in the source.

return (Array) : an array of function names
extractFqName

Extract the fully qualified function name of the script. It depends on a CERNY.require statement, where the first parameter is the name of the current script.

return (string) : the fully qualified name of the script
extractFunctionComment

Extract the function comment for a function, in case it is public (starts with a slash followed by two asterisks.

extractFunctionDescription

Extract the description for a function. The description are all paragraphs from the function comment excluding the signature documentation.

functionName (string) : the name of the function for which to extract the description for
return (Array) : the description of the function
extractFunctionDocumentation

Extract the documentation for a function.

name (string) : the name (short or fq) of the function
return (object) : the function documentation, conforming to CERNY.js.doc.Function
extractFunctions

Extract the function documentations from the source code.

return (Array) : an array of objects conforming to CERNY.js.doc.Function
extractHistory

Extract the history from the source code. Cannot handle multiline entries yet.

return (Array) : an array of CERNY.js.doc.HistoryEntry
extractMethod

Extract the ...

functionName (string) : the name of the function
return (object) : an object ...
extractParameterDocumentation

Extract the documentation for a parameter.

functionName (string) : the name of the function the parameter belongs to
position (number) : the position of the parameter
return (object) : a parameter documentation conforming to CERNY.js.doc.Parameter
extractReturnValueDocumentation

Extract return value documentation.

functionName (object) : the name of the function the return value belongs to
return (undefined) : a return value documentation
extractSignature

Extract the signature for a function. The line might start with signature or CERNY.signature.

functionName (string) : the name of the function the signature belongs to
return (undefined,Array) : an array of strings
extractSignatureDocumentation

Extract the signature documentation for a certain function.

functionName (string) : the name of the function
return (undefined,Array) : an array of objects holding name and documentation
extractUses

Extract the dependecies of the script.

return (Array) : an array of expressions, that this file is dependant on

History

2007-05-17 : Refactored.
2006-11-04 : Created.

API Documentation for version

1.4

Scripts

Scripts

Generator Schema