Enhanced Github gadget

In Dynamic height github gadget for Google Site I showed how to display prettified source code directly from your gitHub repo on your Google Site. Here's some enhancements to that same gadget with additional options as follows;
  • You can now specify that the height is not dynamic. Like this it will behave as a regular gadget and respect the height you chose in the gadget settings. The default is  to automatically adjust its height to the content. If you choose this option, you probably should choose the option to add scroll bars too. If you choose dynamic height, you should leave the scroll bars turned off.
  • You can choose whether the gadget reveals its content only when hovered over (the default), or whether the content is shown permanently. 
  • It can now render markdown documents using the github styles. I'm using this stylesheet to style which I found in Sindre Sorhus's github repos. I'm also using the github api to do the markdown rendering legwork. 

The gadget preferences

This is the default gadget setup. You can see the new options (translate from markdown, source prettification, permanently revealed and dynamic height).

Here is the gadget source code using the default options. 

Where to get it

The hosted address for my version this gadget is as below. You can use it or copy and make your own.  

To insert, go to insert/..More gadgets and insert by URL. 


If you choose the markdown option, it will be expecting to render a markdown file, like README.md. Here's an example from one of my guithub repos, using this configuration

Note - relative links to Github resources won't work from the rendered markdown yet. I'll need to get round to fiddling with  those at some point, but for now I don't think this is a big issue.

See more like this in Using a canvas in Google sites and Displaying analytics data on site pages
For help and more information join our forum,follow the blog or follow me on twitter .