glemtext
Types
A Document
is a list of Gemtext elements. As Gemtext “elements”
are not nested, there is no need for a nested structure here, either.
As such, Document
is a type alias to List(GemElement)
pub type Document =
List(GemElement)
GemElement
is an element, or possible line type for Gemtext.
pub type GemElement {
Text(String)
Link(to: String, label: Option(String))
Heading(level: Int, text: String)
ListItem(String)
Blockquote(String)
Preformatted(alt: Option(String), text: String)
}
Constructors
-
Text(String)
Text
is any text that doesn’t have specific syntax for creating an element. Note that empty lines areText("")
-
Link(to: String, label: Option(String))
A link to another document, both Gemini and non-Gemini, and optionally, a label.
-
Heading(level: Int, text: String)
-
ListItem(String)
-
Blockquote(String)
-
Preformatted(alt: Option(String), text: String)