Code Prettefier

Code Prettefier

by IPWright83

HTML

<h1>Javascript</h1>
<pre class="prettyprint">
public interface IUserInfoProvider
{
   IUserInfo GetUserInfo(int id);
}

public interface IUserInfo
{
    public int ID { get; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
}
</pre>

JavaScript

YUI({
    modules: {
        'gallery-prettify': {
            fullpath: 'https://raw.github.com/derek/yui3-gallery/master/src/gallery-prettify/js/prettify.js',
            requires: ['gallery-prettify-css-sam']
        },
        'gallery-prettify-css-sam': {
            fullpath: 'http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css'
        },
        'gallery-prettify-css-night': {
            fullpath: 'http://google-code-prettify.googlecode.com/svn/trunk/styles/sunburst.css'
        }
    }
}).use('gallery-prettify', function(Y) {
    // It's loaded, now make everything pretty!
    Y.prettyPrint();
});