4

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 ?

TheMaster
  • 45,448
  • 6
  • 62
  • 85
Vic Seedoubleyew
  • 9,888
  • 6
  • 55
  • 76
  • What do you mean by "the documentation"? – Phil Bozak Feb 15 '13 at 17:38
  • Also, you might want to be following [this issue](http://code.google.com/p/google-apps-script-issues/issues/detail?id=1731). – Phil Bozak Feb 15 '13 at 18:22
  • Hi Phil ! Thanks for your answer ! Yes I am talking about the jsdoc, that you can get if you go to the libraries you are using, clicking on the title of one library, and looking at the documentation for it. – Vic Seedoubleyew Feb 18 '13 at 05:11
  • I am writing classes for which I would like to add the documentation. But for inner methods it doesn't show up. – Vic Seedoubleyew Feb 18 '13 at 05:11
  • 1
    Does this answer your question? [Google Apps Script Auto Generated Library Documentation](https://stackoverflow.com/questions/15158745/google-apps-script-auto-generated-library-documentation) – Sunny Patel May 04 '20 at 22:57

2 Answers2

2

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:

Community
  • 1
  • 1
Mogsdad
  • 44,709
  • 21
  • 151
  • 275
1

If you are working with TypeScript, we've built a package that aims help on this:

https://github.com/maelcaldas/clasp-types

We use it to generate autocomplete for our OO libraries and Client-side API written on Typescript.

Mael
  • 427
  • 3
  • 11