Leandro Pereira
@leandrocp.bsky.social
110 followers 120 following 35 posts
Elixir, Rust, Open Source. https://leandro.io https://mdelixir.dev https://autumnus.dev
Posts Media Videos Starter Packs
Pinned
leandrocp.bsky.social
New MDEx (Markdown for Elixir) version is 🔥

👇
leandrocp.bsky.social
I'm glad it's useful. Enjoy!
leandrocp.bsky.social
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: Rust Package Registry
crates.io
leandrocp.bsky.social
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...
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
github.com
leandrocp.bsky.social
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.
leandrocp.bsky.social
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
A drop-in replacement for react-markdown, designed for AI-powered streaming.
streamdown.ai
leandrocp.bsky.social
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
leandrocp.bsky.social
4. `MDEx.Pipe` is gone. Now all operations are centralized into `MDEx.Document`. Yes that's a **breaking** change but it's worth it.

Pipelines are as simple as adding steps into the document:
leandrocp.bsky.social
3. The Document struct is now displayed in a tree format for better visualization with each node indexed:
leandrocp.bsky.social
Here's a short demo of Markdown streaming in MDEx 👀

Note it's still experimental and disabled by default.
leandrocp.bsky.social
2. Streaming! Now it does complete and render incomplete chunks of Markdown for you:

hexdocs.pm/mdex/MDEx.Do...
leandrocp.bsky.social
New MDEx (Markdown for Elixir) version is 🔥

👇
Reposted by Leandro Pereira
hauleth.dev
Hi Bsky hivemind, is anyone looking for seasoned #ElixirLang developer? EMEA-based, fully remote.

Either consulting or full-time.
Reposted by Leandro Pereira
sriramskota.bsky.social
Hello friends, I am back on the job market and looking for Elixir opportunities..if your company is hiring or you come accross opportunities please DM me.

Retweets appreciated 🙏

#elixirlang #elixir
leandrocp.bsky.social
Hey @thinkingelixir.com thanks for covering MDEx updates (again)!

Here's the updated link to code block decorators guide hexdocs.pm/mdex/code_bl... - and there's more coming soon!
leandrocp.bsky.social
The difference between `Keyword.get(opts, :foo, :default)` and `opts[:foo] || :default` when opts[:foo] is nil. Not a big deal but easy to miss.
Reposted by Leandro Pereira
jola.dev
Forgot to post here so... Hello network! It's time for me to move on and I'm kicking off the search for my next role. Let me know if you're looking for someone who obsessively ships, takes on whatever work has the highest impact, and consistently gets feedback like "you're too impatient".
leandrocp.bsky.social
Example highlighting some lines. It does use the `CursorLine` highlight group (the current line in Neovim) to style the line but you can change both class/style(1) to fine-tune it for your needs.

(1) Depends on the formatter.
leandrocp.bsky.social
Example overwriting the theme. Use one of the themes available from autumnus.dev
leandrocp.bsky.social
MDEx v0.8 is out with support for Code Block Decorators. You can annotate any code block to change theme, highlight lines, and more 👇

Change theme:

```elixir theme=name

Highlight lines:

```elixir highlight_lines=1,5-8,10

More at hexdocs.pm/mdex/0.8.0/M...

#MyElixirStatus
MDEx — MDEx v0.8.0
hexdocs.pm
leandrocp.bsky.social
But I'd say to avoid it if you can :)