如何给自定义函数做备注及说明(2)—元数据

什么是元数据?

元数据就是表述函数的数据。通常在函数查询界面即可获得的信息。

1.    函数格式模版

元数据=[Documentation.Name="  ",        Documentation.Description="  ",        Documentation.Examples={[Description="  ",                                Code="  ",                                Result="  "

]                                }        ]

2.    返回函数

Value.ReplaceType(fx, Value.Type(fx) meta 元数据)

请注意这里的fx代表的是你原先定义的函数名称。

3.    函数名称

Documentation.Name="  "

4.    函数说明

Documentation.Description="  "

5.    函数案例

Documentation.Examples={[Description="  ",                             Code="  ",                             Result="  "]                              }

6.    举例

let

sum=(x,y)=>x+y,元数据=[Documentation.Name="两数求和",       Documentation.Description="返回x+y的结果",       Documentation.Examples={[Description="求1+2的结果",                                Code="sum(1,2)",                                Result="3"]                              }       ]

in

Value.ReplaceType(sum,Value.Type(sum) meta 元数据)

如果有用,动动你的小手进行转发。

你可能感兴趣的:(如何给自定义函数做备注及说明(2)—元数据)