Tech News
← Back to articles

The Joy of Mixing Custom Elements, Web Components, and Markdown

read original related products more articles

The Joy of Mixing Custom Elements, Web Components, and Markdown

I love Markdown. I write faster and more natively in it than any other format or tool.

If we zoom way out, here’s the most basic philosophy of Markdown: replace complicated stuff with simpler stuff.

That’s all it does, really. It replaces some tedious nested taggy stuff with way simpler stuff that makes more visual sense and is faster to type. At its core, Markdown is really just a bunch of macros.

This website runs on 6,000-ish Markdown files. They’re processed on the server – meaning the Markdig library from .NET processes them, then sends back the resulting HTML. I’m all-in on Markdown, to the point where I wrote my own online editor for it.

Server-side processing of Markdown is a pretty common model – most static site generators fundamentally do the same thing: they process the Markdown, turn it into HTML, and that gets sent to the server (via being written to files).

One of the philosophical points of Markdown is that you can mix it with HTML. Meaning, a Markdown parser is supposed to leave HTML alone – if a line of text looks like it has some tags, the parser should skip it.

This means you can do this:

This is some **Markdown!** This is some more ***Markdown!***

And that should work fine. The first and last lines will be processed and transformed, and the middle line will be left alone and output as it’s written.

... continue reading