Custom tag in JSDoc toolkit

Hi I am trying to add a special tag to the JSDoc-toolkit. Only the useful site I found was as follows: Using custom tags , but it doesn’t work.

I also tried just {+data.comment.getTag("customTag")[0]+} with no luck.

+4
source share
1 answer

I use this for the @TODO tag and it works. Here is an example:

 /** * Working with cookies (set/get/delete) * @namespace Cookies related methods * @TODO serialize javascript object and store in cookie */ x.cookie = x.cookie || {}; /** * Set cookie with name/value and expiration with one year * * @param {string} name * @param {string} value * @TODO write this method */ x.cookie.set = function(name, value) { }; 

You can add the first @TODO to the default template:

 <!-- ============================== ToDo summary ======================== --> {! var todos = data.comment.getTag("TODO"); !} <if test="todos.length"> <table class="summaryTable" cellspacing="0" summary="A summary of the TODOs documented in the class {+data.alias+}."> <caption>TODO Summary</caption> <thead> <tr> <th scope="col"></th> <th scope="col">ToDo Description</th> </tr> </thead> <tbody> <for each="todo" in="todos"> <tr> <td class="attributes"> </td> <td class="nameDescription"> {+todo+} </td> </tr> </for> </tbody> </table> </if> 

and the second for each method:

 <if test="member.comment.getTag('TODO')[0]"> todo: {+ member.comment.getTag("TODO")[0] +} </if> 
+6
source

Source: https://habr.com/ru/post/1339344/


All Articles