Home Manual Reference Source Test Repository
import ESDoc from 'esdoc/src/ESDoc.js'
public class | source

ESDoc

API Documentation Generator.

Example:

let config = {source: './src', destination: './esdoc'};
ESDoc.generate(config, (results, config)=>{
  console.log(results);
});

Static Method Summary

Static Public Methods
public static

generate(config: ESDocConfig, publisher: function(results: Object[], asts: Object[], config: ESDocConfig))

Generate documentation.

Static Private Methods
private static

_deprecatedConfig(config: *)

private static

_generateForTest(config: ESDocConfig, results: DocObject[], asts: AST[])

Generate document from test code.

private static

set default config to specified config.

private static

_traverse(inDirPath: string, filePath: string, packageName: string, mainFilePath: string): Object

traverse doc comment in JavaScript file.

private static

_traverseForTest(type: string, inDirPath: string, filePath: string): Object

traverse doc comment in test code file.

private static

Use built-in external document.

private static

_walk(dirPath: string, callback: function(entryPath: string))

walk recursive in directory.

Static Public Methods

public static generate(config: ESDocConfig, publisher: function(results: Object[], asts: Object[], config: ESDocConfig)) source

Generate documentation.

Params:

NameTypeAttributeDescription
config ESDocConfig

config for generation.

publisher function(results: Object[], asts: Object[], config: ESDocConfig)

callback for output html.

Static Private Methods

private static _deprecatedConfig(config: *) source

Params:

NameTypeAttributeDescription
config *

private static _generateForTest(config: ESDocConfig, results: DocObject[], asts: AST[]) source

Generate document from test code.

Params:

NameTypeAttributeDescription
config ESDocConfig

config for generating.

results DocObject[]

push DocObject to this.

asts AST[]

push ast to this.

private static _setDefaultConfig(config: ESDocConfig) source

set default config to specified config.

Params:

NameTypeAttributeDescription
config ESDocConfig

specified config.

private static _traverse(inDirPath: string, filePath: string, packageName: string, mainFilePath: string): Object source

traverse doc comment in JavaScript file.

Params:

NameTypeAttributeDescription
inDirPath string

root directory path.

filePath string

target JavaScript file path.

packageName string
  • optional

npm package name of target.

mainFilePath string
  • optional

npm main file path of target.

Return:

Object

return document that is traversed.

Return Properties:

NameTypeAttributeDescription
results DocObject[]

this is contained JavaScript file.

ast AST

this is AST of JavaScript file.

private static _traverseForTest(type: string, inDirPath: string, filePath: string): Object source

traverse doc comment in test code file.

Params:

NameTypeAttributeDescription
type string

test code type.

inDirPath string

root directory path.

filePath string

target test code file path.

Return:

Object

return document info that is traversed.

Return Properties:

NameTypeAttributeDescription
results DocObject[]

this is contained test code.

ast AST

this is AST of test code.

private static _useBuiltinExternal(results: DocObject[]) source

Use built-in external document. built-in external has number, string, boolean, etc...

Params:

NameTypeAttributeDescription
results DocObject[]

this method pushes DocObject to this param.

See:

private static _walk(dirPath: string, callback: function(entryPath: string)) source

walk recursive in directory.

Params:

NameTypeAttributeDescription
dirPath string

target directory path.

callback function(entryPath: string)

callback for find file.