A lean XML builder for Gleam
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Gleam 100.0%
7 1 0

Clone this repository

https://tangled.org/keii.dev/xmleam https://tangled.org/did:plc:ooawnspa3j4o7cinoryhglqv/xmleam
git@tangled.org:keii.dev/xmleam git@tangled.org:did:plc:ooawnspa3j4o7cinoryhglqv/xmleam

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

xmleam#

Package Version Hex Docs

gleam add xmleam
import gleam/io
import gleam/result.{unwrap}
import xmleam/builder.{Opt, basic_tag, opts_tag}

pub fn main() {
  let document = {
    builder.xml("1.0", "UTF-8", [
      unwrap(basic_tag("Hello", ["World"]), "ENCODING ERROR"),
      unwrap(
        opts_tag("link", [Opt("href", "https://example.com")]),
        "ENCODING ERROR",
      ),
    ])
  }
  io.print(result.unwrap(document, "ENCODING Error"))
}

//Result
<?xml version="1.0" encoding="UTF-8"?> 
<Hello> World </Hello> 
<link href="https://example.com" />

Further documentation can be found at https://hexdocs.pm/xmleam.

Development#

gleam run   # Run the project
gleam test  # Run the tests