cvkmohan
Recently came across this great library leandrocp/mdex: A fast 100% CommonMark-compatible GitHub Flavored Markdown parser and formatter for Elixir. by our @leandrocp
I wanted to discuss about the library and realized there is no forum post introducing the library.
So, creating this thread. In the Phoenix LiveView, I just called Mdx.to_html() and voila - live preview is available.
Please explore.
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
I’m posting this in response to Jose’s recent tweet (Cr. link) :
People are sleeping on Elixir for a coding harness:
Hot-code swappi...
New
Hello,
I wrote Stop My Hand, a Scattergories-like web application using Phoenix/LiveView as my learning project for Elixir (after readin...
New
It would be helpful to have a list of companies worldwide that hire engineers without prior experience in Elixir. Often, it can be quite ...
New
Anyone running long-lived stateful processes on BEAM? We’re building an AI agent runtime and would love to compare notes.
We’re a small ...
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
cvkmohan
@leandrocp - embedding
A sigil never crossed my mind, but that’s easy to implement and a PR is very welcome!” / X (twitter.com)
heex componentsis in the pipeline? Leandro Pereira on X: “@pepicrft @elixirphoenix @chris_mccord Working on embedding components https://t.co/kthGZ7p1ujmayel
Use it and love it
leandrocp
The reason I’m not talking much about that library yet is because I’m still working on the API to manipulate AST and consequently allow extending it, think of how Req works but for Markdown. I’m glad it works for you!
leandrocp
Yep it’s in the pipeline. As soon as I solve AST manipulation it will be possible to format to HTML, HEEX, and even call arbitrary Elixir code. For context, https://mdxjs.com is a big inspiration for this library.
dkuku
I’m waiting for a elixir formatter plugin that will format my docs. I always have to redeploy to hex due to broken formatting
cvkmohan
BTW @leandrocp, how do we extend the library? am-kantox/md: Stream-aware markdown parser with custom syntax setting (github.com) and mudasobwa/markright: A customizable markdown parser in Elixir: pure pattern matching. (github.com) look two interesting projects.
One question I have is - if we want to support hashtags (#) or mentions (@) - is it better to go to Javascript libraries like Tiptap, Quill etc. or is there anything we can try using your sort of libraries?
Sorry - if the question is very naive.
leandrocp
@cvkmohan I’ve considered md and others but none of them did the job for my needs. I got excited with
mdand its extension capabilities but quoting its readme “If one needs to perfectly parse the common markdown,Mdis probably not the correct choice” so that was a major blocker.Regarding extending MDEx that’s what I have in mind: RFC - Extension API · Issue #37 · leandrocp/mdex · GitHub - the first part which is parsing the document (AST) and formatting to HTML is half way done (Elixir and Rust), so it’s in progress.
I’m not sure I follow your question, both Tiptap and Quill are rich text editors while MDEx is a Markdown parser/formatter. With MDEx you’ll be able to manipulate the document after it was written, either with Tiptap or any other editor. So let’s say for example you want to add a link to every tag in your document, ie: transform
#tag_ato[#tag_a](link)you’ll be able to traverse the AST and transform atextnode into alinknode. See RFC - Extension API · Issue #37 · leandrocp/mdex · GitHub for an example.Does it make sense?
leandrocp
Hi @dkuku what kind of broken formatting you get publishing to hex? I’ve had an issue or two with earmark but in overall it works fine.
The “formatter” in “A fast 100% CommonMark-compatible GitHub Flavored Markdown parser and formatter.” means converting markdown to HTML and potentially other formats, but I’m assuming you’re talking about a
mix formatplugin, right? Can you elaborate a bit more?cvkmohan
Thanks @leandrocp. Yes, you answered even my imaginary question.
Yes, I am looking at something like transforming text node into a link node. By using it - I intend to avoid using a Rich Text Editor. MDEx looks sufficiently fast - and - a split text box with source on the left - and - parsed results on the right should make Rich Text Editor unnecessary. And once you bring slab/delta-elixir: Simple yet expressive format to describe contents and changes
(github.com) into the mix, may be collaborative editing is possible entirely in the Elixir world!
Thanks for the answer. Will be looking forward to future releases.
mayel
If you’re looking for a way to parse and transform mentions, hashtags, and links: GitHub - bonfire-networks/linkify: Linkify is a basic package for turning website names into links. · GitHub