Code Monkey home page Code Monkey logo

atata-cli-htmlvalidate's Introduction

Atata.Cli.HtmlValidate

NuGet GitHub release Build status Slack Atata docs Twitter

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+.

Table of Contents

Features

Provides C#/.NET API for html-validate CLI. Check out https://html-validate.org documentation for more info.

Installation

NuGet Package

Install Atata.Cli.HtmlValidate NuGet package.

  • Package Manager:

    Install-Package Atata.Cli.HtmlValidate
    
  • .NET CLI:

    dotnet add package Atata.Cli.HtmlValidate
    

NPM Package

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");

Usage

The main class is HtmlValidateCli located in Atata.Cli.HtmlValidate namespace.

Validate HTML File

HtmlValidateResult result1 = HtmlValidateCli.InDirectory("some/dir")
    .Validate("testme.html");

Validate HTML File With Options

var options = new HtmlValidateOptions
{
    Config = "someconfig.json",
    Formatter = HtmlValidateFormatter.Codeframe("output.txt")
};

HtmlValidateResult result3 = HtmlValidateCli.InDirectory("some/dir")
    .Validate("testme.html", options);

Validate HTML File Asynchronously

HtmlValidateResult result2 = await HtmlValidateCli.InDirectory("some/dir")
    .ValidateAsync("testme.html");

HtmlValidateOptions Properties

  • HtmlValidateFormatter Formatter { get; set; }
    Gets or sets the formatter.
  • int? MaxWarnings { get; set; }
    Gets or sets the maximum allowed warnings count. The default value is null, which means that warnings are allowed. Use 0 to disallow warnings.
  • string Config { get; set; }
    Gets or sets the configuration file path (full or relative to CLI WorkingDirectory).
  • string[] Extensions { get; set; }
    Gets or sets the file extensions to use when searching for files in directories. For example: "html", "vue", etc.

HtmlValidateResult Properties

  • bool IsSuccessful { get; }
    Gets a value indicating whether this result is successful.
  • string Output { get; }
    Gets the text output of result.

Feedback

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.

Thanks

The library is implemented thanks to the sponsorship of Lombiq Technologies.

SemVer

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.

License

Atata is an open source software, licensed under the Apache License 2.0. See LICENSE for details.

atata-cli-htmlvalidate's People

Contributors

yevgeniyshunevych avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.