Thoughts on Markdown
smashingmagazine.com
smashingmagazine.com
I cringe whenever I have to write markdown. It's such a bad format, and it's a shame that people tried to keep bolting on additional features it wasn't meant to support instead of just picking a better option. I wonder if John Gruber even knew about AsciiDoc when he started work on Markdown, and if he would have gone to the trouble if he had.
Where Markdown falls down is when people try to apply it to larger, more formal documents that need specific formatting choices: footnotes, specific list layouts, table line breaks, etc. Once you get up to trying to publish a more complicated document, you find the edges of Markdown pretty quickly. I would say "right tool for the right job", but the problem is that once devs get used to one format, they don't want to learn another.
I decided to use Markdown for the first implementation of Haven[1]'s editor but I'm definitely keeping my eye on some of these newer block-based systems. There was a Joel-on-software post last month advocating for something similar[2].
One advantage I keep thinking about (but probably over-value) is graceful degradation without Javascript. You can still write Markdown in a `textarea` and submit it in a form. Is there a similar fall-back for these modern editing systems?
[1]: https://havenweb.org [2]: https://www.joelonsoftware.com/2022/01/27/making-the-web-bet...
MD is definitely an example of simpler than possible.
Its biggest benefit is its extensibility which lets you embed interactive Vue Components directly in the docs, which we've made liberal usage of in our latest product release with tabbed components & online project creator embedded directly in the release notes, e.g:
https://docs.servicestack.net/releases/v6#todos-mvc
A lighter weight extensibility option is to extend it [1] with custom block-level custom containers using markdown-it-container [2] which lets you create custom markup like this:
::: nuget `<PackageReference Include="ServiceStack.OrmLite.PostgreSQL" Version="6.*" />` :::
::: sh x mix postgres :::
Which gets rendered into custom copy widgets as seen in:
https://docs.servicestack.net/ormlite/installation
Source:
https://raw.githubusercontent.com/ServiceStack/docs/master/d...
Markdown all text things!
Basically if it needs to capture text content, I'll look for the Markdown version if it exists, which extends into my preferred TODO App: https://notable.app - a beautiful little App that manages a static directory of *.md files. My first TODOs replacement of using notepad.exe that's stuck.
[1] https://vitepress.vuejs.org/guide/markdown.html#advanced-con...
If we want machine readable data we should think first about how it will be authored. Maybe our new format has Excel style tables, and Mustache templates that can read them, so that we can just drop in a table view widget in the editor and customize it, filter it, let users sort it, etc.
Maybe our tables have a type UUID for identifying what the table layout is.
For example, let's say you want something that's not supported by Markdown's syntax, such as dictionary lists, but you want to be able to use Markdown's text formatting syntax with it:
```markdown
<dl>
<dt>*foo*</dt>
</dl>```
Most Markdown parsers don't apply Markdown parsing of text nodes within HTML elements. This is why the argument that Markdown supports HTML doesn't work, because it literally doesn't work for why we are using Markdown in the first place... which is to avoid the verbosity of HTML.
This kind of thing really bugs me. No matter what, whenever I've tried using Markdown as a tool for constructing webpages rather than snippets/comments within pages, I end up having to write a custom AST transformer to either get the parser to produce the right output or to prevent it from adding <p> tags around block elements that shouldn't have them in the first place.
Maybe a formal standardization could be the first step to actually addressing such issues, but it's questionable whether it's worth the bother.
In practice, that's what pandoc is (and it includes definition lists as extensions: https://pandoc.org/MANUAL.html#definition-lists )
You also have commonmark (an actual standardization) from the same author: https://commonmark.org/ (but DLs are not part of commonmark yet)
This is true for everything that people actually use. What you just quoted, a "<dl>" tag, is a writing concept that I, and I think most people, have never heard of and have never used in written documents. Maybe that should change, but that's kinda how it is...
For community wiki situations you do not want anything that is even accidentally Turing complete because you will end up with malicious content. In a work setting you are putting your job in danger if you do something like this, so there is mutually assured destruction. No such thing with random internet strangers.
It’s also just a crutch. Thinking you can reach for HTML means you don’t find inspiration to solve problems like having anchors on headings