Sign in

Leandro Pereira

@leandrocp.bsky.social
188 followers 163 following 77 posts

Realtime @supabase.com Building mdelixir.dev (Markdown for Elixir) and lumis.sh (Syntax Highlighter)

PostsRepliesMedia
Leandro Pereira @leandrocp.bsky.social · 02/10/2026
Hey @verdettoqr.com the individual packages came first and bundles were created based on shiki.style/guide/bundles Lumis is more impacted by parser size than any other TextMate Grammar based lib and that's probably the biggest tradeoff but it's also allowing more features since it's a real parser.
010
Leandro Pereira @leandrocp.bsky.social · 25/09/2026
Lumis now lets you choose which languages to load in your package. Need only Elixir and Rust? That's only 2mb vs ~130mb of the full bundle. Just add: {:lumis_wasm_elixir, "~> 0.26"} That also applies to MDEx and MDEx Native. See mdex.hexdocs.pm/lumis.html#p... docs.lumis.sh
mdex.hexdocs.pm
Lumis syntax highlighting — MDEx v0.14.0
1121
Leandro Pereira @leandrocp.bsky.social · 03/08/2026
MDEx 1M downloads 🎉 Just... thanks everyone that made it possible! #MyElixirStatus
1200
Leandro Pereira @leandrocp.bsky.social · 03/08/2026
Welcome @pragtob.bsky.social it's very exciting to have you on the team!
110
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
Yeah to have zero deps probably textmate makes more sense, a good exercise. Fun fact, Lumis started as a Elixir package :)
020
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
Compile to C code. Security is a long discussion but you can pick which one you trust (Lumis don't enforce all) and a lot of parsers are maintained either by tree-sitter or language core itself, and if you run neovim, zed, helix, etc you're already running that code anyway, but reasonable concern :)
120
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
But i'd say the least resistance path is using a lib because maintaining everything up to date is time consuming, especially to map all details correctly, that's the annoying part.
120
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
If you don't want to depend on a lib and needs to highlight one or two langs then choose whatever has more updated parsers and themes to have better results (no missing/wrong colors or tokens etc). I don't think the amount of work would change drastically from let's say textmater vs tree-sitter.
120
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
Most likely you'd need to work on a lower level calling tree-sitter directly, parsing, querying, and transforming which is not the focus of Lumis, even tho it's running tree-sitter under the hood.
030
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
For Lumis tree-sitter parsers can be both a solution and a problem lol Some are well written, relatively small, and fast. Others not so much. Queries also need some work sometimes. But it's improving with more adoption, for example github.com/zed-industri...
github.com
Start using and suggesting standardized Tree-sitter highlights captures · zed-industries zed · Discussion #23371
Check for existing issues Completed Describe the feature Zed currently uses non-standard captures in its builtin extensions/languages and themes, which has led to community language and theme exten...
130
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
Almost impossible without automation to build, test, update and validate stuff etc which is more easily achieved with llms, or with a large contribution network which is not the reality for new projects.
020
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
Lumis is still pre v1.0 but already used by some projects in production and evolving fast. Contributions are welcome!
010
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
And much more ↓ See lumis.sh/docs - Nested parsing - Built-in integration with React, Nuxt, Astro, VitePress, Ratatui, and more - Formatters: HTML, Terminal, Dual Light/Dark, BBCode, and custom to build your own - Auto detect languages based on extension or content
110
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
- Languages also released as WASM Fully automated build and validation. Published without modifications, can be used by web-tree-sitter and other runtimes. www.npmjs.com/search?q=key...
110
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
- Collection of Neovim themes in .json and .css files Extracted from Neovim themes. You can use only the theme files if you want: github.com/leandrocp/lu...
110
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
- Same API for all runtimes lumis.sh#quickstart Pick a theme, formatter, and a language.
130
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
Repo: github.com/leandrocp/lu... Some highlights ↓
github.com
GitHub - leandrocp/lumis: Syntax Highlighter powered by Tree-sitter and Neovim themes.
Syntax Highlighter powered by Tree-sitter and Neovim themes. - leandrocp/lumis
120
Leandro Pereira @leandrocp.bsky.social · 13/07/2026
Announcing Lumis: Syntax Highlighter powered by Tree-sitter and Neovim themes. 110+ languages 250+ themes Unified API: CLI, Web, JavaScript, Rust, Elixir, Java. lumis.sh ↓
4535
Leandro Pereira @leandrocp.bsky.social · 07/07/2026
I'm still in denial waiting for the next "Hello and welcome to the Thinking Elixir podcast". I'm honored to have MDEx and more highlighted so many times including in the final episode :) Thank you so much for all episodes brainlid.bsky.social and david.bernheisel.com !
1110
Reposted by Leandro Pereira
Tyler A. Young ⚗️🧑🏻‍💻 @tylerayoung.com · 29/06/2026
OMG, latest version of Hex (`mix local.hex --force`) prints out CVEs that affect your packages any time you run `mix deps.get` 🤩 #ElixirLang
mix deps.get output, showing Earmark 1.4.48 marked as "RETIRED!" and "VULNERABLE!" due to CVE-2026-48591, "Stored XSS via unescaped HTML attribute values in earmark"
05111
Leandro Pereira @leandrocp.bsky.social · 18/06/2026
It's no longer maintained, see the warning on hex.pm/packages/ear... and also when installing it. Both earmark and earmark_parser are no longer receiving active commits since June 2025.
110
Leandro Pereira @leandrocp.bsky.social · 18/06/2026
Earmark has been retired. First, I want to highlight the impressive work of everyone maintaining it for so many years, really valuable work! MDEx has a migration guide if you choose it mdex.hexdocs.pm/earmark_to_m... and contributions are welcome. #MyElixirStatus
mdex.hexdocs.pm
Earmark to MDEx Migration — MDEx v0.13.0
1194
Leandro Pereira @leandrocp.bsky.social · 17/06/2026
Announcing mdex_native All the Rust code extracted from mdex into this new library. A shortcut to: - Markdown via Comrak with syntax highlighting via Lumis or Syntect - Sanitization via Ammonia Used my mdex and nimble_publisher. Guides and examples at github.com/leandrocp/md... #MyElixirStatus
github.com
GitHub - leandrocp/mdex_native: Native foundation for MDEx: Comrak, Ammonia, and Lumis.
Native foundation for MDEx: Comrak, Ammonia, and Lumis. - leandrocp/mdex_native
0131
Leandro Pereira @leandrocp.bsky.social · 16/06/2026
The hexpm package pages are now generated by MDEx and Lumis, thanks to @maennchen.dev ! - Better GitHub Flavored Markdown - Light/Dark themes - Syntax highlighting for more languages and sigils - HEEx, Python, Lua, Svelte, React, etc And more... #MyElixirStatus
0254
Leandro Pereira @leandrocp.bsky.social · 09/06/2026
- Fixes html streaming across flushes - Doesn't depend on rustler anymore. Code moved to github.com/leandrocp/md... which means you can call Comrak directly now :) - Syntect is now supported as alternative to Lumis See mdex.hexdocs.pm/syntax_highl... for examples. #MyElixirStatus
github.com
GitHub - leandrocp/mdex_native: Native foundation for MDEx: Comrak, Ammonia, and Lumis.
Native foundation for MDEx: Comrak, Ammonia, and Lumis. - leandrocp/mdex_native
030
Leandro Pereira @leandrocp.bsky.social · 09/06/2026
Heads-up to anyone using MDEx! Version 0.13 is out with a breaking change: syntax highlighting is now disabled by default. If you don't use it, you're good and got smaller deps size. If you do please check the short migration guide at github.com/leandrocp/md... Now the news ⬇️ #MyElixirStatus
github.com
151
Leandro Pereira @leandrocp.bsky.social · 13/04/2026
Today is my first day at @supabase.com I'm thrilled to be joining the Realtime team with very talented people. Supabase's vision and strong belief in Open Source and Developer Experience make them unique. Exciting times ahead, let's go. #MyElixirStatus
2210
Leandro Pereira @leandrocp.bsky.social · 29/03/2026
MDEx v0.12 is out with a new `:sourcepos` field exposing the starting and ending positions (line:column) of all nodes in the tree. github.com/leandrocp/md... #MyElixirStatus
170
Leandro Pereira @leandrocp.bsky.social · 26/03/2026
What you get with a single command: - GitHub and GitLab Flavored Markdown - Syntax Highlighting with light/dark themes (a lot of languages and themes) - HEEx components And much more...
010
Leandro Pereira @leandrocp.bsky.social · 26/03/2026
I just published a small adapter for NimblePublisher to get a site or blog up and running quickly with MDEx and Lumis. Check it out! github.com/leandrocp/ni... #MyElixirStatus
1172
Leandro Pereira @leandrocp.bsky.social · 16/03/2026
Proud to be doing my part contributing to the @elixir-lang.org ecosystem. My libs and contributions just crossed 1 million downloads! Working to hit the next milestone. #MyElixirStatus
2202
Leandro Pereira @leandrocp.bsky.social · 10/03/2026
MDEx v0.11.6 was pretty much a contribution-only release and the community is growing! The syntax highlighter is managed by lumis.sh - a mix of tree-sitter and neovim themes for those curious about it. Thanks for the coverage! #MyElixirStatus
lumis.sh
Lumis - Syntax Highlighter Powered by Tree-sitter and Neovim Themes
Lumis is a syntax highlighter powered by Tree-sitter and Neovim themes. Available for Rust and Elixir.
040
Leandro Pereira @leandrocp.bsky.social · 25/02/2026
Also some fixes in the syntax highlighter and the streaming parser to recognize more patterns and make it more reliable. Fixes by Andrew Stewart and Neil Berkman.
000
Leandro Pereira @leandrocp.bsky.social · 25/02/2026
Added a new option `:codefence_renderers` by Neil Berkman to customize codefences (those blocks afer ```) which enables a whole new world for plugins! Check it out -> hexdocs.pm/mdex/codefen...
hexdocs.pm
Codefence Renderers — MDEx v0.11.6
120
Leandro Pereira @leandrocp.bsky.social · 25/02/2026
MDEx v0.11.6 is out! github.com/leandrocp/md... Added a new `:codefence_renderers` option and also some important fixes. #MyElixirStatus
github.com
Release v0.11.6 · leandrocp/mdex
0.11.6 - 2026-02-24 Added [Option] Add :codefence_renderers to customize code fence rendering (@neilberkman) Fixed [Syntax Highlighter] Do not wrap plaintext code in <span> tags (@stewart) [Str...
1123
Leandro Pereira @leandrocp.bsky.social · 19/01/2026
MDEx v0.11.1 is out 🔥 - Sigil docs fix by Ievgen Pyrogov - Optional rustler dep by @halostatue.ca - Accept :plugins opt by Sonny Scroggin - HEEx guide hexdocs.pm/mdex/heex.html - New to_heex/2 function And more: github.com/leandrocp/md... Thanks to all contributors! #MyElixirStatus
github.com
Release v0.11.1 · leandrocp/mdex
0.11.1 - 2026-01-19 Changed Add use MDEx macro to set up MDEx in a module (optional) [HEEx] Add to_heex/2 and to_heex!/2 macros to convert Markdown, MDEx.Document, or HTML to HEEx with Phoenix com...
0101
Leandro Pereira @leandrocp.bsky.social · 12/01/2026
I'm introducing a Sponsors section (github.com/leandrocp/md...) so if you or your company has been using MDEx, please consider sponsoring the project to help me ship new features, that would be MUCH appreciated 😀
github.com
GitHub - leandrocp/mdex: Fast and Extensible Markdown for Elixir. Compliant with CommonMark spec. Formats to HTML, JSON, and XML. Built on top of comrak, ammonia, and autumnus.
Fast and Extensible Markdown for Elixir. Compliant with CommonMark spec. Formats to HTML, JSON, and XML. Built on top of comrak, ammonia, and autumnus. - leandrocp/mdex
020
Leandro Pereira @leandrocp.bsky.social · 12/01/2026
2) Syntax Highlighter with Light/Dark themes hexdocs.pm/mdex/light_d...
120
Leandro Pereira @leandrocp.bsky.social · 12/01/2026
) Initial support for Phoenix Components Yep, LiveView and Markdown working together. hexdocs.pm/mdex/phoenix...
130
Leandro Pereira @leandrocp.bsky.social · 12/01/2026
MDEx v0.11 is out celebrating 500k downloads with a new website mdelixir.dev - thanks y'all for the support! Some exciting new features in this version. See below 👀 #MyElixirStatus
mdelixir.dev
MDEx - Fast Markdown for Elixir
Fast and Extensible Markdown for Elixir with native Phoenix LiveView HEEx integration.
1120
Leandro Pereira @leandrocp.bsky.social · 07/01/2026
Spread the word! Btw working on that feature to release in the next few days 👀
030
Leandro Pereira @leandrocp.bsky.social · 27/11/2025
Hey Brian, attribution was present until v0.6.x (May/June I believe). I only removed it because I wasn't sure about using DockYard trademarks, but I'd gladly add it back again with your approval.
020
Leandro Pereira @leandrocp.bsky.social · 26/11/2025
Soon in MDEx ➡️ Phoenix Components! Yes, MDEx will support embedding HEEx templates inside Markdown. Components and Elixir empressions. hex.pm/packages/mdex #MyElixirStatus
3285
Leandro Pereira @leandrocp.bsky.social · 04/10/2025
I'm glad it's useful. Enjoy!
010
Leandro Pereira @leandrocp.bsky.social · 04/10/2025
All the MDEx.Document handling is done in Elixir including buffering and completing markdown chunks (using nimble_parsec). On the Rust side it "only" does parsing and rendering via crates.io/crates/comrak (an amazing project btw).
crates.io
crates.io: Rust Package Registry
010
Leandro Pereira @leandrocp.bsky.social · 04/10/2025
Exactly, it's not event based. MDEx doesn't care how or how often you push chunks into the Document. So you can keep a Document in a LiveView and keep pushing into it and render when needed. There's an example here github.com/leandrocp/md...
github.com
mdex/examples/streaming.exs at main · leandrocp/mdex
Fast and Extensible Markdown for Elixir. Compliant with CommonMark spec. Formats to HTML, JSON, and XML. Built on top of comrak, ammonia, and autumnus. - leandrocp/mdex
030
Leandro Pereira @leandrocp.bsky.social · 04/10/2025
It can afford to re-render as many times as needed because it's very efficient, although I'm expecting to gather some feedback and adjust if needed. One of the reasons this is considered experimental yet.
110
Leandro Pereira @leandrocp.bsky.social · 04/10/2025
This approach is similar to streamdown.ai but using nimble_parsec. A more optimized approach would require rewriting the parser from scratch like github.com/thetarnav/st... is doing but that's not on my plans.
streamdown.ai
Streamdown
A drop-in replacement for react-markdown, designed for AI-powered streaming.
120
Leandro Pereira @leandrocp.bsky.social · 04/10/2025
Fragments are buffered until a render or parser is requested (when `MDEx.to_html` or `Document.run` or others are called). At this moment the buffer tail is completed if needed (**text -> **text**) then appended to the rest of the document and re-rendered (that's where Rustler is called). 1/n
110
Leandro Pereira @leandrocp.bsky.social · 04/10/2025
And more detailed in the CHANGELOG at hexdocs.pm/mdex/changel...
hexdocs.pm
Changelog — MDEx v0.9.3
020