【问题标题】:Is there any particular standards or name for documenting endpoints of your library?是否有任何特定的标准或名称来记录库的端点?
【发布时间】:2019-07-04 09:05:20
【问题描述】:

我在网上看到的每个库、教程或框架文档,都有一些用于访问端点或功能的伪代码语法,但有时它没有任何意义。有什么标准吗?

例如 chmod +x 这里文件名包含在 这些符号中,但是在编写命令时我们忽略了 这些,同样,mozilla 开发人员指南具有以下 JavaScript 箭头函数的语法。

(param1, param2, …, paramN) => { statements } 
(param1, param2, …, paramN) => expression
// equivalent to: => { return expression; }

// Parentheses are optional when there's only one parameter name:
(singleParam) => { statements }
singleParam => { statements }

// The parameter list for a function with no parameters should be written with a pair of parentheses.
() => { statements }

那么对于此类通用文档是否有任何定义的标准?

【问题讨论】:

    标签: javascript coding-style documentation


    【解决方案1】:

    JSDoc 规范定义了大多数 IDE(VisualStudio、WebStorm、NetBeans 等)支持的文档语法。 Eclipse 和 Aptana 支持类似的规范ScriptDoc

    如果项目使用特定工具生成文档,则必须使用该工具定义的语法。试试Google them 看看更多。

    如果文档是手写的,或者文档在代码 cmets 或自文档函数中,则没有严格的语法,但大多数开发人员使用 JSDoc,因为它受 IDE 支持。

    其他语言也有很多类似的规范,例如PHPDoc,其中大部分是基于Sun 为记录Java 类和方法而开发的JavaDoc

    【讨论】:

      猜你喜欢
      • 2015-05-19
      • 2010-12-28
      • 2011-10-18
      • 1970-01-01
      • 2015-01-12
      • 2018-02-24
      • 1970-01-01
      • 1970-01-01
      • 2017-02-15
      相关资源
      最近更新 更多