PoC of my way of storing and organizing a static html files in zip archive and displaying it in Delphi application by using the special wrapper TEdgeZipServer
over the control TEdgeBrowser
.
Library handles TCustomEdgeBrowser.OnWebResourceRequested
request and loads files from ZIP archive you specified.
Nothing, it's just proof-of-concept. For building really amazing and advanced html-based UI use the great HTML Component Library.
- (optional) Make sure your dev environment is ready to use Chromium-based Edge WebView2 browser. Use Embarcadero guide Using TEdgeBrowser Component and Changes to the TWebBrowser Component as a start point.
- Write html-based help and add it to ZIP file. You can use any program like 7-Zip or WinRar. You also can use helper PowerShell script make-archive.ps1 to zip any folder:
PS C:\Projects\EdgeZipServer> .\Tools\make-archive.ps1 -SourceFolder '.\Demos\Docs\Variant 1\' -OutputFileName '.\Demos\Docs\Varian 1.zip'
- Link UEdgeBrowserZipServer.pas file in your project and assign class
TEdgeZipServer
to anyTEdgeBrowser
control:
var zipFile := TZipFile.Create;
zipFile.Open('..\..\..\Docs\Variant 1.zip', TZipMode.zmRead);
edgeServer := TEdgeZipServer.Create(zipFile, EdgeBrowser1, '*://contoso.com/*');
EdgeBrowser1.Navigate('http://contoso.com/');
- Copy file WebView2Loader.dll to your exe output folder.
Check out Demos folder for examples of usage.
Loading file from zip archive basic example.
More advanced example of using TEdgeZipServer
class.
Example of storing ZIP archive as exe resource and loading data from it.
iDocs - one page documentation html template.
Doctemplate - A simple HTML/CSS documentation template.
HelpNDoc - modern help authoring tool with an intuitive user interface.
ReadTheDocs - Downloadable Documentation of online version of ReadTheDocs.
chm-html - Python CHM compiler that outputs an HTML5 powered CHM browser packaged with the CHM's data. Documentation of kbengine as example of CHM help project.
itinerary-html-template - Itinerary HTML template. Example of loading custom data into static HTML content.