Google Apps Script Automatic Generated Library Documentation

I am currently developing a library for Google Apps Script which basically treats a spreadsheet as a database object.

The library currently has two identical functions such as




/**
* Opens and creates a query object for a spreadsheet with the given url.
*
* @param {String} the url of the spreadsheet
* @return {SpreadsheetQuery_} a spreadsheet query object for the given spreadsheet
*/
function openByUrl(url) {
    return new SpreadsheetQuery_(SpreadsheetApp.openByUrl(url));
}

      



now, for the two public functions, the generated documentation only shows the return type, not the parameter or attached instructions. I guess this is a google issue and not very worried.

But my main question is that since functions instantiate an object from a private function, how can I get the automatic documentation to show the methods that exist on that object. All functionality will be provided by the object, and it would be great if GAS can show methods on it.

Note


All methods are placed in the function prototype. eg.

SpreadsheetQuery_.prototype.from = function (sheet) {
    if (_.isNumeric (sheet)) {
        ....
}

Thank.

+2


source to share


1 answer


The jsdoc variant supported for Libraries in Google Apps Script does not support documentation at the level you are looking for, only first level functions. This has a corresponding bug discovery report , but no response from Google.

You can still write jsdoc tags and build your documentation outside of google framework. Take a look at How to view jsdoc comments in google doc scripts for some pointers on how to view jsdoc comments. You can draw a conclusion jsdoc3

and publish it on the site to submit your documents to the community.



Other actual / possible duplicate messages:

+4


source







All Articles