https://github.com/avdgaag/gleam_ag_html
A Gleam library for building HTML strings usings functions.
https://github.com/avdgaag/gleam_ag_html
Last synced: 18 days ago
JSON representation
A Gleam library for building HTML strings usings functions.
- Host: GitHub
- URL: https://github.com/avdgaag/gleam_ag_html
- Owner: avdgaag
- Created: 2022-11-26T15:34:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-26T15:40:58.000Z (over 2 years ago)
- Last Synced: 2025-03-29T14:41:43.005Z (3 months ago)
- Language: Gleam
- Size: 5.86 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HTML
[](https://hex.pm/packages/ag_html)
[](https://hexdocs.pm/ag_html/)Generate HTML using functions, much like [elm-html](https://package.elm-lang.org/packages/elm/html/1.0.0/).
## Quick start
```gleam
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:
///
/// "Hello, world!
"
```## Installation
If available on Hex this package can be added to your Gleam project:
```sh
gleam add html
```and its documentation can be found at .