Markdown to HTML from GitHub README.md file
- Get the raw file url of the README.md file from the GitHub repo.
- Format the url in the following format,
http://markdown.io/<url_readme_file>
. Let's say the url of my readme.md file ishttp://raw.github.com/pankajparashar/nerdy-css/master/README.md
. Hence, the new url becomeshttp://markdown.io/http://raw.github.com/pankajparashar/nerdy-css/master/README.md
- 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.