5 ms·
While I really like the idea of serving raw HTML and CSS, I think that on the authoring side, a static site generator that ingests Markdown and generates HTML i
by dceddia 6y ago
While I really like the idea of serving raw HTML and CSS, I think that on the authoring side, a static site generator that ingests Markdown and generates HTML is a more practical way to go.
I think writing raw HTML can work fine for small pages, and arguably it can be better than Markdown for pages with a lot of design elements, like landing pages. But for the typical blog post, or especially if the blog post has code snippets that you want to have syntax-highlighted, a static site generator is way easier to work with.
With the pace of change, I do worry a bit about the longevity of some of today's static site generators, but the Markdown itself is pretty darn portable.
- Tomte 6y agoThere 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.
- stan_rogers 6y agoWith that, you can't even tell me why the text it italicized. Markdown mostly sucks.
- forgotmypw17 6y agoI don't like Markdown, because it too often takes what I meant and changes it to what I think I meant. I'm OK with ambiguity between implementations, but this one is a deal-breaker for me, and I've not encountered a Markdown implementation which doesn't do it. I think it's just a faulty idea to begin with.
- smichel17 6y agoCan you be more specific / give an example?
- forgotmypw17 6y agomore specific: when i want something left alone or displayed as is, markdown does its own thing and wrecks it completely. and there is usually no easy way to negate it. no, pre-pending each line wit 4 spaces, only to get nowrap now, which works like shit in small displays, is not easy. it makes the user think and do extra work at minimum. examples: emoticons urls with certain common symbols code textart that,s just off the top
- lenkite 6y agoPerhaps you should take a look at https://asciidoc.org/ https://asciidoc.org/