Itay2805 / DotNet2HTML

C# (.Net) to HTML generator. Enjoy typesafe HTML generation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DotNet2HTML

C# (.Net) to HTML generator. Enjoy typesafe HTML generation.

This project is heavily inspired by j2html.

Getting started

Downlaod from Nuget

Package Manager

PM> Install-Package DotNet2HTML -Version 1.0.1

.NET CLI

> dotnet add package DotNet2HTML --version 1.0.1

Import the TagCreator and start building HTML

using DotNet2HTML.Tags;
using static DotNet2HTML.TagCreator;

namespace Program {  
  class Program {
    public static void Main(string[] args) {
      Body(
        H1("Hello, World!"),
        Img().WithSrc("/img/hello.png")
      ).Render();
    }    
  }
}

The above C# will result in the following HTML:

<body>
    <h1>Hello, World!</h1>
    <img src="/img/hello.png">
</body>

About

C# (.Net) to HTML generator. Enjoy typesafe HTML generation.

License:Apache License 2.0


Languages

Language:C# 100.0%