Skip to content
/ ddata Public
forked from jsdoc2md/ddata

handlebars helpers for working with the documentation data output by jsdoc-parse

License

Notifications You must be signed in to change notification settings

daserge/ddata

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

view on npm npm module downloads per month Build Status Dependency Status

ddata

ddata is a collection of handlebars helpers for working with the documentation data output by jsdoc-parse.

Example

var handlebars = require("handlebars");
var ddata = require("ddata");
var docs = require("./docs.json"); // jsdoc-parse output

handlebars.registerHelper(ddata);
var template =
"{{#module name='yeah-module'}}\
The author of the module is: {{author}}.\
{{/module}}";
console.log(handlebars.compile(template)(docs));

ddata._globals()

omits externals without a description

Kind: static method of ddata

ddata._link(input, options)

e.g. namepaths module:Something or type expression Array.<module:Something>

Kind: static method of ddata

Param Type Description
input string namepath or type expression
options object the handlebars helper options object

ddata.isClass() ⇒ boolean

Kind: static method of ddata
this: {identifier}

ddata.isClassMember() ⇒ boolean

returns true if the parent of the current identifier is a class

Kind: static method of ddata

ddata.isEvent() ⇒ boolean

returns true if this is an event

Kind: static method of ddata

ddata._identifiers() ⇒ array

Returns an array of identifiers matching the query

Kind: static method of ddata

ddata._children([sortBy], [min]) ⇒ Array.<identifier>

return the identifiers which are a memberof this one. Exclude externals without descriptions.

Kind: static method of ddata
this: {identifier}

Param Type Description
[sortBy] string "kind"
[min] number only returns if there are min children

ddata.descendants([sortBy], [min]) ⇒ Array.<identifier>

return a flat list containing all decendants

Kind: static method of ddata
this: {identifier}

Param Type Description
[sortBy] string "kind"
[min] number only returns if there are min children

ddata.exported() ⇒ identifier

returns the exported identifier of this module

Kind: static method of ddata
this: {identifier}

ddata._identifier()

Returns an identifier matching the query

Kind: static method of ddata

ddata.parentObject()

Returns the parent

Kind: static method of ddata

ddata.parseLink(text) ⇒ Array.<{original: string, caption: string, url: string}>

extracts url and caption data from @link tags

Kind: static method of ddata

Param Type Description
text string a string containing one or more {@link} tags

ddata.parentName() ⇒ string

returns the parent name, instantiated if necessary

Kind: static method of ddata
this: {identifier}

ddata.option()

returns a dmd option, e.g. "sort-by", "heading-depth" etc.

Kind: static method of ddata

ddata.optionEquals()

Kind: static method of ddata

ddata.optionSet()

Kind: static method of ddata

ddata.optionIsSet()

Kind: static method of ddata

ddata.indent()

Kind: static method of ddata

ddata.stripNewlines()

Kind: static method of ddata

ddata.headingDepth()

Kind: static method of ddata

ddata.depth()

Kind: static method of ddata

ddata.depthIncrement()

Kind: static method of ddata

ddata.depthDecrement()

Kind: static method of ddata

ddata.indexDepth()

Kind: static method of ddata

ddata.indexDepthIncrement()

Kind: static method of ddata

ddata.indexDepthDecrement()

Kind: static method of ddata

ddata.indexDepth()

Kind: static method of ddata

ddata.identifiers()

render the supplied block for each identifier in the query

Kind: static method of ddata
Category: Block helper: selector

ddata.orphans()

render the supplied block for each parent (global identifier, or module)

Kind: static method of ddata
Category: Block helper: selector

ddata.globals()

render the supplied block for each parent (global identifier, or module)

Kind: static method of ddata
Category: Block helper: selector

ddata.modules()

render the supplied block for each module

Kind: static method of ddata
Category: Block helper: selector

ddata.module()

render the supplied block for the specified module

Kind: static method of ddata
Category: Block helper: selector

ddata.identifier()

render the supplied block for the specified identifier

Kind: static method of ddata
Category: Block helper: selector

ddata.classes()

render the block for each class

Kind: static method of ddata
Category: Block helper: selector

ddata.functions()

render the block for each function/method

Kind: static method of ddata
Category: Block helper: selector

ddata.class()

render the supplied block for the specified class

Kind: static method of ddata
Category: Block helper: selector

ddata.function()

render the supplied block for the specified function

Kind: static method of ddata
Category: Block helper: selector

ddata.namespace()

render the supplied block for the specified function

Kind: static method of ddata
Category: Block helper: selector

ddata.enum()

render the supplied block for the specified enum

Kind: static method of ddata
Category: Block helper: selector

ddata.misc()

render the supplied block for each orphan with no scope set

Kind: static method of ddata
Category: Block helper: selector

ddata.children()

render the supplied block for each child

Kind: static method of ddata
Category: Block helper: selector

ddata.indexChildren()

Kind: static method of ddata
Category: Block helper: selector

ddata.link(id)

Kind: static method of ddata
Category: Block helper: util

Param Type Description
id string the ID to link to, e.g. external:XMLHttpRequest, GlobalClass#propOne etc.

Example

{{#link "module:someModule.property"~}}
  {{name}} {{!-- prints 'property' --}}
  {{url}}  {{!-- prints 'module-someModule-property' --}}
{{/link}}

ddata.returnSig2() ⇒ Object

Kind: static method of ddata
Category: Block helper: util

ddata._orphans() ⇒ array

Returns an array of the top-level elements which have no parents. Output only includes externals which have a description.

Kind: static method of ddata
Category: Returns list

ddata.anchorName() ⇒ string

returns a unique ID string suitable for use as an href.

Kind: static method of ddata
Category: Returns string
this: {identifier}
Example

> ddata.anchorName.call({ id: "module:yeah--Yeah()" })
'module_yeah--Yeah_new'

ddata.md()

converts the supplied text to markdown

Kind: static method of ddata
Category: Returns string

ddata.methodSig() ⇒ string

Returns the method signature, e.g. (options, [onComplete])

Kind: static method of ddata
Category: Returns string
this: {identifier}

ddata.showMainIndex() ⇒ boolean

True if there at least two top-level identifiers (i.e. globals or modules)

Kind: static method of ddata
Category: returns boolean

ddata~sig()

Kind: inner method of ddata
Category: Block helper: util


© 2015 Lloyd Brookes <[email protected]>. Documented by jsdoc-to-markdown.

About

handlebars helpers for working with the documentation data output by jsdoc-parse

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%