Hacker News new | ask | show | jobs
by neatcoder 2642 days ago
Similar topics are coming up often on HN recently. I think it's time Markdown should be supported natively by browsers. Until then, there are things like:

TeXMe (https://github.com/susam/texme): This is my personal favorite because it supports the CommonMark standard of Markdown and also LaTeX via MathJax. I like standards so that I know that the Markdown I write (especially nested lists, code within nested lists, etc.) get rendered the same way everywhere. I write some math too, so MathJax support is useful. If you are looking for something where you can just slap together Markdown and LaTeX and turn the document instantly into a paper-like finish, this is a good choice. The output can be saved as PDF or printed too just like you would print any paper.

MdMe (https://github.com/susam/mdme): This is pretty much TeXMe without MathJax support.

Markdeep (https://casual-effects.com/markdeep/): This is like TeXMe but it supports a lot of features like diagrams, tables, etc. But it comes at the cost of standard conformance. Markdeep does not conform to CommonMark. I don't need these additional features for most of my writing but I care about standard conformance, so I go with TeXMe but if you need these features then Markdeep is a good choice.

Comparison of TeXMe vs. Markdeep by the author: https://news.ycombinator.com/item?id=18314175

3 comments

> I think it's time Markdown should be supported natively by browsers.

I'd rather have AsciiDoc become the default lightweight documentation format. Markdown suffers from competing standards regarding extensibility beyond basic formating, whereas AsciiDoc is a quite direct translation of the solid standard Docbook.

Extending Markdown to anything more complex than bold, italic or headers requires deciding among a number of competing tools with different syntax and installing them as extensions. AsciiDoc has features as tables, references, images or metadata integrated in the standard, and it has been designed for extensibility, while Markdown was not.

There is an advantage of using Markdown over AsciiDoc, which is that it is currently supported by a larger variety of tools. But that advantage is somewhat negated by its different and slightly incompatible flavors.

https://asciidoctor.org/docs/asciidoc-vs-markdown/

https://www.ericholscher.com/blog/2016/mar/15/dont-use-markd...

Does AsciiDoc have a nice way to ignore all LaTeX code enclosed within $...$ (inline math), $$...$$ (displayed math), \(...\) (inline math), and \[...\] (displayed math)?

I think one of the problems of Markdown is that it does not provide a way for the Markdown parser to ignore any text within certain delimiters (I especially care about ignoring text within Latex math delimiters). This is the most crucial reason why I am using tools like TexMe or Markdeep.

Is AsciiDoc better in this area? If yes, it would definitely solve a big problem for me that Markdown does not solve.

AFAIK there are several ways to embed LaTeX and mathematical formulas in AsciiDoc such as asciidoctor-latex [1] or ASCIIMathML and LaTeXMathML [2].

AsciiDoc also allows embedding literal paragraphs or blocks of text [3]. I think the mechanism of passthrough macros [4] can be used to copy raw text to the output and allow further processing down the pipeline, though I'm not sure how it's used.

[1] https://github.com/asciidoctor/asciidoctor-latex

[2] http://asciidoc.org/#X3

[3] http://asciidoc.org/userguide.html#X76

[4] http://asciidoc.org/userguide.html#X77

> I think it's time Markdown should be supported natively by browsers.

Will never happen b/c markdown can't be bloated with MBs of javascript.

:)

I've only skimmed over the links you provided so far, but why do we even need any of this stuff?

Look at this recent show HN: https://news.ycombinator.com/item?id=19482280

It's plain text, would parse as valid Markdown for the most part but reads just fine - I didn't even realize that it was MD until someone mentioned it in the comments. Using

  Underlined Text
  ===============
  Works as an effective heading (# in MD)
  Leaving some empty lines also helped in that txt file
  * and these
    * type of lists
  * work just fine.
Why not just use a .txt file with two or three special format codes: one to make a URL clickable, one to embed an image (with a specified width, clicking goes to the full image), and (maybe? - this is getting kinda complex) one for math.

On the one hand there are barebones formats like what I described, and on the other there are complex ones like MD and the ones you linked to. The issue with all of the complex ones is that they provide leaky abstractions.

With MD you get a compiler that does MD->HTML, and you provide your own CSS file. OK, now you have a neat looking table. But what if you want to make a cell span two columns? You're screwed, you either need to look up complex nonstandard syntax for that (may as well use HTML at that point) or just convert the whole table into HTML (now you have 80% MD and 20% HTML in your file).

But if you have a .txt file, you just delete the | pipes you drew. Sure it's a bit more tedious, but it works and is 100% consistent.

And what if your CSS gives table header rows a yellow background, but you want one column of a specific table to be red? Again you need nonstandard syntax to mark that table with a class and link it to a CSS rule, or you just convert the whole thing to HTML and add an inline color="...". Leaky abstraction.

In this case a .txt helps by removing choice and placing limitations - you can format the whole document as a text file but with clickable links and inline images, and if you need more styling then you can use HTML. Or write in MD and compile into HTML, if that's what you want.

MD and its other formats are in a half-between position where you often use the abstraction but also occasionally have to fall down to the lower HTML level, and I just don't think that it deserves a place as a standard format for web browsers.