Reference Source Test
import ESDoc from 'esdoc2/out/src/ESDoc.js'
public class | source

ESDoc

API Documentation Generator.

Example:

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

Static Method Summary

Static Public Methods
public static

generate(config: ESDocConfig): *

Generate documentation.

Static Private Methods
private static

check esdoc2 config.

private static

generate index doc

private static

generate package doc

private static

show memory usage stat

private static

publish content

private static

resolve duplication docs

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

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

walk recursive in directory.

Static Public Methods

public static generate(config: ESDocConfig): * source

Generate documentation.

Params:

NameTypeAttributeDescription
config ESDocConfig

config for generation.

Return:

*

Static Private Methods

private static _checkOldConfig(config: ESDocConfig) source

check esdoc2 config. and if it is old, exit with warning message.

Params:

NameTypeAttributeDescription
config ESDocConfig

check config

private static _generateForIndex(config: ESDocConfig): Tag source

generate index doc

Params:

NameTypeAttributeDescription
config ESDocConfig

Return:

Tag

private static _generateForPackageJSON(config: ESDocConfig): Tag source

generate package doc

Params:

NameTypeAttributeDescription
config ESDocConfig

Return:

Tag

private static _memUsage(): undefined source

show memory usage stat

Return:

undefined

no return

private static _publish(config: ESDocConfig) source

publish content

Params:

NameTypeAttributeDescription
config ESDocConfig

private static _resolveDuplication(docs: Tag[]): Tag[] source

resolve duplication docs

Params:

NameTypeAttributeDescription
docs Tag[]

Return:

Tag[]

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 _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.