Class TGenericHTMLDocGenerator
Unit
Declaration
type TGenericHTMLDocGenerator = class(TDocGenerator)
Description
HTML documentation generator.
Extends TDocGenerator and overwrites many of its methods to generate output in HTML format.
Source: source/component/PasDoc_GenHtml.pas (line 59).
Hierarchy
- TObject
- TPersistent
- TComponent
- TDocGenerator
- TGenericHTMLDocGenerator
Overview
Methods
| Protected | function MakeHead: string; |
| Protected | function MakeBodyBegin: string; virtual; |
| Protected | function MakeBodyEnd: string; virtual; |
| Protected | function ConvertString(const s: string): string; override; |
| Protected | function ConvertChar(c: char): string; override; |
| Protected | procedure WriteUnit(const HL: integer; const U: TPasUnit); override; |
| Protected | function HtmlString(const S: string): string; override; |
| Protected | function FormatPascalCode(const Line: string): string; override; |
| Protected | function FormatComment(AString: string): string; override; |
| Protected | function FormatHex(AString: string): string; override; |
| Protected | function FormatNumeric(AString: string): string; override; |
| Protected | function FormatFloat(AString: string): string; override; |
| Protected | function FormatString(AString: string): string; override; |
| Protected | function FormatKeyWord(AString: string): string; override; |
| Protected | function FormatCompilerComment(AString: string): string; override; |
| Protected | function CodeString(const s: string): string; override; |
| Protected | function CreateLink(const Item: TBaseItem): string; override; |
| Protected | procedure WriteStartOfCode; override; |
| Protected | procedure WriteEndOfCode; override; |
| Protected | procedure WriteAnchor(const AName: string); overload; |
| Protected | procedure WriteAnchor(const AName, Caption: string); overload; |
| Protected | function Paragraph: string; override; |
| Protected | function EnDash: string; override; |
| Protected | function EmDash: string; override; |
| Protected | function LineBreak: string; override; |
| Protected | function URLLink(const URL: string): string; override; |
| Protected | function URLLink(const URL, LinkDisplay: string): string; override; |
| Protected | procedure WriteExternalCore(const ExternalItem: TExternalItem; const Id: TTranslationID); override; |
| Protected | function MakeItemLink(const Item: TBaseItem; const LinkCaption: string; const LinkContext: TLinkContext): string; override; |
| Protected | function EscapeURL(const AString: string): string; virtual; |
| Protected | function FormatSection(HL: integer; const Anchor: string; const Caption: string): string; override; |
| Protected | function FormatAnchor(const Anchor: string): string; override; |
| Protected | function FormatBold(const Text: string): string; override; |
| Protected | function FormatItalic(const Text: string): string; override; |
| Protected | function FormatWarning(const Text: string): string; override; |
| Protected | function FormatNote(const Text: string): string; override; |
| Protected | function FormatPreformatted(const Text: string): string; override; |
| Protected | function FormatImage(FileNames: TStringList): string; override; |
| Protected | function FormatList(ListData: TListData): string; override; |
| Protected | function FormatTable(Table: TTableData): string; override; |
| Protected | function FormatTableOfContents(Sections: TStringPairVector): string; override; |
| Public | constructor Create(AOwner: TComponent); override; |
| Public | destructor Destroy; override; |
| Public | function GetFileExtension: string; override; |
| Public | procedure WriteDocumentation; override; |
Properties
| Published | property Header: string read FHeader write FHeader; |
| Published | property Footer: string read FFooter write FFooter; |
| Published | property HtmlBodyBegin: string read FHtmlBodyBegin write FHtmlBodyBegin; |
| Published | property HtmlBodyEnd: string read FHtmlBodyEnd write FHtmlBodyEnd; |
| Published | property HtmlHead: string read FHtmlHead write FHtmlHead; |
| Published | property CSS: string read FCSS write FCSS; |
| Published | property Bootstrap: boolean read FBootstrap write FBootstrap default true; |
| Published | property NumericFilenames: boolean read FNumericFilenames write FNumericFilenames
default false; |
| Published | property UseTipueSearch: boolean read FUseTipueSearch write FUseTipueSearch
default False; |
Description
Methods
| Protected | function MakeHead: string; |
|
Return common HTML content that goes inside <head>. | |
| Protected | function MakeBodyBegin: string; virtual; |
|
Return common HTML content that goes right after <body>. | |
| Protected | function MakeBodyEnd: string; virtual; |
|
Return common HTML content that goes right before </body>. | |
| Protected | function ConvertString(const s: string): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.ConvertString. Converts for each character in S, thus assembling a String that is returned and can be written to the documentation file. The @ character should not be converted, this will be done later on. | |
| Protected | function ConvertChar(c: char): string; override; |
|
Called by ConvertString to convert a character. Will convert special characters to their html escape sequence -> test | |
| Protected | procedure WriteUnit(const HL: integer; const U: TPasUnit); override; |
|
This item has no description. Showing description inherited from TDocGenerator.WriteUnit. Abstract method that writes all documentation for a single unit U to output, starting at heading level HL. Implementation must be provided by descendant objects and is dependent on output format. | |
| Protected | function HtmlString(const S: string): string; override; |
|
overrides TDocGenerator.HtmlString.HtmlString to return the string verbatim (TDocGenerator.HtmlString discards those strings) | |
| Protected | function FormatPascalCode(const Line: string): string; override; |
|
FormatPascalCode will cause Line to be formatted in the way that Pascal code is formatted in Delphi. | |
| Protected | function FormatComment(AString: string): string; override; |
|
FormatComment will cause AString to be formatted in the way that comments other than compiler directives are formatted in Delphi. See: FormatCompilerComment. | |
| Protected | function FormatHex(AString: string): string; override; |
|
FormatHex will cause AString to be formatted in the way that Hex are formatted in Delphi. | |
| Protected | function FormatNumeric(AString: string): string; override; |
|
FormatNumeric will cause AString to be formatted in the way that Numeric are formatted in Delphi. | |
| Protected | function FormatFloat(AString: string): string; override; |
|
FormatFloat will cause AString to be formatted in the way that Float are formatted in Delphi. | |
| Protected | function FormatString(AString: string): string; override; |
|
FormatKeyWord will cause AString to be formatted in the way that strings are formatted in Delphi. | |
| Protected | function FormatKeyWord(AString: string): string; override; |
|
FormatKeyWord will cause AString to be formatted in the way that reserved words are formatted in Delphi. | |
| Protected | function FormatCompilerComment(AString: string): string; override; |
|
FormatCompilerComment will cause AString to be formatted in the way that compiler directives are formatted in Delphi. | |
| Protected | function CodeString(const s: string): string; override; |
|
Makes a String look like a coded String, i.e. <CODE>TheString</CODE> in Html. | |
| Protected | function CreateLink(const Item: TBaseItem): string; override; |
|
Returns a link to an anchor within a document. HTML simply concatenates the strings with a "#" character between them. | |
| Protected | procedure WriteStartOfCode; override; |
|
This item has no description. | |
| Protected | procedure WriteEndOfCode; override; |
|
This item has no description. | |
| Protected | procedure WriteAnchor(const AName: string); overload; |
|
This item has no description. | |
| Protected | procedure WriteAnchor(const AName, Caption: string); overload; |
|
Write an anchor. Note that the Caption is assumed to be already processed with the ConvertString. | |
| Protected | function Paragraph: string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.Paragraph. This is paragraph marker in output documentation. Default implementation in this class simply returns ' ' (one space). | |
| Protected | function EnDash: string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.EnDash. See TTagManager.EnDash. Default implementation in this class returns '--'. | |
| Protected | function EmDash: string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.EmDash. See TTagManager.EmDash. Default implementation in this class returns '---'. | |
| Protected | function LineBreak: string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.LineBreak. Markup that forces line break in given output format (e.g. '<br>' in html or '\\' in LaTeX). It is used on In this class it returns '', because it's valid for an output generator to simply ignore | |
| Protected | function URLLink(const URL: string): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.URLLink. Markup to display URL in a description. E.g. HTML generator will want to wrap this in <a href="...">...</a>. Note that passed here URL is not processed by ConvertString (because sometimes it could be undesirable). If you want you can process URL with ConvertString when overriding this method. Default implementation in this class simply returns ConvertString(URL). This is good if your documentation format does not support anything like URL links. | |
| Protected | function URLLink(const URL, LinkDisplay: string): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.URLLink. Text which will be shown for an URL tag. URL is a link to a website or e-mail address. LinkDisplay is an optional parameter which will be used as the display name of the URL. | |
| Protected | procedure WriteExternalCore(const ExternalItem: TExternalItem; const Id: TTranslationID); override; |
|
This item has no description. Showing description inherited from TDocGenerator.WriteExternalCore. This is called from WriteExternal when ExternalItem.Title and ShortTitle are already set, message about generating appropriate item is printed etc. This should write ExternalItem, including ExternalItem.DetailedDescription, ExternalItem.Authors, ExternalItem.Created, ExternalItem.LastMod. | |
| Protected | function MakeItemLink(const Item: TBaseItem; const LinkCaption: string; const LinkContext: TLinkContext): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.MakeItemLink. Return a link to item Item which will be displayed as LinkCaption. Returned string may be directly inserted inside output documentation. LinkCaption will be always converted using ConvertString before writing, so don't worry about doing this yourself when calling this method. LinkContext may be used in some descendants to present the link differently, see TLinkContext for it's meaning. If some output format doesn't support this feature, it can return simply ConvertString(LinkCaption). This is the default implementation of this method in this class. | |
| Protected | function EscapeURL(const AString: string): string; virtual; |
|
This item has no description. | |
| Protected | function FormatSection(HL: integer; const Anchor: string; const Caption: string): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.FormatSection. Writes a section heading and a link-anchor. | |
| Protected | function FormatAnchor(const Anchor: string): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.FormatAnchor. Writes a link-anchor. | |
| Protected | function FormatBold(const Text: string): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.FormatBold. Return Text formatted using bold font. Given Text is already in the final output format (with characters converted using ConvertString, @-tags expanded etc.). Implementation of this method in this class simply returns | |
| Protected | function FormatItalic(const Text: string): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.FormatItalic. Return Text formatted using italic font. Analogous to FormatBold. | |
| Protected | function FormatWarning(const Text: string): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.FormatWarning. Return Text using bold font by calling FormatBold(Text). | |
| Protected | function FormatNote(const Text: string): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.FormatNote. Return Text using italic font by calling FormatItalic(Text). | |
| Protected | function FormatPreformatted(const Text: string): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.FormatPreformatted. Return Text preserving spaces and line breaks. Note that Text passed here is not yet converted with ConvertString. The implementation of this method in this class just returns ConvertString(Text). | |
| Protected | function FormatImage(FileNames: TStringList): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.FormatImage. Return markup to show an image. FileNames is a list of possible filenames of the image. FileNames always contains at least one item (i.e. FileNames.Count >= 1), never contains empty lines (i.e. Trim(FileNames[I]) <> ''), and contains only absolute filenames. E.g. HTML generator will want to choose the best format for HTML, then somehow copy the image from FileNames[Chosen] and wrap this in <img src="...">. Implementation of this method in this class simply shows | |
| Protected | function FormatList(ListData: TListData): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.FormatList. Format a list from given ListData. | |
| Protected | function FormatTable(Table: TTableData): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.FormatTable. Return appropriate content for given Table. It's guaranteed that the Table passed here will have at least one row and in each row there will be at least one cell, so you don't have to check it within descendants. | |
| Protected | function FormatTableOfContents(Sections: TStringPairVector): string; override; |
|
This item has no description. Showing description inherited from TDocGenerator.FormatTableOfContents. Override this if you want to insert something on @tableOfContents tag. As a parameter you get already prepared tree of sections that your table of contents should show. Each item of Sections is a section on the level 1. Item's Name is section name, item's Value is section caption, item's Data is a TStringPairVector instance that describes subsections (on level 2) below this section. And so on, recursively. Sections given here are never nil, and item's Data is never nil. But of course they may contain 0 items, and this should be a signal to you that given section doesn't have any subsections. Default implementation of this method in this class just returns empty string. | |
| Public | constructor Create(AOwner: TComponent); override; |
|
This item has no description. | |
| Public | destructor Destroy; override; |
|
This item has no description. | |
| Public | function GetFileExtension: string; override; |
|
Returns HTML file extension ".htm". | |
| Public | procedure WriteDocumentation; override; |
|
The method that does everything - writes documentation for all units and creates overview files. | |
Properties
| Published | property Header: string read FHeader write FHeader; |
|
some HTML code to be written as header for every page | |
| Published | property Footer: string read FFooter write FFooter; |
|
some HTML code to be written as footer for every page | |
| Published | property HtmlBodyBegin: string read FHtmlBodyBegin write FHtmlBodyBegin; |
|
This item has no description. | |
| Published | property HtmlBodyEnd: string read FHtmlBodyEnd write FHtmlBodyEnd; |
|
This item has no description. | |
| Published | property HtmlHead: string read FHtmlHead write FHtmlHead; |
|
This item has no description. | |
| Published | property CSS: string read FCSS write FCSS; |
|
Contents of the main CSS file (pasdoc.css). | |
| Published | property Bootstrap: boolean read FBootstrap write FBootstrap default true; |
|
If true, add Bootstrap CSS and JS. Definitions in CSS will be evaluated after Bootstrap's ones. | |
| Published | property NumericFilenames: boolean read FNumericFilenames write FNumericFilenames
default false; |
|
if set to true, numeric filenames will be used rather than names with multiple dots | |
| Published | property UseTipueSearch: boolean read FUseTipueSearch write FUseTipueSearch
default False; |
|
Enable Tipue fulltext search. See --use-tipue-search documentation. | |
Generated by PasDoc 0.17.0.snapshot.