Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

google apps script - Writing jsdoc documentation on methods inside a class

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 ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...