Custom tags

101 views
Skip to first unread message

theallan

unread,
Jan 28, 2012, 5:25:09 AM1/28/12
to JSDoc Users
Hi Michael,

I'm wondering if there is a method of "passing through" custom tags
that I could use in the JSON output from the -X option? What I'm
looking at doing is using the output from JSDoc to populate a database
with various parameters, and I'd like to be able to set up a custom
tag or two to provide extra information in the database (for example
"Group: Initialisation option - columns", or "Group: API" etc).

I've tried experimenting a little bit with just creating random tag
names, but they aren't picked up (not unreasonably!), so I was
wondering if it might be possible to do something a little bit like
HTTP headers and allow tags such as @-x-myTag which would simply
create that custom parameter in the JSON output? The value of the
parameter would then be whatever text that follows the tag.

Many thanks,
Allan

theallan

unread,
Jan 30, 2012, 9:36:13 AM1/30/12
to JSDoc Users
I should have done more research before posting... In JSDoc2 is looks
like it is relatively straight forward:
http://code.google.com/p/jsdoc-toolkit/wiki/FAQ#Using_custom_tags .

In JSDoc 3, the -X output gives you a "tags" array which contains the
current tags

* @flavor chocolate
* @myWay Old blue eyes

becomes:

"tags": [
{
"originalTitle": "flavor",
"title": "flavor",
"text": "chocolate",
"value": "chocolate"
},
{
"originalTitle": "myWay",
"title": "myway",
"text": "Old blue eyes",
"value": "Old blue eyes"
}
]

That will do nicely :-)

Still loving JSDoc!

Allan

Michael Mathews

unread,
Jan 30, 2012, 6:04:17 PM1/30/12
to theallan, JSDoc Users
Hi Allan,

Yep, that is the way to go. Sorry I missed your question when it appeared on the list!

Michael Mathews
mic...@gmail.com

> --
> You received this message because you are subscribed to the Google Groups "JSDoc Users" group.
> To post to this group, send email to jsdoc...@googlegroups.com.
> To unsubscribe from this group, send email to jsdoc-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jsdoc-users?hl=en.
>

Reply all
Reply to author
Forward
0 new messages