jot
Types
pub type Container {
ThematicBreak
Paragraph(attributes: Dict(String, String), List(Inline))
Heading(
attributes: Dict(String, String),
level: Int,
content: List(Inline),
)
Codeblock(
attributes: Dict(String, String),
language: Option(String),
content: String,
)
}
Constructors
-
ThematicBreak -
Paragraph(attributes: Dict(String, String), List(Inline)) -
Heading( attributes: Dict(String, String), level: Int, content: List(Inline), ) -
Codeblock( attributes: Dict(String, String), language: Option(String), content: String, )
pub type Destination {
Reference(String)
Url(String)
}
Constructors
-
Reference(String) -
Url(String)
pub type Document {
Document(
content: List(Container),
references: Dict(String, String),
footnotes: Dict(String, List(Container)),
)
}
Constructors
-
Document( content: List(Container), references: Dict(String, String), footnotes: Dict(String, List(Container)), )
pub type Inline {
Linebreak
Text(String)
Link(content: List(Inline), destination: Destination)
Image(content: List(Inline), destination: Destination)
Emphasis(content: List(Inline))
Strong(content: List(Inline))
Footnote(reference: String)
Code(content: String)
}
Constructors
-
Linebreak -
Text(String) -
Link(content: List(Inline), destination: Destination) -
Image(content: List(Inline), destination: Destination) -
Emphasis(content: List(Inline)) -
Strong(content: List(Inline)) -
Footnote(reference: String) -
Code(content: String)
Functions
pub fn document_to_html(document: Document) -> String
Convert a document tree into a string of HTML.
pub fn parse(djot: String) -> Document
Convert a string of Djot into a tree of records.
This may be useful when you want more control over the HTML to be converted to, or you wish to convert Djot to some other format.