Class LinkBuilder

Store all the links created from the source document and get the links completed with the path for others classes

Source : file LinkBuilder.js at line 36

Constructor

new LinkBuilder ( )

The constructor

Source : file LinkBuilder.js at line 128

Public getters and setters

readonly get classesLinks : Array of Array of String

Get all the classes links. Each subAray contains the class name and the class link.

Source : file LinkBuilder.js at line 165

readonly get sourcesLinks : Array of Array of String

Get all the sources links. Each subAray contains the source file name and the path between theConfig.destDir and the source file, included file name

Source : file LinkBuilder.js at line 207

readonly get variablesLinks : Array of Array of String

Get all the variables links. Each subAray contains the variable name and the variable link.

Source : file LinkBuilder.js at line 233

Public methods

getClassLink ( className, rootPath )

Get the html link to a class file

Source : file LinkBuilder.js at line 143

Parameters

Name Type Description
className String

The name of the class for witch the link must be created

rootPath String

The path between the file where the link will be inserted and theConfig.destDir ( something like '../../../', depending of the folders tree )

Returns

An html string with the link or the className when the link is not found
Type : String

getDescLink ( desc, rootPath )

Add links to a description

Source : file LinkBuilder.js at line 310

Parameters

Name Type Description
desc String

The description to complete with links

rootPath String

The path between the file where the link will be inserted and theConfig.destDir ( something like '../../../', depending of the folders tree )

Returns

The description completed with html links
Type : String

getSourceLink ( doc )

Get a link to a source file

Source : file LinkBuilder.js at line 183

Parameters

Name Type Description
doc VariableDoc or MethodOrPropertyDoc or VariableDoc

The doc for witch the link to the source file must be created.

Returns

The link to the source file
Type : null or String

getTypeLinks ( type, rootPath )

Get the links to a type

Source : file LinkBuilder.js at line 290

Parameters

Name Type Description
type String

The types for witch the link must be created. Can be multiple word

rootPath String

The path between the file where the link will be inserted and theConfig.destDir ( something like '../../../', depending of the folders tree )

Returns

The html links to the types. We search first in the classes links, then in the mdn links. If nothing found, the types without html link is returned.
Type : String

isKnownType ( type )

Verify that a given type is a known type ( = present in the

Source : file LinkBuilder.js at line 277

Parameters

Name Type Description
type String

The type to verify

Returns

True when the type is known
Type : Boolean

setClassLink ( classDoc )

Store a link to a class file

Source : file LinkBuilder.js at line 153

Parameters

Name Type Description
classDoc ClassDoc

The doc with the class documentation

setSourceLink ( fileName, path )

Store a link to a source file

Source : file LinkBuilder.js at line 197

Parameters

Name Type Description
fileName String

The file name

path String

The path since theConfig.destDir, included file name

setVariableLink ( variableDoc )

Store a link to a variable in the variables.html file

Source : file LinkBuilder.js at line 221

Parameters

Name Type Description
variableDoc VariableDoc

The doc with the variable documentation

Private properties

#classesLinks : Map of String

The links to the classes files

Source : file LinkBuilder.js at line 64

#classesLinksCache : Array of Array of String

A cache for the classes links

Source : file LinkBuilder.js at line 57

#mdnLinks : Object

The links to the mdn documentation

Source : file LinkBuilder.js at line 85

#sourcesLinks : Map of String

The links to the sources files

Source : file LinkBuilder.js at line 50

#sourcesLinksCache : Array of Array of String

A cache for the sources links

Source : file LinkBuilder.js at line 43

#variablesLinks : Map of String

The links to the variables file and the variables in the file

Source : file LinkBuilder.js at line 78

#variablesLinksCache : Array of Array of String

A cache for the variables links

Source : file LinkBuilder.js at line 71

Private methods

#getTypeLink ( type, rootPath )

Get the link to a type

Source : file LinkBuilder.js at line 251

Parameters

Name Type Description
type String

The type for witch the link must be created. Must be a single word

rootPath String

The path between the file where the link will be inserted and theConfig.destDir ( something like '../../../', depending of the folders tree )

Returns

The link to the type. We search first in the classes links, then in the mdn links. If nothing found, the type without html link is returned.
Type : String