TCustomRichView.LoadMarkdown

<< Click to display table of contents >>

TCustomRichView.LoadMarkdown

Appends the content of Markdown file FileName to the document.

function LoadMarkdown(const FileName: TRVUnicodeString;
  CodePage: TRVCodePage = CP_UTF8): Boolean;

(Introduced in version 20)

Despite its name, this method does not clear the existing document before loading. To replace the current document with the content of this file, call Clear method before loading (and maybe DeleteUnusedStyles after Clear).

By default, the method assumes that the file has UTF-8 encoding; but you can specify another CodePage in the parameter.

Method type: viewerstyle viewer-style.

Parameters for loading are in MarkdownProperties. See the topic about the class of this property for the detailed explanation of Markdown import and export.

Unlike other loading methods, Markdown loading does not have an option to restrict formatting to existing text, paragraphs and list styles: it may add new styles.

By default, hyperlink targets are loaded in items tags. You can customize loading using OnReadHyperlink event.

Return value: "Was reading successful?"

 

See also methods of TRichView:

LoadMarkdownFromStream;

SaveMarkdown.

See also events of TRichView:

OnImportPicture;

OnReadHyperlink;

OnAssignImageFileName.

See also methods of TRichViewEdit:

InsertMarkdownFromFileEd.

See also:

Saving and loading in TRichView.