avdgaag / gleam_ag_html

A Gleam library for building HTML strings usings functions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML

Package Version Hex Docs

Generate HTML using functions, much like elm-html.

Quick start

import html.{html, head, body, p, text, render_document}
import html/attributes.{class}

pub fn hello_world() -> String {
  html([
    head([], []),
    body([
      p([text("Hello, world!")], [class("big")])
    ], [])
  ], [])
  |> render_document()
}
/// will return:
///
///   "<!doctype html><html><head></head><body><p class=\"big\">Hello, world!</p></body></html>"

Installation

If available on Hex this package can be added to your Gleam project:

gleam add html

and its documentation can be found at https://hexdocs.pm/ag_html.

About

A Gleam library for building HTML strings usings functions.


Languages

Language:Gleam 100.0%