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

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

Source: source/component/PasDoc_GenHtml.pas (line 202).

Protected function MakeBodyBegin: string; virtual;

Return common HTML content that goes right after <body>.

Source: source/component/PasDoc_GenHtml.pas (line 204).

Protected function MakeBodyEnd: string; virtual;

Return common HTML content that goes right before </body>.

Source: source/component/PasDoc_GenHtml.pas (line 206).

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.

Source: source/component/PasDoc_GenHtml.pas (line 208).

Protected function ConvertChar(c: char): string; override;

Called by ConvertString to convert a character. Will convert special characters to their html escape sequence -> test

Source: source/component/PasDoc_GenHtml.pas (line 213).

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.

Source: source/component/PasDoc_GenHtml.pas (line 215).

Protected function HtmlString(const S: string): string; override;

overrides TDocGenerator.HtmlString.HtmlString to return the string verbatim (TDocGenerator.HtmlString discards those strings)

Source: source/component/PasDoc_GenHtml.pas (line 219).

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.

Source: source/component/PasDoc_GenHtml.pas (line 223).

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.

Source: source/component/PasDoc_GenHtml.pas (line 228).

Protected function FormatHex(AString: string): string; override;

FormatHex will cause AString to be formatted in the way that Hex are formatted in Delphi.

Source: source/component/PasDoc_GenHtml.pas (line 232).

Protected function FormatNumeric(AString: string): string; override;

FormatNumeric will cause AString to be formatted in the way that Numeric are formatted in Delphi.

Source: source/component/PasDoc_GenHtml.pas (line 236).

Protected function FormatFloat(AString: string): string; override;

FormatFloat will cause AString to be formatted in the way that Float are formatted in Delphi.

Source: source/component/PasDoc_GenHtml.pas (line 240).

Protected function FormatString(AString: string): string; override;

FormatKeyWord will cause AString to be formatted in the way that strings are formatted in Delphi.

Source: source/component/PasDoc_GenHtml.pas (line 244).

Protected function FormatKeyWord(AString: string): string; override;

FormatKeyWord will cause AString to be formatted in the way that reserved words are formatted in Delphi.

Source: source/component/PasDoc_GenHtml.pas (line 248).

Protected function FormatCompilerComment(AString: string): string; override;

FormatCompilerComment will cause AString to be formatted in the way that compiler directives are formatted in Delphi.

Source: source/component/PasDoc_GenHtml.pas (line 252).

Protected function CodeString(const s: string): string; override;

Makes a String look like a coded String, i.e. <CODE>TheString</CODE> in Html.

Source: source/component/PasDoc_GenHtml.pas (line 256).

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.

Source: source/component/PasDoc_GenHtml.pas (line 260).

Protected procedure WriteStartOfCode; override;

This item has no description.

Source: source/component/PasDoc_GenHtml.pas (line 262).

Protected procedure WriteEndOfCode; override;

This item has no description.

Source: source/component/PasDoc_GenHtml.pas (line 263).

Protected procedure WriteAnchor(const AName: string); overload;

This item has no description.

Source: source/component/PasDoc_GenHtml.pas (line 265).

Protected procedure WriteAnchor(const AName, Caption: string); overload;

Write an anchor. Note that the Caption is assumed to be already processed with the ConvertString.

Source: source/component/PasDoc_GenHtml.pas (line 268).

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

Source: source/component/PasDoc_GenHtml.pas (line 270).

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

Source: source/component/PasDoc_GenHtml.pas (line 272).

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

Source: source/component/PasDoc_GenHtml.pas (line 273).

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
tag (but may also be used on other occasions in the future).

In this class it returns '', because it's valid for an output generator to simply ignore
tags if linebreaks can't be expressed in given output format.

Source: source/component/PasDoc_GenHtml.pas (line 275).

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.

Source: source/component/PasDoc_GenHtml.pas (line 277).

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.

Source: source/component/PasDoc_GenHtml.pas (line 278).

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.

Source: source/component/PasDoc_GenHtml.pas (line 280).

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.

Source: source/component/PasDoc_GenHtml.pas (line 283).

Protected function EscapeURL(const AString: string): string; virtual;

This item has no description.

Source: source/component/PasDoc_GenHtml.pas (line 287).

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.

Source: source/component/PasDoc_GenHtml.pas (line 289).

Protected function FormatAnchor(const Anchor: string): string; override;

This item has no description. Showing description inherited from TDocGenerator.FormatAnchor.

Writes a link-anchor.

Source: source/component/PasDoc_GenHtml.pas (line 291).

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 Result := Text. Output generators that can somehow express bold formatting (or at least emphasis of some text) should override this.

Source: source/component/PasDoc_GenHtml.pas (line 293).

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.

Source: source/component/PasDoc_GenHtml.pas (line 294).

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

Source: source/component/PasDoc_GenHtml.pas (line 296).

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

Source: source/component/PasDoc_GenHtml.pas (line 297).

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

Source: source/component/PasDoc_GenHtml.pas (line 298).

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 FileNames[0]. Output generators should override this.

Source: source/component/PasDoc_GenHtml.pas (line 300).

Protected function FormatList(ListData: TListData): string; override;

This item has no description. Showing description inherited from TDocGenerator.FormatList.

Format a list from given ListData.

Source: source/component/PasDoc_GenHtml.pas (line 302).

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.

Source: source/component/PasDoc_GenHtml.pas (line 304).

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.

Source: source/component/PasDoc_GenHtml.pas (line 306).

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Source: source/component/PasDoc_GenHtml.pas (line 308).

Public destructor Destroy; override;

This item has no description.

Source: source/component/PasDoc_GenHtml.pas (line 309).

Public function GetFileExtension: string; override;

Returns HTML file extension ".htm".

Source: source/component/PasDoc_GenHtml.pas (line 312).

Public procedure WriteDocumentation; override;

The method that does everything - writes documentation for all units and creates overview files.

Source: source/component/PasDoc_GenHtml.pas (line 316).

Properties

Published property Header: string read FHeader write FHeader;

some HTML code to be written as header for every page

Source: source/component/PasDoc_GenHtml.pas (line 319).

Published property Footer: string read FFooter write FFooter;

some HTML code to be written as footer for every page

Source: source/component/PasDoc_GenHtml.pas (line 321).

Published property HtmlBodyBegin: string read FHtmlBodyBegin write FHtmlBodyBegin;

This item has no description.

Source: source/component/PasDoc_GenHtml.pas (line 322).

Published property HtmlBodyEnd: string read FHtmlBodyEnd write FHtmlBodyEnd;

This item has no description.

Source: source/component/PasDoc_GenHtml.pas (line 323).

Published property HtmlHead: string read FHtmlHead write FHtmlHead;

This item has no description.

Source: source/component/PasDoc_GenHtml.pas (line 324).

Published property CSS: string read FCSS write FCSS;

Contents of the main CSS file (pasdoc.css).

Source: source/component/PasDoc_GenHtml.pas (line 326).

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.

Source: source/component/PasDoc_GenHtml.pas (line 329).

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

Source: source/component/PasDoc_GenHtml.pas (line 331).

Published property UseTipueSearch: boolean read FUseTipueSearch write FUseTipueSearch default False;

Enable Tipue fulltext search. See --use-tipue-search documentation.

Source: source/component/PasDoc_GenHtml.pas (line 335).


Generated by PasDoc 0.17.0.snapshot.