1

I have a Custom Function working in Google Sheets - However, the function has a number of optional parameters - In the help I would like to split the description of any optional parameters so they appear on multiple lines - is it possible?

This function is to be used by colleagues - the optional parameters need a clear description - it would be really helpful to split the supporting comments which appear on sheets during entry over multiple lines.

This is the customfunction text I have today.

/**
 * Creates a section of random text based on parameters entered.
 *
 * @param {number} len The total number paragraphs to return.
 * @param {number} size Average size of paragraphs (0 - Short  >  3 - v.Long).
 * @param {string} optional TEXT I WOULD LIKE TO RETURN OVER MULTIPLE LINES: 
 * LINE 1 
 * LINE 2 
 * LINE 3
 * @return an array of random letters
 * @customfunction
 */
function HelpMePlease(len, size, optional) {

NOTE: I am not looking to Comment the Code here > It is the comments for a CustomFunction > The text I need will appear in sheets when the user is using the function.

TheMaster
  • 45,448
  • 6
  • 62
  • 85
ANdy
  • 33
  • 7
  • Related: [this](https://google.github.io/styleguide/jsguide.html#jsdoc-markdown),[this](https://google.github.io/styleguide/jsguide.html#jsdoc-line-wrapping) and [this](https://stackoverflow.com/q/54383589/) – TheMaster Aug 25 '19 at 10:55
  • 1
    Possible duplicate of [JSDoc for showing optional arguments in Google Sheets autocomplete dropdown](https://stackoverflow.com/questions/54383589/jsdoc-for-showing-optional-arguments-in-google-sheets-autocomplete-dropdown) – Rubén Aug 25 '19 at 20:10

1 Answers1

0

From the js doc:

Parameters with properties If a parameter is expected to have a specific property, you can document that property by providing an additional @param tag. For example, if an employee parameter is expected to have name and department properties, you can document it as follows:


/**
 * Assign the project to an employee.
 * @param {Object} employee - The employee who is responsible for the project.
 * @param {string} employee.name - The name of the employee.
 * @param {string} employee.department - The employee's department.
 */
Project.prototype.assign = function(employee) {
    // ...
};

https://jsdoc.app/tags-param.html

PySeeker
  • 818
  • 8
  • 12