I need a code documentation tool similar to javadoc or c# xml doc for delphi code. What is the best tool? I prefer a technology, which is in the future compatible to the Microsoft sandcastle project.
问题:
回答1:
Take a look at SynProject, an Open Source tool written in Delphi.
It was designed to handle a full documentation workflow, from specifications to release notes, including tests, architecture and design; and of course there is an integrated Delphi parser to generate architecture documentation from existing Delphi source code.
For the architecture document, the source code can extract comments (ala PasDoc) then embed this text into the main Architecture document (with class hierarchy diagrams and unit dependencies).
You write a plain text file using a wiki-like syntax in a dedicated text editor, then SynProject creates well formated Word documents from it. Some Wizards are available to access the content. But since it's stored as plain file, multiple programmers can write on it, using any SCM tool (SVN, Fossil...).
For instance, I currently use it for writing maintenance documentation for a huge and old Delphi application (about 2,000,000 lines of code written in Delphi 5 and 6), with no prior available documentation. You describe the changes made to the code (by quoting the unit/class/method), then the tool will update all documentations to reflect and trace those modifications. SynProject was designed to be compliant with some very "delicate" regulation rules (IEC 62304), but can be used for any project due to its unique "flat" design.
Note: I'm posting this a long time after the question, because SynProject was not existing at this time, and can be worth looking at. This thread has been defined as a reference for that question.
回答2:
Delphi + JavaDoc = DelphiCodeToDoc
回答3:
As far as I'm aware, there is no tool easily compatible with Microsoft Sandcastle - at least until somebody actually bothers to write one, to modify an existing one, or to create a toolchain to properly transform the output.
I've personally used PasDoc with great success. I recommend building the latest SVN version, since the current release occasionally croaks on complicated interface definitions.
回答4:
Try: - Doxygen documentation - Pas2Dox
回答5:
Since Delphi 2005 it is build in the Delphi compiler. It uses the XMLDoc standard which uses XML style comments. Just as C# does, so I guess Sandcastle can handle it. See http://dn.codegear.com/article/32770 and http://tondrej.blogspot.com/2006/03/xml-documentation-in-delphi-2006.html
Also see Documenting Delphi
回答6:
Sandcastle needs to get access to the assemblies in order to generate it's documentation, which means that it is only applicable for .net languages (although I'm not sure able Delphi.Net). However, Delphi 2007 and 2009 has an inline XML documentation very similar to C#. When you switch on the 'generate XML documentation' option in the project options, it will build XML documentation based on these comments. XSLT can then be used to generate whatever documentation format you need (this is the difficult bit).
回答7:
DelphiCodeToDoc also have a command-line to use it with continuous integration tool (for example).
回答8:
The question is pretty old, but I had the same problem today and found this post. Delphi 2007 allows following syntax, which seems to be equal to the C# documentations:
/// <summary>
/// Summary of the function / class
/// </summary>
/// <param name="param1">Description of the parameter param1</param>
/// <param name="param2">Description of the parameter param2</param>
/// <param name="param3">Description of the parameter param3</param>
/// <returns>Description of the return value</returns>
function test(param1, param2, param3: string): string;
For <summary>
, there doesn't seem to be a possibility to allow linebreaks. <br />
doesn't work.