Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 19 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 (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-26T15:40:58.000Z (about 2 years ago)
- Last Synced: 2024-09-16T17:23:48.857Z (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
[![Package Version](https://img.shields.io/hexpm/v/html)](https://hex.pm/packages/ag_html)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](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 .