Silk

TestsSilk version

Silk is a lightweight Elixir DSL for generating HTML in a clean, expressive, and composable way - using just Elixir syntax.

Features

Silk is a great fit for:

Installation

def deps do
  [
    {:silk_html, "~> 0.1.0"}
  ]
end

Usage

Start by importing the Silk module and using the tag macro:

import Silk

tag :section, class: "content" do
  tag :h1, do: "Welcome"
end

Dynamic content? No problem:

import Silk

tag :ul do
  Enum.map ["one", "two", "three"], fn item ->
    tag :li, do: item
  end
end

Void tags like img, br, or input:

tag :img, src: "/logo.png", alt: "Logo"
````

# License

Silk is released under GPL-3.0 - See the [LICENCE](LICENSE).