Google Apps脚本自动生成的库文档 [英] Google Apps Script Auto Generated Library Documentation

本文介绍了Google Apps脚本自动生成的库文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在开发Google Apps脚本库,该库基本上将电子表格视为数据库对象。



目前,该库具有两个相同的功能, p>

 
/ **
*打开并为具有给定网址的电子表格创建查询对象。
*
* @param {String}电子表格的网址
* @return {SpreadsheetQuery_}给定电子表格的电子表格查询对象
* /
函数openByUrl (url){
返回新的SpreadsheetQuery_(SpreadsheetApp.openByUrl(url));

pre


$ b

现在,对于两个公共函数,仅生成文档显示返回类型而不是参数或附带的说明。我假设这是一个谷歌问题,并没有真正困扰。

但我的主要问题是,因为函数是从私有函数实例化对象,我怎么能获取自动文档以显示该对象上存在的方法。
所有的功能都将由对象提供,如果GAS可以显示它的方法,那将是非常棒的。



注意






这些方法都放在函数的原型上。
eg。

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

谢谢。

相关的开放式错误报告,但Google没有回应。



您仍然可以编写jsdoc标记,并在Google基础结构之外生成文档。查看如何在Google文档脚本中预览jsdoc评论,了解如何预览您的jsdoc注释。您可以输出 jsdoc3 的输出并将其发布到网站上,以便将您的文档提供给您的社区。

其他相关/可能的重复帖子:


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

Currently, the library has a two identical functions like

/**
* 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 documentation generated only shows the return type and not the parameter nor the instructions attached. I am assuming this is a google issue and not really bothered.

But my main question is this, as the functions are instantiating an object from the private function, how can I get the auto documentation to show methods that exist on that object. All the functionality will be provided by the object and it will be great if GAS could show the methods on it.

NOTE


The methods are all placed on the prototype of the function. eg.

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

Thanks.

解决方案

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:

这篇关于Google Apps脚本自动生成的库文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆