Writing jsdoc documentation on methods inside a cl

2019-02-25 00:33发布

I am writing some libraries in Google Apps Script and I am trying to document them. I have written some classes in the format below, and the comments of methods inside the class don't show up in the documentation :

/**
* My comments here
*/
function MyBeautifulObject(){

   this.myMethod=myMethod;
   ....

   /**
   * This comment doesn't show up
   */

   function myMethod(){
     ...
   }

}

Any idea on how I could achieve this ?

1条回答
神经病院院长
2楼-- · 2019-02-25 00:54

This question may be a duplicate... this answer certainly is.

The jsdoc variant suported for libraries in Google Apps Script does not support documentation at the level you are looking for, only first-level functions. There is a relevant open bug report on this, but no response from Google.

You can still write your jsdoc tags, and generate your documentation outside of the Google infrastructure. Take a look at How to preview jsdoc comments in google doc scripts for some pointers on how to preview your jsdoc comments. You could take the output of jsdoc3 and publish it on a site to provide your docs to your community.

Other relevant / possible duplicate posts:

查看更多
登录 后发表回答