Atata.Cli.HtmlValidate is a .NET library that provides an API for html-validate NPM package.
The package targets .NET Standard 2.0, which supports .NET 5+, .NET Framework 4.6.1+ and .NET Core/Standard 2.0+.
- Features
- Installation
- Usage
- HtmlValidateOptions Properties
- HtmlValidateResult Properties
- Feedback
- Thanks
- SemVer
- License
Provides C#/.NET API for html-validate CLI. Check out https://html-validate.org documentation for more info.
Install Atata.Cli.HtmlValidate
NuGet package.
-
Package Manager:
Install-Package Atata.Cli.HtmlValidate
-
.NET CLI:
dotnet add package Atata.Cli.HtmlValidate
Requires html-validate NPM package to be installed.
- Using NPM Command:
npm install -g html-validate
- Using Atata.Cli.Npm .NET library:
new NpmCli() .InstallIfMissing(HtmlValidateCli.Name, global: true);
- Using its own
HtmlValidateCli
class:new HtmlValidateCli() .RequireVersion("5.1.1");
The main class is HtmlValidateCli
located in Atata.Cli.HtmlValidate
namespace.
HtmlValidateResult result1 = HtmlValidateCli.InDirectory("some/dir")
.Validate("testme.html");
var options = new HtmlValidateOptions
{
Config = "someconfig.json",
Formatter = HtmlValidateFormatter.Codeframe("output.txt")
};
HtmlValidateResult result3 = HtmlValidateCli.InDirectory("some/dir")
.Validate("testme.html", options);
HtmlValidateResult result2 = await HtmlValidateCli.InDirectory("some/dir")
.ValidateAsync("testme.html");
HtmlValidateFormatter Formatter { get; set; }
Gets or sets the formatter.int? MaxWarnings { get; set; }
Gets or sets the maximum allowed warnings count. The default value isnull
, which means that warnings are allowed. Use0
to disallow warnings.string Config { get; set; }
Gets or sets the configuration file path (full or relative to CLIWorkingDirectory
).string[] Extensions { get; set; }
Gets or sets the file extensions to use when searching for files in directories. For example:"html"
,"vue"
, etc.
bool IsSuccessful { get; }
Gets a value indicating whether this result is successful.string Output { get; }
Gets the text output of result.
Any feedback, issues and feature requests are welcome.
If you faced an issue please report it to Atata.Cli.HtmlValidate Issues, ask a question on Stack Overflow using atata tag or use another Atata Contact way.
The library is implemented thanks to the sponsorship of Lombiq Technologies.
Atata Framework follows Semantic Versioning 2.0. Thus backward compatibility is followed and updates within the same major version (e.g. from 1.3 to 1.4) should not require code changes.
Atata is an open source software, licensed under the Apache License 2.0. See LICENSE for details.