Skip to content

guneysus/hg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HG: DSL for Html Generation

Example

HG, abuses operator overloads in C# to implement DSL (Domain Specific Language) for HTML generation.

It is very early stage.

It does not support:

  • Self closing tags
  • Attributes

yet.

It has no nuget package (yet).

Just a fun project that might give some ideas how to ab(use) .NET's features.

Usage

using static Hg.HgExtensions;

var cursor = ul > 
  li / "Item #1"
  + li / "Item #2"
  + li / "Item #3";

var html = cursor.Html();


// <ul><li>Item #1</li><li>Item #2</li><li>Item #3</li></ul>

About

HG: DSL for Html Generation

Topics

Resources

License

Stars

Watchers

Forks

Languages