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

13 comments:

  1. ^____^ And this is why I wrote mmd.js in the first place. To make a new version of my site, using markdown. At first I thought of parsing the md on the client side, but it was a no-brainer to put mmd.js in a node.js script generating a static version of my site.

    How does that work for you so far ? Any drawback with this approach ?

    ReplyDelete
  2. I don't think I have node.js behind blogspot.com ... I mean ... CloudReflection is made on the cloud.

    I don't need a server here so I guess it works :-)

    ReplyDelete
  3. Technical writing can be challenging, especially when it comes to figuring out how to write about technical equipment, gadgets or concepts. Please visit us: technical writing

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. This is an excellent tip especially to those new to the blogosphere. Short however exact data… Thank you for sharing this one. An unquestionable requirement read post!

    best interiors

    ReplyDelete