Search results

There are no results.

wobsite.markdown.Admonitions

class pub Admonitions

A filter that adds support for admonitions (notes, warnings, etc).

Admonitions use the custom block syntax of inko-markdown. For example, to create a note you'de use the following syntax:

::: note
The body goes here.
:::

The following admonition types are supported:

  • discuss
  • info
  • note
  • tip
  • warn

Fields

types

let pub @types: Set[String]

The admonition classes that are supported.

class

let pub @class: String

The base class to apply to the container.

icon_element

let pub @icon_element: String

The element name to use for the icon.

icon_class

let pub @icon_class: String

The class to apply to the icon element.

text_class

let pub @text_class: String

The name of the class to apply to the text div.

Static methods

new

Show source code
Hide source code
fn pub static new -> Admonitions {
  let types = Set.new

  types.insert('info')
  types.insert('tip')
  types.insert('note')
  types.insert('warn')
  types.insert('discuss')

  Admonitions(
    types: types,
    class: 'admonition',
    icon_element: 'i',
    icon_class: 'icon',
    text_class: 'text',
  )
}
fn pub static new -> Admonitions

Instance methods

run

Show source code
Hide source code
fn pub mut run(document: mut html.Document) {
  document.nodes.iter_mut.each(fn (node) { replace(node) })
}
fn pub mut run(document: mut Document)

Transforms the HTML document.

How or what exactly this method does is up to the type that implements this trait. Examples include adding IDs to headings, generating a table of contents, or replacing one element with another.

Implemented traits

markdown.html.

Filter

impl Filter for Admonitions