View Source Kino.Markdown (Kino v0.12.3)

A kino for rendering Markdown content.

This is just a meta-struct that implements the Kino.Render protocol, so that it gets rendered as markdown.

examples

Examples

Kino.Markdown.new("""
# Example

A regular Markdown file.

## Code

```elixir
"Elixir" |> String.graphemes() |> Enum.frequencies()
```

## Table

| ID | Name   | Website                 |
| -- | ------ | ----------------------- |
| 1  | Elixir | https://elixir-lang.org |
| 2  | Erlang | https://www.erlang.org  |
""")

This format may come in handy when exploring Markdown from external sources:

text = File.read!("/path/to/README.md")
Kino.Markdown.new(text)

Link to this section Summary

Functions

Creates a new kino displaying the given Markdown content.

Link to this section Types

@opaque t()

Link to this section Functions

@spec new(
  binary(),
  keyword()
) :: t()

Creates a new kino displaying the given Markdown content.

options

Options

  • :chunk - whether this is a part of a larger text. Adjacent chunks are merged into a single text. This is useful for streaming content. Defaults to false