var value = $('#sourcecode').text();
var mode = $('#sourcecode').attr('language');
var pre = $('#sourcecode').get(0);
var viewer = CodeMirror(function(elt) {
pre.parentNode.replaceChild(elt, pre);
}, {
value: value,
lineNumbers: true,
matchBrackets: true,
lineWrapping: true,
readOnly: true,
mode: mode
});
};