5 ms·
There are lots of different MD flavours, though. And even with Pandoc extensions you cannot really have an image inside <figure> with <figcaption> and alt text
by Tomte 6y ago
There are lots of different MD flavours, though.
And even with Pandoc extensions you cannot really have an image inside <figure> with <figcaption> and alt text and title text.
- esperent 6y agoEasy enough to do that with a static site generator like Hugo/Jekyll though.
- dceddia 6y agoYep there are definitely some differences, especially once you start to go off the beaten path by including HTML in the Markdown, or using whatever flavor of template language the SSG provides. I've got some older posts that use Jekyll's {% highlight %} directive, and I know that won't work if/when I change SSGs, but to me that's a small price to pay for not having to author those in raw HTML! :)
- TheRealPomax 6y agoMost near-trivial to rewrite to each other's format though, which means you can get any static generator to ingest your favourite flavour with only a one-time step possibly (but almost certainly not) required to teach it how to ingest a format that isn't a perfect match for what it expects.
- chrismorgan 6y agoA couple of years back, I helped move Fastmail’s blog from a home-grown thing from the mid-2000s that used Markdown.pl, to Ghost. It was nowhere near trivial. Line break behaviour changed, handling of indentation changed, treatment of raw HTML and Markdown characters within HTML tags changed… I fixed everything I noticed, but there was a lot of incompatibility, and old posts would have looked uniformly bad without some of the fixes we applied.
- TheRealPomax 6y agoTo be fair, the mid-2000s are fifteen+ years ago, which might as well be a century ago when it comes to both markdown, static site generators, and even the web in general. I've been through similar pains myself, but not in the last five years: there's been plenty of tooling to strict-format all content prior to starting any conversion, and plenty of tooling to convert from one flavour of markdown to another (although, mind you, sometimes that means converting away from markdown first, then converting that back to your new flavour).
- chubot 6y agoI just use the small reference C implementation of CommonMark and it works great: https://github.com/commonmark/cmark https://github.com/commonmark/cmark There is an example where you load it via shared library in Python, i.e. send a Markdown string and get back an HTML string.