dotnet add package PommaLabs.HtmlArk --version 1.5.0
NuGet\Install-Package PommaLabs.HtmlArk -Version 1.5.0
<PackageReference Include="PommaLabs.HtmlArk" Version="1.5.0" />
paket add PommaLabs.HtmlArk --version 1.5.0
#r "nuget: PommaLabs.HtmlArk, 1.5.0"
// Install PommaLabs.HtmlArk as a Cake Addin #addin nuget:?package=PommaLabs.HtmlArk&version=1.5.0 // Install PommaLabs.HtmlArk as a Cake Tool #tool nuget:?package=PommaLabs.HtmlArk&version=1.5.0
This project is a .NET rewrite of the homonymous Python project, from which the command line interface has been copied in order to ease interoperability.
Most disclaimers which were valid for the original library apply here too:
- ⚠️ HtmlArk should be used with trusted HTML pages only or in a sandboxed environment. Untrusted HTML pages might contain resource links which are valid for HtmlArk but they might pose a serious security risk to your organization.
- Most browsers support data URIs, but as usual IE support might be less than ideal. Check data URIs compatibility on Can I use.
HtmlArk can be used to "pack" web pages into single HTML files. However, HtmlArk is not a crawler, so it must be paired with one in order to pack entire websites.
💡 If you plan to serve packed web pages, please remember to turn on GZIP compression. It usually yields good results and it helps to reduce download size.
Table of Contents
NuGet package PommaLabs.HtmlArk is available for download:
dotnet add package PommaLabs.HtmlArk
HtmlArk .NET tool can be installed with following command:
dotnet tool install PommaLabs.HtmlArk.Tool
As a library, HtmlArk can be included with the following
using statement in your class:
And then, it can be used like this, for example:
IHtmlArchiver htmlArchiver = new HtmlArchiver(NullLogger<HtmlArchiver>.Instance); string archivedHtml = await htmlArchiver.ArchiveAsync(new Uri("https://www.example.com/"));
If you use dependency injection, it can be registered this way:
services.AddHtmlArchiver(); // Maps IHtmlArchiver to HtmlArchiver as singleton.
HtmlArk .NET tool accepts the following command line arguments:
Interface is modeled after the original Python project, so it should be pretty easy to switch between them.
Small note: If editing the README, please conform to the standard-readme specification.
Visual Studio Code, with Remote Containers extension, is the recommended way to work on this project.
A development container has been configured with all required tools.
Visual Studio Community is also supported
and an updated solution file,
htmlark.sln, has been provided.
When opening the development container, dependencies should be automatically restored.
Anyway, dependencies can be restored with following command:
Tests can be run with following command:
Tests can also be run with following command, which collects coverage information:
./build.sh --target run-tests
MIT © 2020-2023 Alessio Parma
|Product||Versions Compatible and additional computed target framework versions.|
|.NET||net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed.|
|.NET Core||netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed.|
|.NET Standard||netstandard2.0 is compatible. netstandard2.1 was computed.|
|.NET Framework||net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed.|
|MonoAndroid||monoandroid was computed.|
|MonoMac||monomac was computed.|
|MonoTouch||monotouch was computed.|
|Tizen||tizen40 was computed. tizen60 was computed.|
|Xamarin.iOS||xamarinios was computed.|
|Xamarin.Mac||xamarinmac was computed.|
|Xamarin.TVOS||xamarintvos was computed.|
|Xamarin.WatchOS||xamarinwatchos was computed.|
- AngleSharp (>= 0.17.1)
- AngleSharp.Css (>= 0.17.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.3)
- PommaLabs.MimeTypes (>= 2.8.3)
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.