Domanda

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

I have been utilizing the Documentation capabilities of RAD Studio Delphi XE2 across most of my global source (libraries such as business rules, components/controls, etc.). This places some commented text just before the declaration of various things in your source code, like so:

type
  ///   <summary>
  ///     This class is used for this and that.
  ///   </summary>
  TMyObject = class(TObject)
  ....

or even

/// <summary>
///   This function does this and that.
/// </summary>
/// <returns>
///   This is the result of what DoSomething produces.
/// </returns>
/// <remarks>
///   DoSomething is only a sample function for demonstration purposes.
/// </remarks>
function DoSomething: String;

The main reason I've been doing this is so that when you hover over a symbol, when it shows the insight, it will include this documentation text with it. For example, in a completely separate unit, hover over the text DoSomething wherever it's used and it will show you a hint box containing the exact text written in this documentation.

Hint: press either Ctrl+Shift+D or Ctrl+Alt+D (I've seen both those on different PC's) and it will open a window to make things easier. I stumbled across this when pressing Ctrl+Shift+S to save but accidentally hit D.

What I would like to know is how can I export this documentation to a CHM help file? I would like to make a help file linked to my library so a developer can use F1 in the code and see an explanation of what the code does. Just like the standard Delphi source documentation (and most other languages).

È stato utile?

Soluzione

It's not a CHM file but if you use Delphi Enterprise or higher the IDE has the ability to produce documentation using your properly formatted source code comments.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top