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

Could anyone explain to me the trend to write HTML in some other markup syntax? I write HTML in HTML. Going from one markup language to another seems like an extra unnecessary prereq.



Ideally, we would write everything in plaintext, but it doesn't support even the most basic features offered by typesetting (bold, italics, etc.) or hypertext (embedded links), so we turn to markup languages at the expense of readability.

Markup syntax like markdown, asciidoc, reStructuredText, etc. strive primarily to preserve readability with the least obtrusive syntax, and with a smaller learning curve (at least for the most basic usage).

So why use it instead of HTML? Like you, I typically write HTML in HTML, but often use asciidoc for other purposes (documentation, recipes, quick notes, etc.), because:

- One source document can output to multiple formats, like XHTML, LaTeX, PDF, DocBook, EPUB, Man page, etc. It's even trivial to output to a specific HTML DOCTYPE. That's pretty neat!

- Diffs are far more readable when not swimming in markup soup.

- HTML is overkill for many purposes. In fact, lightweight markup has its roots in email/newsgroup markup. HTML email is still a compatibility nightmare. Wouldn't it be great if a new standard for rich text email was developed, based on something as simple as markdown? It would be trivial to support it in webmail interfaces and the source would still be readable in plaintext email clients or if the sender went overboard with style choices.

- Archivability. Many old HTML documents render poorly in modern browsers, mainly due to style choices that seemed sensible at the time. Lightweight markup focuses more on the content and discourages going off on a stylistic tangent you may regret later. In other words, it does a good job of separating content from presentation, so your source documents will always remain readable and transform to something readable with relatively few tweaks in external stylesheets or configuration files.

Because it's easy to learn without getting lost in the arcane details of validation and compatibility, it's understandable why it's gaining popularity.


Obviously web design work should be done in HTML, or a very close approximation thereof (HAML). However, despite the link title above, Markdown isn't a web design language at all. It's for writing and editing copy, which is a very different task.

Let's say you have a bunch of untrained writers who needs to do some semantic formatting. They don't know HTML, so you can't ask them to just write HTML. If you let them run rampant with a WYSIWYG word processor (probably Word) you'll wind up with monstrosities where fonts were manually bolded and enlarged to indicate headers and such, and someone has to clean up after it.

If you have Markdown editors, though, you can turn an untrained writer loose with a cheat sheet ("write # to get a header" and such) and you're all set. As a bonus, you can put the Markdown document in version control, export to formats besides HTML, and a few other useful things.

Some major websites like reddit have also successfully made use of Markdown and its competitors to permit rich text comments from people who know nothing about HTML.


Using Markdown instead of HTML is much faster, and results in readable source text, whereas source HTML is hard to parse for the naked eye.


HTML is really verbose. I personally prefer HAML for my own stuff (it's like comparing the same doc in XML to YAML), but Markdown is definitely easy to read for programmers and non-programmers alike. Its intention is to read like a plain text email.

I would't say markdown is any easier to write because the verbosity of HTML tags and structure is usually taken care of with editor macros. It's definitely easier to read the source though.


Markdown is wonderful for simple documents often read in plain text.


I find it significantly quicker to write/edit the first draft in Markdown, then switch to HTML for final tweaks and formatting.

Do others keep their final versions in Markdown?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: