@emdaer/plugin-jsdoc-tag-value ·
Usage
@emdaer/plugin-jsdoc-tag-value is an emdaer plugin – see the emdaer monorepo for more information
Documentation
Example
This will print 2 examples of how to use this plugin:
<!--emdaer-p
- '@emdaer/plugin-jsdoc-tag-value'
- source: ./src/index.js
functionName: jsdocTagValue
tag: example
tagIndex: 0
-->
<!--emdaer-p
- '@emdaer/plugin-jsdoc-tag-value'
- source: ./src/index.js
functionName: jsdocTagValue
tag: example
-->
Usage in README
Use @emdaer/plugin-jsdoc-tag-value
by specifying the source
, functionName
, and tag
you would like to pull the string value from. @emdaer/plugin-jsdoc-tag-value
will pull the description
from documentationjs of the first instance of that tag. This readme is pulling in an example of itself like so:
<!--emdaer-p
- '@emdaer/plugin-jsdoc-tag-value'
- source: ./src/index.js
functionName: jsdocTagValue
tag: example
tagIndex: 0
-->
By omitting the tagIndex
parameter, one can pull in all examples for a given function:
<!--emdaer-p
- '@emdaer/plugin-jsdoc-tag-value'
- source: ./src/index.js
functionName: jsdocTagValue
tag: example
-->
Node API
jsdocTagValue
Render a jsdoc tag’s value for a given file/function
Parameters
-
options
any-
options.source
string? The file that contains the function -
options.functionName
string? The function name that contains the desired jsdoc tag -
options.tag
string? The tag from whom to pull the value -
options.tagIndex
string? The index for the tag from whom to pull the value. If not present, all values for a given tag will be pulled.
-
Examples
<!--emdaer-p
- '@emdaer/plugin-jsdoc-tag-value'
- source: ./src/index.js
functionName: jsdocTagValue
tag: example
tagIndex: 0
-->
<!--emdaer-p
- '@emdaer/plugin-jsdoc-tag-value'
- source: ./src/index.js
functionName: jsdocTagValue
tag: example
-->