Ross Kaffenberger Profile picture
Oct 18 6 tweets 1 min read Read on X
If you’re doing any custom markdown rendering, something you should demand of your Markdown library is access to the abstract syntax tree.

For Ruby, that includes Kramdown, CommonMarker, and Markaby.
In JavaScript land, Markdown AST parsing is what makes MDX possible for embedding React components in Markdown.
For Joy of Rails, I author content in what I call MDRB.

Inspired by MDX, it’s my own flavor of mixing ERb into Markdown so I can create interactive articles from what initially renders as static content.
The magic comes from walking the Markdown syntax tree parsed by CommonMarker to produce highly customized HTML.
This example demonstrates how you could parse a Commonmarker markdown document into an abstract syntax tree to customize the output. Each `node` provides a `type` to switch on behavior and an `each` method for iterating over its direct children. Image
Correction: *Markly

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Ross Kaffenberger

Ross Kaffenberger Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @rossta

Aug 6, 2020
As a senior engineer in a large(ish) remote organization, I’ve had to lean on diagrams more and more to communicate software design. A picture really is worth a bunch of words.
I’ve previously worked on smaller, co-located teams where diagramming was pretty rare, perhaps a whiteboard session every now and then.
With a large org, more teams, and more moving parts, less of the application can fit in everyone’s heads. Shared understanding takes more effort.
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(