SC.loadPackage({ 'Compiler': {
comment: 'I compile W3C HTML5 conpliant self-contained documents from this editor\'s current document.',
properties: {
pageAsHTML5: {
comment: 'I compile to HTML5.',
transform: function(theDocument){
var thePage = '';
thePage += '\n';
thePage += '\n\t
'
+'\n\t\t'
+'\n\t\t'
+'\n\t\t'
+document.getElementsByTagName('title')[0].innerHTML
+''
+'\n\t\t'
+'\n\t\t'
+'\n\t';
thePage += '\n\t';
thePage += '\n\t\t';
for(var children = theDocument.get('children'),
i = 0, l = children.length; i < l; i++){
thePage += children[i].do('renderYourself', { indent: 4 })
}
thePage += '\n\t\t
\n\t\n';
return thePage;
}
}
},
methods: {
init: {
comment: 'I init the compiler (currently no options, only html5).',
code: function(){
this.set({ pageAsHTML5: SuperGlue.get('document') });
}
}
}
}});