Markdown Help Viewer Demo
This file an example of help system based on Markdown files, for the MarkdownHelpViewerDemo
The integration was tested from Delphi XE6 to Delphi 12: for older versions of Delphi please give a request into "Issue section"
Step to activate this Help into MarkdownHelpViewerDemo Application
Use MarkdownHelpViewer.pas (located into AppInterface folder) in dpr:
MarkdownHelpViewer in '..\..\AppInterface\MarkDownHelpViewer.pas',
then specify the default file of the help:
Application.HelpFile := ExtractFilePath(Application.ExeName)+'..\Help\Home.md';
If you have installed the viewer using the provided Setup, the installation folder of the Viewer is registere into:
HKEY_CLASSES_ROOT\Applications\MDHelpViewer.exe\Shell\Open\Command
so the interface can launch the viewer automatically.
If you don't want to use the provided Setup you can register the location of the Viewer built by yourself and deployed to a specific location, for example:
{$IFDEF WIN32}
RegisterMDViewerLocation(ExtractFilePath(Application.ExeName)+
'..\..\Bin32\MDHelpViewer.exe');
{$ELSE}
RegisterMDViewerLocation(ExtractFilePath(Application.ExeName)+
'..\..\Bin64\MDHelpViewer.exe');
{$ENDIF}
Rules to open the correct file using HelpContext or HelpTopic
To test the application you can lauch the Home.md help using the menu About/Help: in the OnClick handler invoke the help:
procedure TfmMain.HelpMenuItemClick(Sender: TObject);
begin
Application.HelpKeyword('home');
end;
In any Delphi component, you can define HelpType (htKeyword or htContext) and the specify HelpKeyword (string) or HelpContext (Integer).
When the user press "F1" inside the application, the HelpSystem is invoked with HelpKeyword or HelpContext.
Then the interface searches in the same folder of default file (specified into Application.HelpFile) the specific file using those rules:
Rules of precedence to search filed based on Help keyword or Help Context:
- first search a file named as the Keyword or the Context with any markdown extension (eg. 1000.md, MainForm.md)
- Then, try the Help Name and the Keyword (eg.Home1000.md, HomeMainForm.md)
- At least, try the Help Name and the Keyword with underscore (eg.Home_1000.md, Home_MainForm.md)
License
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.