Skip to content

Latest commit

 

History

History

examples

Examples

Currently all examples depend on unrelead code present only in the main branch, to execute it will need Rust installed to compile the dependencies.

Liquid

Render Liquid Tags

elixir liquid.exs && open liquid.html

Mermaid

Render Mermaid Diagrams

elixir mermaid.exs && open mermaid.html

Alerts

Render GitHub Alerts

elixir alerts.exs && open alerts.html

Highlight

Render == as <mark> tags as described at https://www.markdownguide.org/extended-syntax/#highlight

elixir highlight.exs && open highlight.html

HEEx

Render Markdown with HEEx syntax and Phoenix Components

elixir heex.exs && open heex.html

LiveView

Convert markdown to a LiveView HEEx template supporting Phoenix components.

Inspired by https://twitter.com/pepicrft/status/1714694213642637538

iex live_view.exs

To replicate this example in a real application, copy the MDEx.LiveView module into your application, then import it in your LiveView or in your application Web module (see DemoLive in the example).

Note that you can change the options passed to MDEx.to_html!/2 in the sigil_M macro.

NimblePublisher + LiveView

Build your blog posts using the NimblePublisher library and serve them with LiveView.

iex nimble_publisher.exs

Open localhost:4000 to view the rendered blog post.