Markdown to HTML from GitHub README.md file

  1. Get the raw file url of the README.md file from the GitHub repo.
  2. Format the url in the following format, http://markdown.io/<url_readme_file>. Let's say the url of my readme.md file is http://raw.github.com/pankajparashar/nerdy-css/master/README.md. Hence, the new url becomes http://markdown.io/http://raw.github.com/pankajparashar/nerdy-css/master/README.md
  3. Now use jQuery's load method using this new url and extract the content from #md-content id of the page.

Complete demo of the above steps available here - non-working link removed


You should check out:

https://github.com/zmckinnon/jquery-gh-readme

It uses the GitHub API to retrieve the contents of the readme using this call:

GET /repos/:owner/:repo/readme

Then it converts the base64 encrypted content.

Then it converts the markdown content to html using marked.