Categories
Delphi LiteHelp

LiteHelp For Delphi

LiteHelp is a lightweight portable context-sensitive help system for Windows desktop apps. You can read more about it in this post: https://www.dmitripopov.com/introducing-litehelp/

I also created a Delphi unit that allows to integrate LiteHelp into the context-sensitive help of Delphi VCL. It works pretty much the same way HTMLHelpViewer.pas works – just include it into your uses list and provide path to the folder where the help is located using Application.HelpFile. Also you will need to place LiteHelpViewer.exe in the same folder with your main executable. Now Delphi will run LiteHelpViewer.exe and browse to ContextID automatically. You can also locate keywords, execute search and switch languages using commands shown in the Delphi demo included into Delphi distributions that you can download from this link: http://www.helpinator.com/downloads/litehelpdelphi.zip

Here are some code samples

Sample No 1: LiteHelpViewer in your “uses” list:

unit uMain;

interface

uses
  LiteHelpViewer, Winapi.Windows, Winapi.Messages, System.SysUtils,
  System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm1 = class(TForm)

Sample No 2: Setting path to the help folder in the project source:

program LiteHelpViewerDemo;

uses
  SysUtils,
  Vcl.Forms,
  uMain in 'uMain.pas' {Form1};

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  // It's important to provide full path to the folder with LiteHelp files
  Application.HelpFile := IncludeTrailingBackSlash(ExtractFileDir(Application.Exename)) + 'help';
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

Sample No3: Executing some important help system commands:

// Open Table of Contents
procedure TForm1.btnOpenTableOfContentsClick(Sender: TObject);
begin
  Application.HelpShowTableOfContents;
end;

// Execute search for a term in edtSearch TEdit
procedure TForm1.btnSearchClick(Sender: TObject);
begin
  IHelpSystem3(Application.HelpSystem).ShowSearch(Trim(edtSearch.Text), Application.HelpFile);
end;

// Locate keyword from edtKeyword TEdit
procedure TForm1.btnGoToKeywordClick(Sender: TObject);
begin
  IHelpSystem3(Application.HelpSystem).ShowIndex(Trim(edtKeyword.Text), Application.HelpFile);
end;

Categories
LiteHelp

Introducing LiteHelp

LiteHelp is a lightweight non-HTML portable help system for Windows intended to be CHM (HTML Help) replacement, or, at least, alternative. I created it becuase my clients had numerous problems with online help in CHM format. It is long abandoned by Microsoft and ever since continues to grow security issues like a snowball.

I thought to myself: “What the hell, it’s 2019, we don’t need all those fancy HTML bells and whistles anymore. The content is what matters and markdown popularity shows it best”. So I decided to put together somewhat shelved help viewer project and my recent developments in Helpinator and create a help system of my dreams with just enough features and nothing more.

The viewer itself resembles that of HTML Help – a pane with 3 tabs on the left (Table of Contents, Index, Search) and content display area at the right. The only question was what component to use for content rendering but actually it was not much of a question since my code base is heavily dependent on excellent TRichView component from Sergei Tkachenko.

OK, yes, we do not need all that versatality, but we still need some cool things to let our users understand things we talk about faster. If you take a look at modern technical writing it’s not mostly about writing but about structured authoring. Specilized content items are what matters now, and I decided to follow that approach too. Helpinator was based on this approach from the start and in recent versions the number of content items even increased. So far we have:

  • Regular text items with basic formatting – nothing fancy here
  • Tables – OK, everybody need them
  • Figures – this is not just a picture, but a picture with a title and formatted in the output accordingly
  • Asides/admonitions – that colored paragraphs with title and icons intended to bring reader’s attention to.
  • Code samples – need to have syntax highlight
  • Step-by-step guides – not very common item, but it built into Helpinator for a long time already. Also DITA has a similar element.
  • Videos – both embeddable (Youtube/Vimeo) and local
  • FAQs. Though FAQs can be just plain formatted text it’s more convinient to render them as collapsible sections if the output format supports such dynamics.
  • Quizzes. Not that all necessary element, but learning assessment is important part of technical documentation nowdays.
  • Glossary of terms used in documentation.

I managed to implement them all in LiteHelp, so, yes, it’s a very cool help system.

Another feature to be noted is language support. LiteHelp format allows to store all content in one project, and it is possible to switch languages both programmatically and manually by user actions.

The viewer itself is a portable Windows executable with relatively (sic!) small footprint. I has a sort of API available via Windows messaging system, it allows to execute the following commands:

  • Open table of contents (default topic)
  • Open a topic with specified context ID
  • Open keyword index tab and locate a keyword
  • Open search tab and execute search
  • Select language

You can find more detailed description of methods in the readme file in the zip file of viewer.

Download the viewer: https://www.helpinator.com/downloads/litehelp.zip

Download sample: http://www.helpinator.com/downloads/litehelpsample.zip

Delphi help system integration: http://www.helpinator.com/downloads/litehelpdelphi.zip

A small GIF (created with GIFSteps) depicting LiteHelp features:

LiteHelp Features Overview