Fork me on GitHub

ACE in Python mode

value = '''
def foo():
    return 'foo'
'''
ace = factory('#field:ace', value=value, props={
    'label': 'Python source',
    'required': 'Code is required',
    'theme': 'github',
    'mode': 'python',
})
def foo(): return 'foo'

ACE in Javascript mode

value = '''
var foo = function() {
    return 'foo';
};
'''
ace = factory('#field:ace', value=value, props={
    'label': 'Javascript Source',
    'required': 'Code is required',
    'theme': 'github',
    'mode': 'javascript',
})
var foo = function() { return 'foo'; };