Module: jsdoc/util/templateHelper

Members

containers

Source:

fileExtension

Source:

globalName

Source:

longnameToId

Source:

longnameToUrl

Source:

scopeToPunc

Source:

access

Source:

access

Source:

access

Source:

access

Source:

access

Source:

author

Source:

author

Source:

basename

Source:

catharsis

Source:

class

Source:

classname

Source:

classname

Source:

classname

Source:
Source:

completeTag

Source:

completeTag

Source:

containerCache

Source:

containers

Source:

content

Source:

content

Source:

content

Source:

cssClass

Source:

cssClass

Source:

dictionary

Source:

doc

Source:

doc

Source:

env

Source:

err

Source:

fakeContainer

Source:

filename

Source:

filename

Source:

filename

Source:

filename

Source:

filename

Source:

files

Source:

fileUrl

Source:

fileUrl

Source:

fileUrl

Source:

fileUrl

Source:

fileUrl

Source:

fileUrl

Source:

fragment

Source:

fragment

Source:

fragment

Source:

fragment

Source:

fragmentId

Source:

fragmentId

Source:

fragmentString

Source:

hasKind

Source:

hasOwnProp

Source:

hasURI

Source:

htmlsafe

Source:

htmlSafe

Source:

id

Source:

id

Source:

id

Source:

id

Source:

ids

Source:

ignore

Source:

inline

Source:

isComplexTypeExpression

Source:

isMemberOfAnonymous

Source:

jsdoc

Source:

key

Source:

key

Source:

key

Source:

key

Source:

kind

Source:

kind

Source:

kind

Source:

kind

Source:

l

Source:

leadingText

Source:

leadingText

Source:

leadingTextInfo

Source:
Source:
Source:
Source:
Source:
Source:

linkMap

Source:

linkMap

Source:

linkMap

Source:
Source:

linkText

Source:

linkText

Source:

linkText

Source:

linkText

Source:

linkText

Source:

listens

Source:

logger

Source:

longname

Source:

longname

Source:

longname

Source:

longname

Source:

longnameToId

Source:

longnameToUrl

Source:

match

Source:

matches

Source:

memberof

Source:

memberof

Source:

memberof

Source:

missingOpts

Source:

missingOpts

Source:

missingOpts

Source:

MODULE_NAMESPACE

Source:

monospace

Source:

monospace

Source:
Source:

name

Source:

newName

Source:

node

Source:

node

Source:

nonUnique

Source:

nonUnique

Source:

options

Source:

options

Source:

options

Source:

options

Source:

options

Source:

options

Source:

outputAsJSON

Source:

params

Source:

parsedType

Source:

previousDoc

Source:

registerId

Source:
Source:

replacers

Source:

result

Source:

result

Source:

result

Source:

result

Source:

returns

Source:

returnTypes

Source:

returnTypes

Source:

shortenName

Source:

split

Source:

splitIndex

Source:

splitIndex

Source:

str

Source:

string

Source:

string

Source:

string

Source:

string

Source:

stringifiedType

Source:

stringifiedType

Source:

stripped

Source:

strippedLongName

Source:

tag

Source:

tag

Source:

tag

Source:

tag

Source:

target

Source:

target

Source:

target

Source:

text

Source:

text

Source:

text

Source:

text

Source:

text

Source:

text

Source:

tutorial

Source:

tutorial

Source:

tutorialLinkMap

Source:

tutorials

Source:

tutorialToUrl

Source:

type

Source:

types

Source:

types

Source:

undocumented

Source:

unidentifiedTutorial

Source:

uri

Source:

yields

Source:

Methods

_replaceDictionary(dict)

Replace the existing tag dictionary with a new tag dictionary. Used for testing only. Do not call this method directly. Instead, call module:jsdoc/doclet._replaceDictionary, which also updates this module's tag dictionary.
Parameters:
Name Type Description
dict module:jsdoc/tag/dictionary.Dictionary The new tag dictionary.
Source:

addEventListeners(data)

Iterates through all the doclets in `data`, ensuring that if a method `@listens` to an event, then that event has a `listeners` array with the longname of the listener in it.
Parameters:
Name Type Description
data TAFFY The TaffyDB database to search.
Source:
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

find()

Source:
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>

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>

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>

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

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>

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

Retrieve links to types that the member can return or yield.
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 or yield.
Type
Array.<string>

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>

getUniqueFilename()

Source:

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

htmlsafe()

Source:

linkto()

Source:

longnamesToTree(longnames, doclets) → {Object}

Convert an array of doclet longnames into a tree structure, optionally attaching doclets to the tree.
Parameters:
Name Type Description
longnames Array.<string> The longnames to convert into a tree.
doclets Object.<string, module:jsdoc/doclet.Doclet> The doclets to attach to a tree. Each property should be the longname of a doclet, and each value should be the doclet for that longname.
Source:
See:
Returns:
A tree with information about each longname.
Type
Object

prune(data, options) → {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. unless the optional `options` tell me otherwise.
Parameters:
Name Type Description
data TAFFY The TaffyDB database to prune.
options options options: - `keepUndocumented` - `keepMarkedAsIgnore` - `keepMembersOfAnonymous` - `keepAllAccessLevels` - `keepEveryone`
Source:
Returns:
The pruned database.
Type
TAFFY

registerId()

Source:
Source:
Convert tag text like `Jane Doe ` into a `mailto:` link.
Parameters:
Name Type Description
str string The tag text.
Source:
Returns:
The linkified text.
Type
string
Find `...` and `...` inline tags and turn them into HTML links.
Parameters:
Name Type Description
str string The string to search for `...` and `...` tags.
Source:
Returns:
The linkified text.
Type
string

setTutorials(root)

Sets tutorials map.
Parameters:
Name Type Description
root jsdoc.tutorial.Tutorial Root tutorial node.
Source:

toTutorial()

Source:

tutorialToUrl()

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.
shortenName boolean <optional>
Indicates whether to extract the short name from the longname and display the short name in the link text. Ignored if `linkText` is specified.
Source:
Returns:
The HTML link, or the link text if the link is not available.
Type
string

containerHasKind()

Source:

find(data, spec) → {array.<object>}

Find items in a TaffyDB database that match the specified key-value pairs.
Parameters:
Name Type Description
data TAFFY The TaffyDB database to search.
spec object | function Key-value pairs to match against (for example, `{ longname: 'foo' }`), or a function that returns `true` if a value matches or `false` if it does not match.
Source:
Returns:
The matching items.
Type
array.<object>
Source:

fragmentHash()

Source:

getFilename()

Get a longname's filename if one has been registered; otherwise, generate a unique filename, then register the filename.
Source:

getId()

Get a doclet's ID if one has been registered; otherwise, generate a unique ID, then register the ID.
Source:

getNamespace()

Source:

getShortName()

Source:

getUniqueFilename(str) → {string}

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.
Parameters:
Name Type Description
str string The string to convert.
Source:
Returns:
The filename to use for the string.
Type
string

hasUrlPrefix()

Source:

isComplexTypeExpression()

Source:

isModuleExports(doclet) → {boolean}

Check whether a symbol is the only symbol exported by a module (as in `module.exports = function() {};`).
Parameters:
Name Type Description
doclet module:jsdoc/doclet.Doclet The doclet for the symbol.
Source:
Returns:
`true` if the symbol is the only symbol exported by a module; otherwise, `false`.
Type
boolean

linkto(longname, linkTextopt, cssClassopt, fragmentIdopt, optionsopt) → {string|object}

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.
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.
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.
options options <optional>
set `options.outputAsJSON` boolean to instruct the function to produce a *JSON object* rather than a *string* for the given link.
Source:
Returns:
The HTML link, or a plain-text string if the link is not available.
Type
string | object

makeUniqueFilename()

Source:

makeUniqueId()

Source:

parseType()

Source:

shouldShortenLongname()

Source:

splitLinkText()

Source:

stringifyType()

Source:

toTutorial(tutorial, content, missingOptsopt) → {string}

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.
Parameters:
Name Type Attributes Description
tutorial string The name of the tutorial.
content string The link text to use.
missingOpts object <optional>
Options for displaying the name of a missing tutorial.
Properties
Name Type Description
classname string The CSS class to wrap around the tutorial name.
prefix string The prefix to add to the tutorial name.
tag string The tag to wrap around the tutorial name.
Source:
To Do:
  • Deprecate missingOpts once we have a better error-reporting mechanism.
Returns:
An HTML link to the tutorial, or the name of the tutorial with the specified options.
Type
string

useMonospace()

Source: