我对PHP文档块非常熟悉,因为这是我在过去15年中的工作。
/**
* Description
*
* @tag bla bla
* @tag more bla bla
*/
我想了解的是 Delphi 和/或 FreePascal 是否有类似的标准。根据我对大量代码的分析,我从未见过这样的标准,但我可能完全错了。
我对PHP文档块非常熟悉,因为这是我在过去15年中的工作。
/**
* Description
*
* @tag bla bla
* @tag more bla bla
*/
使用XMLDoc工具进行API文档和Delphi 2005的HelpInsight http://edn.embarcadero.com/article/32770
Delphi 2006中的XML文档 http://tondrej.blogspot.com/2006/03/xml-documentation-in-delphi-2006.html
DelphiCodeToDoc http://dephicodetodoc.sourceforge.net/
Doc-O-Matic http://www.doc-o-matic.com/examplesourcecode.html
PasDoc http://pasdoc.sipsolutions.net/
Pascal浏览器 http://www.peganza.com/Doxygen http://www.doxygen.nl/
Pas2Dox http://sourceforge.net/projects/pas2dox/
JADD - 又一个DelphiDoc http://delphidoc.sourceforge.net/有没有支持当前Delphi语法的Delphi代码文档生成器? https://stackoverflow.com/questions/673248/is-there-a-delphi-code-documentor-that-supports-current-delphi-syntax
类似于javadoc或c# xml doc的Delphi代码文档生成器 Code documentation for delphi similar to javadoc or c# xml doc
Delphi文档编写 https://stackoverflow.com/questions/33336/documenting-delphi
最新的Delphi支持解析XML文档。他们还在提示信息中使用这些信息(例如,如果您将鼠标光标移动到方法名称上)。
我正在使用此模板进行方法文档:
///<summary></summary>
///<param name=''></param>
///<returns></returns>
///<exception cref=""></exception>
///<since>2009-04-15</since>
type
{* This is an example class }
TMyClass = class
private
protected
public
{* Does some twiddling with AParam, and returns the result as String
@param AParam Input value
@return AParam incremented by 2, as String
@throws Exception 'Boo' if it's full moon }
function MyFunction(AParam: Integer): String;
end;
看起来doxygen有一个工具可以与文档化Pascal和Delphi代码一起使用。也许这会对你有所帮助。
我更喜欢将文档放在源代码之外(这样可以避免混乱),并使用随 FPC 附带的优秀 fpdoc 工具(FPC 的官方文档就是用它编写的)。
有几个标准,通常取决于所使用的文档工具。我们使用PasDoc,因此我们主要遵循其格式http://pasdoc.sipsolutions.net/,该格式基于JavaDoc。
另外,正如Gabr指出的那样,还有XMLDoc和许多其他工具,大多数具有类似的语法但存在细微差异。