Module: jsdoc/util/templateHelper

Members

(inner) find

Find items in a TaffyDB database that match the specified key-value pairs.
Source:

(inner) getUniqueFilename

Convert a string to a unique filename, including an extension. Filenames are cached to ensure that they are used only once. For example, if the same string is passed in twice, two different filenames will be returned. Also, filenames are not considered unique if they are capitalized differently but are otherwise identical.
Source:

(inner) linkto

Retrieve an HTML link to the symbol with the specified longname. If the longname is not associated with a URL, this method simply returns the link text, if provided, or the longname. The `longname` parameter can also contain a URL rather than a symbol's longname. This method supports type applications that can contain one or more types, such as `Array.` or `Array.<(MyClass|YourClass)>`. In these examples, the method attempts to replace `Array`, `MyClass`, and `YourClass` with links to the appropriate types. The link text is ignored for type applications.
Source:

(inner) toTutorial

Retrieve a link to a tutorial, or the name of the tutorial if the tutorial is missing. If the `missingOpts` parameter is supplied, the names of missing tutorials will be prefixed by the specified text and wrapped in the specified HTML tag and CSS class.
Source:
To Do:
  • Deprecate missingOpts once we have a better error-reporting mechanism.

Methods

(static) addEventListeners(data)

Iterates through all the doclets in `data`, ensuring that if a method
Parameters:
Name Type Description
data TAFFY The TaffyDB database to search.
Source:
Listens to Events:
  • to an event, then that event has a 'listeners' array with the longname of the listener in it.event:
Create a URL that points to the generated documentation for the doclet. If a doclet corresponds to an output file (for example, if the doclet represents a class), the URL will consist of a filename. If a doclet corresponds to a smaller portion of an output file (for example, if the doclet represents a method), the URL will consist of a filename and a fragment ID.
Parameters:
Name Type Description
doclet module:jsdoc/doclet.Doclet The doclet that will be used to create the URL.
Source:
Returns:
The URL to the generated documentation for the doclet.
Type
string
Retrieve links to a member's ancestors.
Parameters:
Name Type Attributes Description
data TAFFY The TaffyDB database to search.
doclet Object The doclet whose ancestors will be retrieved.
cssClass string <optional>
The CSS class to include in the `class` attribute for each link.
Source:
Returns:
HTML links to a member's ancestors.
Type
Array.<string>

(static) getAncestors(data, doclet) → {Array.<module:jsdoc/doclet.Doclet>}

Retrieve an ordered list of doclets for a symbol's ancestors.
Parameters:
Name Type Description
data TAFFY The TaffyDB database to search.
doclet Object The doclet whose ancestors will be retrieved.
Source:
Returns:
A array of ancestor doclets, sorted from most to least distant.
Type
Array.<module:jsdoc/doclet.Doclet>

(static) getAttribs(d) → {array.<string>}

Retrieve the member attributes for a doclet (for example, `virtual`, `static`, and `readonly`).
Parameters:
Name Type Description
d object The doclet whose attributes will be retrieved.
Source:
Returns:
The member attributes for the doclet.
Type
array.<string>

(static) getMembers(data) → {object}

Retrieve all of the following types of members from a set of doclets: + Classes + Externals + Globals + Mixins + Modules + Namespaces + Events
Parameters:
Name Type Description
data TAFFY The TaffyDB database to search.
Source:
Returns:
An object with `classes`, `externals`, `globals`, `mixins`, `modules`, `events`, and `namespaces` properties. Each property contains an array of objects.
Type
object

(static) getSignatureParams(d, optClassopt) → {array.<string>}

Retrieve names of the parameters that the member accepts. If a value is provided for `optClass`, the names of optional parameters will be wrapped in a `` tag with that class.
Parameters:
Name Type Attributes Description
d object The doclet whose parameter names will be retrieved.
optClass string <optional>
The class to assign to the `` tag that is wrapped around the names of optional parameters. If a value is not provided, optional parameter names will not be wrapped with a `` tag. Must be a legal value for a CSS class name.
Source:
Returns:
An array of parameter names, with or without `` tags wrapping the names of optional parameters.
Type
array.<string>

(static) getSignatureReturns(d, cssClassopt) → {Array.<string>}

Retrieve links to types that the member can return.
Parameters:
Name Type Attributes Description
d Object The doclet whose types will be retrieved.
cssClass string <optional>
The CSS class to include in the `class` attribute for each link.
Source:
Returns:
HTML links to types that the member can return.
Type
Array.<string>

(static) getSignatureTypes(d, cssClassopt) → {Array.<string>}

Retrieve links to allowed types for the member.
Parameters:
Name Type Attributes Description
d Object The doclet whose types will be retrieved.
cssClass string <optional>
The CSS class to include in the `class` attribute for each link.
Source:
Returns:
HTML links to allowed types for the member.
Type
Array.<string>

(static) prune(data) → {TAFFY}

Remove members that will not be included in the output, including: + Undocumented members. + Members tagged `@ignore`. + Members of anonymous classes. + Members tagged `@private`, unless the `private` option is enabled. + Members tagged with anything other than specified by the `access` options.
Parameters:
Name Type Description
data TAFFY The TaffyDB database to prune.
Source:
Returns:
The pruned database.
Type
TAFFY
Convert tag text like "Jane Doe " into a mailto link
Source:
Find symbol ... and ... strings in text and turn into html links
Source:

(static) setTutorials(root)

Sets tutorials map.
Parameters:
Name Type Description
root jsdoc.tutorial.Tutorial Root tutorial node.
Source:
Build an HTML link to the symbol with the specified longname. If the longname is not associated with a URL, this method simply returns the link text, if provided, or the longname. The `longname` parameter can also contain a URL rather than a symbol's longname. This method supports type applications that can contain one or more types, such as `Array.` or `Array.<(MyClass|YourClass)>`. In these examples, the method attempts to replace `Array`, `MyClass`, and `YourClass` with links to the appropriate types. The link text is ignored for type applications.
Parameters:
Name Type Attributes Description
longname string The longname (or URL) that is the target of the link.
linkText string <optional>
The text to display for the link, or `longname` if no text is provided.
options Object Options for building the link.
Properties
Name Type Attributes Description
cssClass string <optional>
The CSS class (or classes) to include in the link's `` tag.
fragmentId string <optional>
The fragment identifier (for example, `name` in `foo.html#name`) to append to the link target.
linkMap string <optional>
The link map in which to look up the longname.
monospace boolean <optional>
Indicates whether to display the link text in a monospace font.
Source:
Returns:
The HTML link, or the link text if the link is not available.
Type
string

(inner) getUniqueId(filename, doclet) → {string}

Convert a doclet to an identifier that is unique for a specified filename. Identifiers are not considered unique if they are capitalized differently but are otherwise identical.
Parameters:
Name Type Description
filename string The file in which the identifier will be used.
doclet string The doclet to convert.
Source:
Returns:
A unique identifier based on the file and doclet.
Type
string