Home Reference Source Repository

Function

Static Public Summary
public

renderContents(contents: Object): ReactElement | string

Consumes a peritext content's pseudo-dom nodes list to produce react markup

public

resolveDataDependencies(inputSections: array, assetsController: Object, assetsParams: Object, resolveData: boolean, callback: function(err: error, finalSections: array))

Resolves interpolations ni metadata, resources, and contextualizations, and possibly fetches stores necessary data for rendering

Static Public

public renderContents(contents: Object): ReactElement | string source

Consumes a peritext content's pseudo-dom nodes list to produce react markup

Params:

NameTypeAttributeDescription
contents Object

the pseudo-dom nodes array

Return:

ReactElement | string

markup or string contents

public resolveDataDependencies(inputSections: array, assetsController: Object, assetsParams: Object, resolveData: boolean, callback: function(err: error, finalSections: array)) source

Resolves interpolations ni metadata, resources, and contextualizations, and possibly fetches stores necessary data for rendering

Params:

NameTypeAttributeDescription
inputSections array

the sections to resolve

assetsController Object

the assets controller module to use to communicate with assets

assetsParams Object

the params to use for accessing the assets

resolveData boolean

whether to fetch and store necessary data right away or to store methods for later lazy-loading

callback function(err: error, finalSections: array)

callbacks a possible errors and the updated list of sections