8

I'm quite familiar with PHP dockblocks since it's been my job for the last 15+ years.

/**
  * Description
  *
  * @tag bla bla
  * @tag more bla bla
  */

What I'm trying to understand is if there is a standard like that for Delphi and/or FreePascal.

From my analysis on an awful lot of code I never seen any, but I could be dead wrong.

Pierre-Jean Coudert
  • 9,109
  • 10
  • 50
  • 59
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76

6 Answers6

15

Delphi documentation tools

Using the XMLDoc tool for API documentation and HelpInsight with Delphi 2005   http://edn.embarcadero.com/article/32770

XML Documentation in Delphi 2006   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 Browser   http://www.peganza.com/

Doxygen   http://www.doxygen.nl/

Pas2Dox   http://sourceforge.net/projects/pas2dox/

JADD - Just Another DelphiDoc   http://delphidoc.sourceforge.net/

Stackoverflow discussion

Is there a Delphi code documentor that supports current Delphi syntax?   https://stackoverflow.com/questions/673248/is-there-a-delphi-code-documentor-that-supports-current-delphi-syntax

Code documentation for delphi similar to javadoc or c# xml doc   Code documentation for delphi similar to javadoc or c# xml doc

Documenting Delphi   https://stackoverflow.com/questions/33336/documenting-delphi

albert
  • 8,285
  • 3
  • 19
  • 32
user81864
  • 563
  • 1
  • 4
  • 8
7

Latest Delphis support parsing of XML documentation. They also use this information in hints (for example if you move the mouse cursor over a method name).

I'm using this template for method documentation:

///<summary></summary>
///<param name=''></param>
///<returns></returns>
///<exception cref=""></exception>
///<since>2009-04-15</since>
gabr
  • 26,580
  • 9
  • 75
  • 141
1

It looks like doxygen has a tool which can be used in conjunction to document Pascal and Delphi code. Maybe that will help you.

albert
  • 8,285
  • 3
  • 19
  • 32
1800 INFORMATION
  • 131,367
  • 29
  • 160
  • 239
  • +1 I use doxygen and pas2dox in all my commercial Delphi / Free Pascal libraries, commenting in JavaDoc style works like a charm – mjn Apr 15 '09 at 12:32
1

On a project I'm currently working on, we're using DelphiCodeToDoc, which works reasonably well. Its syntax looks like this:

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;
onnodb
  • 5,241
  • 1
  • 32
  • 41
1

I prefer docs outside of the source (it always gets messy), and use the excellent fpdoc that comes with FPC. (FPC's own docs are written in it).

0

There are several standards, usually depending on the documentation tool being used. We use PasDoc, so we adhere mostly to its format http://pasdoc.sipsolutions.net/ which is based on JavaDoc.

Alternatively, there is XMLDoc as gabr pointed out and there are quite a few other tools, most having similar syntax with subtle differences.

dummzeuch
  • 10,975
  • 4
  • 51
  • 158