Testing pele as a replacement for mermaid

we’ve swapped the mermaid theme component for pele here on meta, for testing purposes :test_tube:

what’s this about?

mermaid is two things:

  1. a syntax for describing diagrams with plain text (flowcharts, sequences, timelines…)
  2. a library that turns that text into an SVG in your browser

pele replaces #2. it reads the same syntax[1] but has its own engine and its own look :gear:

how does it work?

you write a ```mermaid code block in a post (or chat message). when that post is displayed, the theme component spots the block and has pele draw the diagram in place.

pele is only downloaded on pages that actually have a diagram, so it doesn’t slow down anything else.

why bother?

the mermaid library is big and “slow”. pele is 6x smaller, up to 500x faster, has no dependencies, theme-able with css variables, MIT licensed, and developed by obsidian’s team.

in practice: diagrams appear faster, and they match your site’s colors (light/dark included) without any extra work.


same ```mermaid syntax, so nothing to change in your posts.

here’s the theme component if you want to give it a try on your own site.

:warning: remove the mermaid component first, both can’t run side by side.

flowchart LR
  A[mermaid] -->|swap| B[pele]
  B --> C{looks good?}
  C -->|yes| D[🎉]
  C -->|no| E[reply here]

if you spot any visual bug, please :folded_hands: reply here with

  • a link to the post (or the diagram source)
  • a screenshot
  • your browser and theme (light/dark)

thanks :wink:


  1. up to mermaid 12.1.0, all diagram types ↩︎

29 לייקים

Instructions unclear; no :tada: reaction available :pensive_face:

Looks good!

9 לייקים

Last week I found out about Pele, I thought about trying some internal integration, and today I came across this. Super fast and from the Core, thanks!

2 לייקים

Pele is already integrated in so many platform.. for good reasons!

i’m using it in Obsidian and tested now my Discourse community.. very good

3 לייקים

Do I understand correctly… with pele we could set pele elements to respect our community/brand such that all pre-existing mermaid charts (or maybe just new ones) would have a default look and feel of our style?

yes :+1:

the component already maps pele’s css variables to your site’s color palette, so all diagrams, old and new, automagically pick up your colors (light/dark included)

if you want to tweak further, override any --pele-* variable on .pele-diagram in your theme’s css :wink:

4 לייקים