Skip to content

Commit 04344a8

Browse files
Update README.md; Update package description
1 parent 04c71ee commit 04344a8

File tree

2 files changed

+74
-4
lines changed

2 files changed

+74
-4
lines changed

README.md

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![NuGet](http://img.shields.io/nuget/v/Atata.Cli.HtmlValidate.svg?style=flat)](https://www.nuget.org/packages/Atata.Cli.HtmlValidate/)
44
[![GitHub release](https://img.shields.io/github/release/atata-framework/atata-cli-htmlvalidate.svg)](https://github.com/atata-framework/atata-cli-htmlvalidate/releases)
5+
[![Build status](https://dev.azure.com/atata-framework/atata-cli-htmlvalidate/_apis/build/status/atata-cli-htmlvalidate-ci?branchName=main)](https://dev.azure.com/atata-framework/atata-cli-htmlvalidate/_build/latest?definitionId=43&branchName=main)
56
[![Slack](https://img.shields.io/badge/join-Slack-green.svg?colorB=4EB898)](https://join.slack.com/t/atata-framework/shared_invite/zt-5j3lyln7-WD1ZtMDzXBhPm0yXLDBzbA)
67
[![Atata docs](https://img.shields.io/badge/docs-Atata_Framework-orange.svg)](https://atata.io)
78
[![Twitter](https://img.shields.io/badge/[email protected])](https://twitter.com/AtataFramework)
@@ -15,17 +16,22 @@
1516
- [Features](#features)
1617
- [Installation](#installation)
1718
- [Usage](#usage)
19+
- [HtmlValidateOptions Properties](#htmlvalidateoptions-properties)
20+
- [HtmlValidateResult Properties](#htmlvalidateresult-properties)
1821
- [Feedback](#feedback)
1922
- [SemVer](#semver)
2023
- [License](#license)
2124

2225
## Features
2326

24-
To be added...
27+
Provides C#/.NET API for [html-validate CLI](https://html-validate.org/usage/cli.html).
28+
Check out <https://html-validate.org> documentation for more info.
2529

2630
## Installation
2731

28-
Install [`Atata.Cli`](https://www.nuget.org/packages/Atata.Cli.HtmlValidate/) NuGet package.
32+
### NuGet Package
33+
34+
Install [`Atata.Cli.HtmlValidate`](https://www.nuget.org/packages/Atata.Cli.HtmlValidate/) NuGet package.
2935

3036
- Package Manager:
3137
```
@@ -37,9 +43,71 @@ Install [`Atata.Cli`](https://www.nuget.org/packages/Atata.Cli.HtmlValidate/) Nu
3743
dotnet add package Atata.Cli.HtmlValidate
3844
```
3945

46+
### NPM Package
47+
48+
Requires [html-validate](https://www.npmjs.com/package/html-validate) NPM package to be installed.
49+
50+
- Using NPM Command:
51+
```
52+
npm install -g html-validate
53+
```
54+
- Using [Atata.Cli.Npm](https://www.nuget.org/packages/Atata.Cli.Npm/) .NET library:
55+
```cs
56+
new NpmCli()
57+
.InstallIfMissing(HtmlValidateCli.Name, global: true);
58+
```
59+
4060
## Usage
4161

42-
To be added...
62+
The main class is `HtmlValidateCli` located in `Atata.Cli.HtmlValidate` namespace.
63+
64+
### Validate HTML File
65+
66+
```cs
67+
HtmlValidateResult result1 = HtmlValidateCli.InDirectory("some/dir")
68+
.Validate("testme.html");
69+
```
70+
71+
### Validate HTML File With Options
72+
73+
```cs
74+
var options = new HtmlValidateOptions
75+
{
76+
Config = "someconfig.json",
77+
Formatter = HtmlValidateFormatter.Codeframe("output.txt")
78+
};
79+
80+
HtmlValidateResult result3 = HtmlValidateCli.InDirectory("some/dir")
81+
.Validate("testme.html", options);
82+
```
83+
84+
### Validate HTML File Asynchronously
85+
86+
```cs
87+
HtmlValidateResult result2 = await HtmlValidateCli.InDirectory("some/dir")
88+
.ValidateAsync("testme.html");
89+
```
90+
91+
## HtmlValidateOptions Properties
92+
93+
- **`HtmlValidateFormatter Formatter { get; set; }`**\
94+
Gets or sets the formatter.
95+
- **`int? MaxWarnings { get; set; }`**\
96+
Gets or sets the maximum allowed warnings count.
97+
The default value is `null`, which means that warnings are allowed.
98+
Use `0` to disallow warnings.
99+
- **`string Config { get; set; }`**\
100+
Gets or sets the configuration file path (full or relative to CLI `WorkingDirectory`).
101+
- **`string[] Extensions { get; set; }`**\
102+
Gets or sets the file extensions to use when searching for files in directories.
103+
For example: `"html"`, `"vue"`, etc.
104+
105+
## HtmlValidateResult Properties
106+
107+
- **`bool IsSuccessful { get; }`**\
108+
Gets a value indicating whether this result is successful.
109+
- **`string Output { get; }`**\
110+
Gets the text output of result.
43111

44112
## Feedback
45113

src/Atata.Cli.HtmlValidate/Atata.Cli.HtmlValidate.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
<Version>1.0.0</Version>
66
<Description>.NET library that provides an API for html-validate NPM package.
77

8-
Targets .NET Standard 2.0.</Description>
8+
Targets .NET Standard 2.0.
9+
10+
Requires html-validate (https://www.npmjs.com/package/html-validate) NPM package to be installed.</Description>
911
<RepositoryUrl>https://github.com/atata-framework/atata-cli-htmlvalidate</RepositoryUrl>
1012
<PackageId>Atata.Cli.HtmlValidate</PackageId>
1113
<PackageTags>atata cli api html-validate html validation</PackageTags>

0 commit comments

Comments
 (0)