Wednesday, 10 April 2013
A tiny script to markdown: tinydown
Isn't a tiny markdown parser lovely ?
=====================================
A markdown is an _easy to read and quite easy to parse_ syntax, ideal for documents
that could be understood by human, and easily converted by machines.
You are reading markdown now!
-----------------------------
This blogpost is generated on the fly via the proposed script.
Here the code **example** used for this page:
this.onload = function () {
document.body.innerHTML = tinydown(
document.body.textContent
);
};
You can find a very nice guide about [how to markdown here](http://daringfireball.net/projects/markdown/syntax "markdown style guide").
### What is supported ?
* headers with = or - notation
* headers with # notation
* blockquotes and nested blockquotes
* ordered and unordered lists
* images with optional alt ant title
* inline links with arbitrary title
* <em> via single asterisks/underscore, or double for <strong> tag
* inline `code` via `` ` `` backtick
### What is not supported ? ###
* paragraphs are missings
* nested lists and nested markdown inside lists
* links with references and/or id
* raw html is not recognized, validated, parsed
> and just to demonstrate it works
> > this is a nested blockquote example :-)
> have a lovely day
- - -
© WebReflection
Subscribe to:
Posts (Atom)