Hacker News new | ask | show | jobs
by zahrevsky 42 days ago
I want any browser to render MD content natively. Imagine just dropping .md files to your server and having a working website.

Of course, there are services that do that for you, ranging from Hugo to Obsidian Publish. But they all add a level of complexity that you have to manage.

Also, this makes user-level styling much simpler. This is what any “Reading mode” does, but without reverse-engineering the content from a soup of tags and classes.

5 comments

I've been asking for this for many years. Native browser support in markdown will also give us a way to set our browser agents to prefer text/markdown over text/html, and thus opt-in to a cleaner web. Yes, I know you can embed HTML in markdown, but I would can hope it would work much like AMP except more open - with browsers deciding on what commonmark extensions they enable by default.
I use https://addons.mozilla.org/en-GB/firefox/addon/markdown-read... and so, for me, they do render natively.
I'm thinking about registering a mirror of my website on .md TLD (Moldova) and serve MD version of my site. This is for users who, like you, have an extension installed, and would prefer to configure the styling themselves. Or for AI agents, I guess.
You'd only get plain unstyled rendering with browser support. And at that level you don't need any complexity from Hugo or Obsidian - you only need a very simple script to convert md to plain html. No config or anything to maintain.
> You'd only get plain unstyled rendering with browser support

What I imagined is browsers rendering the content with headings, quotes, etc. Browsers could have some default styles to render MD files. Those styles could be configurable the same way “Reading mode” is usually configurable.

The plain unstyled rendering of strings of text is, of course, available even now. That's why I'm saying this needs a browser-level support.

> you only need a very simple script to convert md to plain html

I get, that it feels simple compared to other software. Even more, MD was designed specifically to be simple!

But if you think about it, this is still too much complexity to just share some text.

With native browser support, you could run zero commands to build a website.

I think this is mostly important for regular users, not developers. Imagine if creating a Word document would require the same level of complexity as building a web page: I doubt that the format would be so popular as it is nowadays.

> Imagine just dropping .md files to your server and having a working website

Why imagine. That's what I do, except it's a cron that runs the shell script that converts all the markdown to html.

> cron that runs the shell script

So then you don't just drop a .md file.

> So then you don't just drop a .md file.

I literally do - I drop a file in a folder; the fact that everything else is automated is irrelevant, because all I do is drop a file in a folder.

> the fact that everything else is automated is irrelevant

It is relevant because you're the one that wrote the script to automate it.

Sure, it works for you. But it doesn't work for everyone else, which I think was the other person's ideal when they said:

Imagine just dropping .md files to your server and having a working website

They didn't literally mean your server.

Not only that, but also generally maintaining the script is a new responsibility. Adding browser-level support of .md files shifts this responsibility to the browsers, which, if you ask me, is where it belongs.
I just want Google Docs to properly support Markdown. Everything else after that.