Hacker News new | past | comments | ask | show | jobs | submit login

It feels like a long term solution would be to use a markdown that is both easy to write (not RTF or XHTML), but has a defined grammar in some standard format (ex: EBNF). Most platform/languages will have a parser and so you can whip up a "renderer" or converter trivially at any point.

The only markup I'm finding with a grammar is MediaWiki (sort of..)

https://www.mediawiki.org/wiki/Markup_spec

Even Djot doesn't seem to have one. Weird..




MediaWiki has one of the worst syntaxes and formalisations out there. I've been trying to render wikipedia pages on and off for more than 10 years and there is no independent parser covering the whole syntax and magic behaviour.

https://www.mediawiki.org/wiki/Alternative_parsers

There is only parsoid, developed for the visual editor and that took pretty much a decade to build with much pain and suffering.

This is not the answer.


It also doesn't help that in practice most wikis install at least some parser extensions.


Yeah, sorry.. i didn't mean to endorse MediaWiki. It did look kinda ugly as well.. haha

What do you recommend?

It does actually seem that djot has a grammar of sorts..

https://github.com/treeman/tree-sitter-djot/blob/master/gram...

(it's designed for a tree sitter.. I'm not super clear if it's globally usable)


Markdown is already fragmented, that would just be introducing a new fragment, not a standard [insert that comic that everyone posts any time someone proposes a new standard].

The long-term solution is having whatever markdown grammar you want and converting it to a standard AST. Then anyone can create their own transformations of that AST to render whatever document they want, including a new markdown document potentially in a different grammar.

https://pandoc.org/using-the-pandoc-api.html#pandocs-archite...

https://github.com/syntax-tree/mdast

https://unifiedjs.com/


"so you can whip up a "renderer" or converter trivially at any point"

And yet almost no one has...


To be fair, one there's a good one there's much less incentive to write something new. In this case the good converter is Pandoc: https://pandoc.org/


Thanks; but that's a converter, not a viewer.

The problem is the lack of READER applications to simply view (not edit or convert) all these Markdown documents.


In my defence, the comment I was replying to mentioned "renderers" and "converters". Furthermore IMHO, any text editor is a Markdown reader. If you want it formatted as is it were "markup" then might I suggest converting to e.g. PDF using Pandoc and then using one of the many capable viewers.


Noted, re the other comment.

But... come on. You might just as well say any text editor is a browser, because you can technically read HTML with it.

You can also technically read Word documents with a text reader.


I see your point, and maybe it's a matter of preference, but I really do use my text editor for reading Markdown. I wouldn't do the same for a Word doc or HTML, without at least running it through a convertor first.


b/c I think people start from the syntax and then think about how to parse it later?

A simple grammar probably really limits how you can design your syntax.

Here is an example of the problems:

https://roopc.net/posts/2014/markdown-cfg/




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: