Type Definitions
configurationObject
- Description:
A plain object containing configuration information for customising Linkifier objects and commandline interface (CLI) options.
- Source:
- See:
-
- module:cli
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
linkifier |
module:linkifier-class.Linkifier |
<optional> |
a configured linkifier. |
options |
Object |
<optional> |
values for the options accepted by the CLI's |
A plain object containing configuration information for customising Linkifier objects and commandline interface (CLI) options.
Type:
- Object
dataTransformer(pData) → {module:link-data.LinkData}
- Description:
Functions for converting information extracted from a web page into the information used to render links.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
pData |
module:page-data.PageData | The web page data to be transrormed to link data. |
Returns:
The link information derived from the page data.
extraFieldExtractorFunction(pageDOM) → {Object.<string, string>}
- Description:
A function that can optionally be added to a template to facilitate the extraction of exta data fields from web pages that can then be utilised by the template to render the link.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
pageDOM |
module:cheerio | the parsed webpage content |
Returns:
- Type
- Object.<string, string>
pageMetadataObject
- Description:
A page metadata object. Each key represents one of the standard or pseudo-standard HTML metadata fields.
- Source:
- See:
-
- https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name for relevant documentation from the Mozilla Developer Network (MDN).
Properties:
| Name | Type | Description |
|---|---|---|
author |
string | |
creator |
string | |
description |
string | |
keywords |
Array.<string> | |
publisher |
string |
A page metadata object. Each key represents one of the standard or pseudo-standard HTML metadata fields.
Type:
- Object.<string, string>
plainLinkInformationObject
- Description:
A plain object represeting the information about about link that can get utilised in a template.
Note that the
uricould contain more fields - it's initialised with output from theURI.parse()function from theURImodule.
- Source:
- See:
Properties:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string | the URL for the link. |
||||||||||||
text |
string | the text for the link. |
||||||||||||
description |
string | a description for the link. |
||||||||||||
extraFields |
Object.<string, string> | any extra fields extracted from the page source. |
||||||||||||
uri |
Object | the URL's components Properties
|
A plain object represeting the information about about link that can get utilised in a template.
Note that the uri could contain more fields - it's initialised with output from the URI.parse() function from the URI module.
Type:
- Object
plainPageInformationObject
- Description:
A plain object representing the infomration extracted from a web page.
Note that the
uricould contain more fields - it's initialised with output from theURI.parse()function from theURImodule.
- Source:
- See:
Properties:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string | the page's URL. |
||||||||||||
title |
string | the page's title. |
||||||||||||
metadata |
pageMetadataObject | the metadata extracted from the |
||||||||||||
topLevelHeadings |
Array.<string> | the text from the page's |
||||||||||||
secondaryHeadings |
Array.<string> | text from the page's |
||||||||||||
mainHeading |
string | the text from the most semantically important heading that exists in the page. |
||||||||||||
extraFields |
Object.<string, string> | any extra fields extracted from the page source. |
||||||||||||
uri |
Object | the URL's components Properties
|
A plain object representing the infomration extracted from a web page.
Note that the uri could contain more fields - it's initialised with output from the URI.parse() function from the URI module.
Type:
- Object
templateFieldFilterFunction(originalString) → {string}
- Description:
Functions for filtering template field values before their use to render links. Arbitrarily many of these functions can be added to a template in order to filter individual fields, or all fields.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
originalString |
string | the original value for the field to be filtered. |
Returns:
the filtered version of the original string.
- Type
- string
templateFieldFilterTuple
- Description:
A tupple (array of length exactly two) for assigning a field filter to a template.
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
0 |
"all" | "url" | "text" | "description" | the property the filter should be applied to. |
1 |
templateFieldFilterFunction | the filter function to apply. |
A tupple (array of length exactly two) for assigning a field filter to a template.
Type:
- Array