glemini/gemtext

A helper module for generating gemtext.

Example:

[
  heading1("Welcome to Glemini!"),
  text("This is a simple gemini server library"),
  link_with_caption("gemini://geminiprotocol.net", "Gemini Website"),
]
|> lines_to_string

Results in:

# Welcome to Glemini!
This is a simple gemini server library
=> gemini://geminiprotocol.net Gemini Website

Types

Type representing gemtext lines.

pub opaque type Line

Type alias for a list of gemtext lines.

pub type Lines =
  List(Line)

Functions

pub fn blank_line() -> Line
pub fn heading1(text: String) -> Line
pub fn heading2(text: String) -> Line
pub fn heading3(text: String) -> Line
pub fn line_to_string(line: Line) -> String

Convert a gemtext line into a string.

pub fn lines_to_string(lines: List(Line)) -> String

Convert a list of gemtext lines into a string.

pub fn link(uri: String) -> Line
pub fn link_with_caption(uri: String, text: String) -> Line
pub fn list_item(text: String) -> Line
pub fn preformatted(text: String) -> Line
pub fn preformatted_with_caption(
  text: String,
  caption: String,
) -> Line
pub fn qoute(text: String) -> Line
pub fn text(text: String) -> Line
Search Document