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 38

Constructor

new LinkBuilder ( )

The constructor

Source : file LinkBuilder.js at line 134

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 171

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 214

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 250

Public methods

getClassLink ( className, rootPath )

Get the html link to a class file

Source : file LinkBuilder.js at line 149

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 327

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 189

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 307

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 294

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 159

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 204

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 238

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 66

#classesLinksCache : Array of Array of String

A cache for the classes links

Source : file LinkBuilder.js at line 59

#mdnLinks : Object

The links to the mdn documentation

Source : file LinkBuilder.js at line 87

#sourcesLinks : Map of String

The links to the sources files

Source : file LinkBuilder.js at line 52

#sourcesLinksCache : Array of Array of String

A cache for the sources links

Source : file LinkBuilder.js at line 45

#variablesLinks : Map of String

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

Source : file LinkBuilder.js at line 80

#variablesLinksCache : Array of Array of String

A cache for the variables links

Source : file LinkBuilder.js at line 73

Private methods

#getTypeLink ( type, rootPath )

Get the link to a type

Source : file LinkBuilder.js at line 268

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