module A generalized data format to represent human readable contents. Though it is not meant to represent HTML nodes.
- data Bold
- data Code
- data CodeBlock
- data Format
- enum FormatWitness
- data Heading
- data Image
- data Italic
- data Link
- enum Markup
- data OrderedList
- data Paragraph
- data UnorderedList
- func b
- func code
- func convert markup, targetFormatWitness
- func from witness
- func group list
- func h1
- func h2
- func h3
- func h4
- func h5
- func h6
- func i
- func img
- func inline list
- func li item
- func link
- func ol child
- func p child
- func pre
- func ref child, name
- func text str
- func ul child
data A bold portion of inline text.
Bold "text"
child
- At least one child of type Markup.
data Some preformatted inline code.
Code text
text
- Some text. Markup not supported.
data A block of preformatted multiline code.
CodeBlock "lithia", "text"
language
- Maybe the language as string. Implementations must support Some, None and String.text
- The text itself as String.
data A specific markup format to convert to.
convert markup
- Converts given markup to this format.
enum A more generalized form of a markup.Format. Allows to use plain functions and whole modules as format.
data A heading of a specific nesting level.
level
- The level of nesting. An Int, typically in the range of one to six.child
- At least one child of type Markup.
data An embedded image.
url
- The url of the image. Markup not supported.alt
- Alternatively displayed text in case the image can't be loaded or for accessibility. Markup not supported.
data An italic portion of inline text.
Italic "text"
child
- At least one child of type Markup.
data A link to a resource.
child
- At least one child of type Markup. Used to display the link.url
- The url to point to. Markup not supported.
enum A recursive enum of markup nodes.
data An ordered list. Requires a list of children.
OrderedList [
- item
- another
]
children
- A list of Markup children.
data A paragraph with some blank lines around.
Paragraph [ "First", "Second" ]
child
- At least one child of type Markup.
data An unordered list. Requires a list of children.
UnorderedList [
- item
- another
]
children
- A list of Markup children.
func b
bold text
func code
A Code block.
func convert markup, targetFormatWitness
Converts some markup to a target format.
func from witness
Creates a Format from a given FormatWitness.
func group list
A list of markup for better readbility.
func h1
func h2
func h3
func h4
func h5
func h6
func i
italic text
func img
An image with url and alt.
func inline list
Some inline text. Ignores empty elements. Adds spaces.
func li item
A list item for better readability.
func link
A link with title and url.
func ol child
An ordered list. Ignores empty lines.
func p child
A paragraph. Ignores empty lines.
func pre
Preformatted inline code.
func ref child, name
An internal ref to a heading.
func text str
Constant text for better readbility.
func ul child
An unordered list. Ignores empty lines.