Code documentation for delphi similar to javadoc or c# xml doc [closed]
Asked Answered
E

8

16

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.

Encrimson answered 25/10, 2008 at 7:24 Comment(1)
RAD Studios XML Documentation Comments are documented at docwiki.embarcadero.com/RADStudio/Rio/en/…Wilkerson
A
7

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.

Audrieaudris answered 9/2, 2011 at 8:12 Comment(2)
Any tutorial on how to generate the documentation for delphi?Whitherward
You have synopse.info/fossil/wiki?name=SynProject+Tutorial and other links available.Audrieaudris
G
6

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.

Ginelle answered 25/10, 2008 at 8:14 Comment(2)
I also use PasDoc and run it from an Ant build script called by CruiseControl, FWIW.Berneicebernelle
Richard, that's a good point since it shows it can be automated via a build.Phrasal
S
5

Delphi + JavaDoc = DelphiCodeToDoc

Series answered 25/10, 2008 at 7:49 Comment(1)
I tried this and it crashed on and file that contained an anonymous procedure.Phonology
G
5

Try: - Doxygen documentation - Pas2Dox

Gauguin answered 25/10, 2008 at 16:44 Comment(3)
I use it successfully in the past five or so years, still a great and simple solution.Jaw
works great (and looks like the documentation for c and c++ project we also use)Paulettapaulette
It was unclear to me at first, so I wanted to add a comment to others that these two products work together. Pas2Dox seems to be an add-on for Doxygen, adding Delphi support to it.Cachet
J
2

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

Judyjudye answered 28/10, 2008 at 12:32 Comment(1)
The D2006 XMLDoc generator is completely broken. I tried to use it - does not work at after all patches.Sinker
H
1

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).

Hitlerism answered 27/10, 2008 at 14:34 Comment(0)
A
1

DelphiCodeToDoc also have a command-line to use it with continuous integration tool (for example).

Aviary answered 17/12, 2009 at 22:55 Comment(0)
R
1

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.

Rotarian answered 18/1, 2016 at 11:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.