Home Manual Reference Source Test Repository
public class | source

DocBuilder

Builder base class.

Constructor Summary

Public Constructor
public

constructor(data: Taffy, config: ESDocConfig)

create instance.

Member Summary

Private Members
private

_config: *

private

_data: *

Method Summary

Public Methods
public abstract

exec(callback: function)

execute building output.

Private Methods
private
this method was deprecated.

build coverage html.

private

build deprecated html.

private

build detail output html by docs.

private

_buildDetailHTML(doc: DocObject, kind: string, title: string, isStatic: boolean): string

build detail output html by parent doc.

private

_buildDocLinkHTML(longname: string, text: string, inner: boolean, kind: string): string

build html link to identifier.

private

_buildDocsLinkHTML(longnames: string[], text: string, inner: boolean, separator: string): string

build html links to identifiers

private

build experimental html.

private

build html link to file page.

private

build common layout output.

private

build common navigation output.

private

build method of ancestor class link html.

private

_buildProperties(properties: ParsedParam[], title: string): IceCap

build properties output.

private

build identifier signature html.

private

_buildSummaryDoc(docs: DocObject[], title: string, innerLink: boolean): IceCap

build summary output html by docs.

private

_buildSummaryHTML(doc: DocObject, kind: string, title: string, isStatic: boolean): string

build summary output html by parent doc.

private

build html link of type.

private

_find(cond: ...Object): DocObject[]

find doc object.

private

_findAccessDocs(doc: DocObject, kind: string, isStatic: boolean): Array[]

find doc object for each access.

private

_findAllIdentifiersKindGrouping(): {class: DocObject[], interface: DocObject[], function: DocObject[], variable: DocObject[], typedef: DocObject[], external: DocObject[]}

find all identifiers with kind grouping.

private

_findByName(name: string, kind: string): DocObject[]

fuzzy find doc object by name.

private

_getBaseUrl(fileName: string): string

get base url html page.

private

_getInfo(): {title: string, version: string, url: string}

get target's essential info.

private

get file name of output html page.

private

get output html page title.

private

gat url of output html page.

private

_orderedFind(order: string, cond: ...Object): DocObject[]

find doc objects that is ordered.

private

read html template.

Public Constructors

public constructor(data: Taffy, config: ESDocConfig) source

create instance.

Params:

NameTypeAttributeDescription
data Taffy

doc object database.

config ESDocConfig

esdoc config is used build output.

Private Members

private _config: * source

private _data: * source

Public Methods

public abstract exec(callback: function) source

execute building output.

Params:

NameTypeAttributeDescription
callback function

is called with some data.

Private Methods

private _buildCoverageHTML(coverageObj: CoverageObject): string source

this method was deprecated.

build coverage html.

Params:

NameTypeAttributeDescription
coverageObj CoverageObject

target coverage object.

Return:

string

html of coverage badge.

private _buildDeprecatedHTML(doc: DocObject): string source

build deprecated html.

Params:

NameTypeAttributeDescription
doc DocObject

target doc object.

Return:

string

if doc is not deprecated, returns empty.

private _buildDetailDocs(docs: DocObject[], title: string): IceCap source

build detail output html by docs.

Params:

NameTypeAttributeDescription
docs DocObject[]

target docs.

title string

detail title.

Return:

IceCap

detail output.

private _buildDetailHTML(doc: DocObject, kind: string, title: string, isStatic: boolean): string source

build detail output html by parent doc.

Params:

NameTypeAttributeDescription
doc DocObject

parent doc object.

kind string

target kind property.

title string

detail title.

isStatic boolean
  • optional
  • default: true

target static property.

Return:

string

html of detail.

private _buildDocLinkHTML(longname: string, text: string, inner: boolean, kind: string): string source

build html link to identifier.

Params:

NameTypeAttributeDescription
longname string

link to this.

text string
  • optional

link text. default is name property of doc object.

inner boolean
  • optional
  • default: false

if true, use inner link.

kind string
  • optional

specify target kind property.

Return:

string

html of link.

private _buildDocsLinkHTML(longnames: string[], text: string, inner: boolean, separator: string): string source

build html links to identifiers

Params:

NameTypeAttributeDescription
longnames string[]

link to these.

text string
  • optional

link text. default is name property of doc object.

inner boolean
  • optional
  • default: false

if true, use inner link.

separator string
  • optional
  • default: '\n'

used link separator.

Return:

string

html links.

private _buildExperimentalHTML(doc: DocObject): string source

build experimental html.

Params:

NameTypeAttributeDescription
doc DocObject

target doc object.

Return:

string

if doc is not experimental, returns empty.

private _buildFileDocLinkHTML(doc: DocObject, text: string): string source

build html link to file page.

Params:

NameTypeAttributeDescription
doc DocObject

target doc object.

text string

link text.

Return:

string

html of link.

private _buildLayoutDoc(): IceCap source

build common layout output.

Return:

IceCap

layout output.

private _buildNavDoc(): IceCap source

build common navigation output.

Return:

IceCap

navigation output.

Test:

private _buildOverrideMethod(doc: DocObject): string source

build method of ancestor class link html.

Params:

NameTypeAttributeDescription
doc DocObject

target doc object.

Return:

string

html link. if doc does not override ancestor method, returns empty.

private _buildProperties(properties: ParsedParam[], title: string): IceCap source

build properties output.

Params:

NameTypeAttributeDescription
properties ParsedParam[]
  • optional
  • default: []

properties in doc object.

title string

output title.

Return:

IceCap

built properties output.

private _buildSignatureHTML(doc: DocObject): string source

build identifier signature html.

Params:

NameTypeAttributeDescription
doc DocObject

target doc object.

Return:

string

signature html.

private _buildSummaryDoc(docs: DocObject[], title: string, innerLink: boolean): IceCap source

build summary output html by docs.

Params:

NameTypeAttributeDescription
docs DocObject[]

target docs.

title string

summary title.

innerLink boolean

if true, link in summary is inner link.

Return:

IceCap

summary output.

private _buildSummaryHTML(doc: DocObject, kind: string, title: string, isStatic: boolean): string source

build summary output html by parent doc.

Params:

NameTypeAttributeDescription
doc DocObject

parent doc object.

kind string

target kind property.

title string

summary title.

isStatic boolean
  • optional
  • default: true

target static property.

Return:

string

html of summary.

private _buildTypeDocLinkHTML(typeName: string): string source

build html link of type.

Params:

NameTypeAttributeDescription
typeName string

type name(e.g. number[], Map<number, string>)

Return:

string

html of link.

TODO:

  • re-implement with parser combinator.

private _find(cond: ...Object): DocObject[] source

find doc object.

Params:

NameTypeAttributeDescription
cond ...Object

find condition.

Return:

DocObject[]

found doc objects.

private _findAccessDocs(doc: DocObject, kind: string, isStatic: boolean): Array[] source

find doc object for each access.

Params:

NameTypeAttributeDescription
doc DocObject

parent doc object.

kind string

kind property condition.

isStatic boolean

static property condition

Return:

Array[]

found doc objects.

Return Properties:

NameTypeAttributeDescription
0 Array[]

['Public', DocObject[]]

1 Array[]

['Protected', DocObject[]]

2 Array[]

['Private', DocObject[]]

private _findAllIdentifiersKindGrouping(): {class: DocObject[], interface: DocObject[], function: DocObject[], variable: DocObject[], typedef: DocObject[], external: DocObject[]} source

find all identifiers with kind grouping.

Return:

{class: DocObject[], interface: DocObject[], function: DocObject[], variable: DocObject[], typedef: DocObject[], external: DocObject[]}

found doc objects.

private _findByName(name: string, kind: string): DocObject[] source

fuzzy find doc object by name.

  • equal with longname
  • equal with name
  • include in longname
  • include in ancestor

Params:

NameTypeAttributeDescription
name string

target identifier name.

kind string
  • optional

target kind.

Return:

DocObject[]

found doc objects.

private _getBaseUrl(fileName: string): string source

get base url html page. it is used html base tag.

Params:

NameTypeAttributeDescription
fileName string

output file path.

Return:

string

base url.

private _getInfo(): {title: string, version: string, url: string} source

get target's essential info.

Return:

{title: string, version: string, url: string}

private _getOutputFileName(doc: DocObject): string source

get file name of output html page.

Params:

NameTypeAttributeDescription
doc DocObject

target doc object.

Return:

string

file name.

private _getTitle(doc: DocObject): string source

get output html page title. use title in undefined.

Params:

NameTypeAttributeDescription
doc DocObject

target doc object.

Return:

string

page title.

Test:

private _getURL(doc: DocObject): string source

gat url of output html page.

Params:

NameTypeAttributeDescription
doc DocObject

target doc object.

Return:

string

url of output html. it is relative path from output root dir.

private _orderedFind(order: string, cond: ...Object): DocObject[] source

find doc objects that is ordered.

Params:

NameTypeAttributeDescription
order string

doc objects order(column asec or column desc).

cond ...Object

condition objects

Return:

DocObject[]

found doc objects.

private _readTemplate(fileName: string): string source

read html template.

Params:

NameTypeAttributeDescription
fileName string

template file name.

Return:

string

html of template.