如何在Google Apps jsdoc说明中强制换行 [英] How to force newlines in Google Apps jsdoc descriptions

查看:866
本文介绍了如何在Google Apps jsdoc说明中强制换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法弄清楚Google Apps脚本如何正确显示。我需要它在jsdoc输出中显示新行(例如,当函数工具提示窗口出现在Spreadheet函数中时)。我已经尝试过像html这样的html,但它只是呈现为文本而不是换行符。



例如:

  / ** 
*将前缀值指定的基地。
*需要以下其中一个前缀:
*'0b'基数2:二进制
*'0q'基数4:四元
*'0o'基数8:八进制
*'0x'基数16:十六进制
*
* @param {字符串}值要转换的前缀值。
* @param {数字}要转换为的基数。
* @return转换后的基数。
* @customfunction
* /
函数BASEP(Value,To){

这只是呈现一个文本blob,如:

 摘要:
将前缀值转换为指定的基础。需要
以下前缀之一:0b Base 2:binary 0q Base 4:
quaternary 0o Base 8:octal 0x Base 16:hexadecimal

解决方案

以下是一些在Google Apps Script中控制jsdoc评论格式的方法:



< pre>



  / ** 
*将前缀值转换为指定的基数。
*需要以下其中一个前缀:
*< pre>基数2:二进制
*'0q'基数4:四元数
*'0o'基数8:八进制数
*'0x'基数16:十六进制数
*< / pre>
*
* @param {字符串}值要转换的前缀值。
* @param {数字}要转换为的基数。
* @return转换后的基数。
* @customfunction
* /
函数BASEP(Value,To){}



< p> 段落



  / ** 
*将前缀值转换为指定的基数。
*需要以下其中一个前缀:
*< p>'0b'Base 2:binary< / p>
*< p>'0q'基准4:第四位< / p>
*< p>'0o'基本8:八进制< / p>
*< p>'0x'基数16:十六进制< / p>
*
* @param {字符串}值要转换的前缀值。
* @param {数字}要转换为的基数。
* @return转换后的基数。
* @customfunction
* /
函数BASEP2(Value,To){}



List



/ **
*将前缀值转换为指定的基地。
*需要以下其中一个前缀:
*< ul style =list-style:none;>
*< li> '0b'基数2:二进制
*< li> '0q'基数4:四元
*< li> '0o'基数8:八进制
*< li> '0x'基数16:十六进制
*< / ul>
*
* @param {字符串}值要转换的前缀值。
* @param {数字}要转换为的基数。
* @return转换后的基数。
* @customfunction
* /
函数BASEP3(Value,To){}





/ **
*将前缀值转换为指定的基地。
*需要以下其中一个前缀:
*< table style =width:30%;>
*< tr>< td>'0b'< / td>< td> Base 2:< / td>< td> binary< / td>< / tr>
*< tr>< td>'0q'< / td>< td>基准4:< / td>< td> quaternary< / td>< / tr>
*< tr>< td>'0o'< / td>< td>基本8:< / td>< td>八进制< / td>< / tr> < / td>< td>< td>'0x>< / td>
*< / table>
*
* @param {字符串}值要转换的前缀值。
* @param {数字}要转换为的基数。
* @return转换后的基数。
* @customfunction
* /
函数BASEP4(Value,To){}


I can't figure out how in a Google Apps Script to display this correctly. I need it to display new lines in the jsdoc output(e.g. when the function tooltip window comes up in a Spreadheet functions.) I have tried html like
however it is just rendered as text and not a line break.

For example:

/**
 * Converts the prefixed value to the specified base.
 * Requires one of the following prefixes: 
 *    '0b' Base 2:   binary 
 *    '0q' Base 4:   quaternary 
 *    '0o' Base 8:   octal
 *    '0x' Base 16:  hexadecimal
 *
 * @param {string} Value The prefixed value to convert.
 * @param {number} To The base to convert to.
 * @return The converted base.
 * @customfunction
 */
function BASEP(Value, To) {

This just renders a text blob like:

Summary:
  Converts the prefixed value to the specified base. Requires
  one of the following prefixes: 0b Base 2: binary 0q Base 4:
  quaternary 0o Base 8:  octal 0x Base 16:  hexadecimal

解决方案

Here are a few ways to control the format of your jsdoc comments in Google Apps Script:

<pre>

/**
 * Converts the prefixed value to the specified base.
 * Requires one of the following prefixes: 
 * <pre>
 *    '0b' Base 2:   binary 
 *    '0q' Base 4:   quaternary 
 *    '0o' Base 8:   octal
 *    '0x' Base 16:  hexadecimal
 * </pre>
 *
 * @param {string} Value The prefixed value to convert.
 * @param {number} To The base to convert to.
 * @return The converted base.
 * @customfunction
 */
function BASEP(Value, To) { }

<p> paragraphs

/**
 * Converts the prefixed value to the specified base.
 * Requires one of the following prefixes: 
 * <p>'0b' Base 2:   binary </p>
 * <p>'0q' Base 4:   quaternary  </p>
 * <p>'0o' Base 8:   octal </p>
 * <p>'0x' Base 16:  hexadecimal </p>
 *
 * @param {string} Value The prefixed value to convert.
 * @param {number} To The base to convert to.
 * @return The converted base.
 * @customfunction
 */
function BASEP2(Value, To) { }

List

/**
 * Converts the prefixed value to the specified base.
 * Requires one of the following prefixes: 
 * <ul style="list-style: none;">
 *  <li> '0b' Base 2:   binary 
 *  <li> '0q' Base 4:   quaternary 
 *  <li> '0o' Base 8:   octal
 *  <li> '0x' Base 16:  hexadecimal
 * </ul>
 *
 * @param {string} Value The prefixed value to convert.
 * @param {number} To The base to convert to.
 * @return The converted base.
 * @customfunction
 */
function BASEP3(Value, To) { }

Table

/**
 * Converts the prefixed value to the specified base.
 * Requires one of the following prefixes: 
 * <table style="width:30%;">
 *  <tr><td>'0b'</td><td>Base 2:</td><td>binary</td></tr>
 *  <tr><td>'0q'</td><td>Base 4:</td><td>quaternary</td></tr>
 *  <tr><td>'0o'</td><td>Base 8:</td><td>octal</td></tr>
 *  <tr><td>'0x'</td><td>Base 16:</td><td>hexadecimal</td></tr>
 * </table>
 *
 * @param {string} Value The prefixed value to convert.
 * @param {number} To The base to convert to.
 * @return The converted base.
 * @customfunction
 */
function BASEP4(Value, To) { }

这篇关于如何在Google Apps jsdoc说明中强制换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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