Methods

(async, static) addItem(optionsopt)

Add an item to the container

Parameters:
NameTypeAttributesDefaultDescription
optionsObject<optional>
{}

Options for adding an item

Properties
NameTypeAttributesDescription
filestring<optional>

File path of the item

containerObject<optional>

Container to store the item

prefixstring<optional>

Prefix for the item key

(static) alert(text, message, optsopt) → {string}

Print warning message in page

Parameters:
NameTypeAttributesDefaultDescription
textstring
messagestring
optsObject<optional>
{}
Returns:
Type: 
string

(async, static) applyConcatRsc(options) → {Promise.<void>}

Apply concatenation of resources (CSS, JS) based on configuration and cache results

Parameters:
NameTypeDescription
optionsObject
Properties
NameTypeDescription
$Object

Cheerio instance

reqObject

Request object

tagstring

HTML tag

attrstring

Attribute name

typestring

Resource type

Returns:
Type: 
Promise.<void>

(static) applyInclude($) → {string}

Apply include directive in the page

Parameters:
NameTypeDescription
$Object

Cheerio instance

Returns:
Type: 
string

(async, static) attrsMutation(options)

Mutate attributes of an element and its children

Parameters:
NameTypeDescription
optionsObject
Properties
NameTypeDescription
$Object

Cheerio instance

elObject

Cheerio element

reqObject

Request object

(async, static) buildPage(options) → {Promise.<string>}

Build the final HTML page by processing the template, applying themes, iconsets, and manipulating the DOM as needed

Parameters:
NameTypeDescription
optionsObject
Properties
NameTypeDescription
textstring

HTML content

localsObject

Local variables

optsObject

Options

Returns:
Type: 
Promise.<string>

(async, static) buildTheme(mod, fw)

Build a theme

Parameters:
NameTypeDescription
modObject

Module object

fwObject

Framework object

(async, static) collectInline(type, optionsopt) → {Promise.<Array>}

Collect inline resources (css, scripts) from theme/iconset and options

Parameters:
NameTypeAttributesDefaultDescription
typestring

Type of resource ('inlineCss', 'inlineScript')

optionsObject<optional>
{}

Additional options for resource collection

Returns:
  • Array of collected inline resources
Type: 
Promise.<Array>

(async, static) collectRegular(type, transformer, optionsopt) → {Promise.<Array>}

Collect regular resources (css, scripts, links) from theme/iconset, frontmatter, and options

Parameters:
NameTypeAttributesDefaultDescription
typestring

Type of resource ('css', 'scripts', 'links')

transformerfunction

Function to transform each resource item

optionsObject<optional>
{}

Additional options for resource collection

Returns:
  • Array of collected and transformed resource items
Type: 
Promise.<Array>

(async, static) concatResources(options) → {Promise.<void>}

Concatenate resources (CSS, JS) based on configuration and cache results

Parameters:
NameTypeDescription
optionsObject
Properties
NameTypeDescription
$Object

Cheerio instance

reqObject

Request object

Returns:
Type: 
Promise.<void>

(async, static) exports.collectIconsets() → {Promise.<void>}

Collect iconsets

Returns:
Type: 
Promise.<void>

(async, static) exports.collectThemes() → {Promise.<void>}

Collect themes

Returns:
Type: 
Promise.<void>

(async, static) exports.collectViewEngines() → {Promise.<void>}

Collect view engines

Returns:
Type: 
Promise.<void>

(async, static) exports.injectElements(optionsopt)

Inject elements into the page

Parameters:
NameTypeAttributesDefaultDescription
optionsObject<optional>
{}

Options for element injection

Properties
NameTypeAttributesDescription
$Object<optional>

Cheerio instance for DOM-like manipulation

reqObject<optional>

Request object

cmpObject<optional>

Component instance

replyObject<optional>

Reply object

Print a link element

Parameters:
NameTypeDescription
linkObject

Link object

Returns:
  • HTML string for the link element
Type: 
string

(static) exports.printScript(script) → {string}

Print a script element

Parameters:
NameTypeDescription
scriptObject

Script object

Returns:
  • HTML string for the script element
Type: 
string

(async, static) injectCss(optionsopt)

Inject CSS into the page

Parameters:
NameTypeAttributesDefaultDescription
optionsObject<optional>
{}

Options for CSS injection

Properties
NameTypeAttributesDescription
$Object<optional>

Cheerio instance for DOM-like manipulation

Inject link elements into the page

Parameters:
NameTypeAttributesDefaultDescription
optionsObject<optional>
{}

Options for link injection

Properties
NameTypeAttributesDescription
$Object<optional>

Cheerio instance for DOM-like manipulation

(async, static) injectMeta(optionsopt)

Inject meta tags into the page

Parameters:
NameTypeAttributesDefaultDescription
optionsObject<optional>
{}

Options for meta injection

Properties
NameTypeAttributesDescription
$Object<optional>

Cheerio instance for DOM-like manipulation

themeObject<optional>

Theme instance

reqObject<optional>

Request object

localsObject<optional>

Local variables for rendering

(async, static) injectScript(optionsopt)

Inject scripts into the page

Parameters:
NameTypeAttributesDefaultDescription
optionsObject<optional>
{}

Options for script injection

Properties
NameTypeAttributesDescription
$Object<optional>

Cheerio instance for DOM manipulation

cmpObject<optional>

Component instance

localsObject<optional>

Local variables for rendering

(async, static) loadItems(type, theme)

Load items into the theme

Parameters:
NameTypeDescription
typestring

Type of items to load

themeObject

Theme object to load items into

(async, static) manipulation(options)

Manipulate the DOM based on specific attributes and move elements as needed

Parameters:
NameTypeDescription
optionsObject
Properties
NameTypeDescription
$Object

Cheerio instance

themeObject

Theme object

(async, static) parseAttr(options)

Parse attributes of an element and apply transformations

Parameters:
NameTypeDescription
optionsObject
Properties
NameTypeDescription
$Object

Cheerio instance

elObject

Cheerio element

reqObject

Request object

(async, static) replace(options) → {Promise.<void>}

Replace unknown component tag with div or comment

Parameters:
NameTypeDescription
optionsObject
Properties
NameTypeAttributesDefaultDescription
elObject

Cheerio element

cmpObject

Component instance

optsObject<optional>
{}

Options

Returns:
Type: 
Promise.<void>

(async, static) replaceTag(options) → {Promise.<void>}

Replace unknown component tag with div or comment

Parameters:
NameTypeDescription
optionsObject
Properties
NameTypeAttributesDefaultDescription
elObject

Cheerio element

cmpObject

Component instance

optsObject<optional>
{}

Options

Returns:
Type: 
Promise.<void>