gbr/md

Ⓜ️ Markdown to lustre elements

Types

Markdown type

  • metadata: Metadata from markdown, if exists.
  • body: Rest of markdown.
pub type Markdown {
  Markdown(
    metadata: option.Option(List(#(String, String))),
    body: String,
  )
}

Constructors

  • Markdown(
      metadata: option.Option(List(#(String, String))),
      body: String,
    )

Metadata type to markdown

  • Json
  • Yaml
  • Frontmatter
pub type Metadata {
  Json
  Yaml
  Frontmatter
}

Constructors

  • Json
  • Yaml
  • Frontmatter

Values

pub fn metadata(
  in: Markdown,
  parser: Metadata,
) -> Result(Markdown, String)

Parse metadata from markdown new type. The body of markdown should has all content.

  • in: Markdown type with all content in body.
  • parser: Option parsert to metadata.
pub fn new(markdown: String) -> Markdown

Create new markdown type

  • markdown: Markdown content.
pub fn view(in: Markdown) -> element.Element(a)

Convert markdown content into view with lustre element.

  • in: Markdown type
Search Document