//----------------------------------------------------------------------------
//  Copyright (C) 2012  The IPython Development Team
//
//  Distributed under the terms of the BSD License.  The full license is in
//  the file COPYING, distributed as part of this software.
//----------------------------------------------------------------------------

//============================================================================
// Notebook
//============================================================================

/**
 * @module IPython
 * @namespace IPython
 **/

var IPython = (function (IPython) {
    "use strict";
        /**
         * A place where some stuff can be confugured.
         *
         * @class config
         * @static
         *
         **/
    var default_config = {
        /**
         * Dictionary of object to autodetect highlight mode for code cell.
         * Item of the dictionnary should take the form :
         *
         *     key : {'reg':[list_of_regexp]}
         *
         * where `key` will be the code mirror mode name
         * and `list_of_regexp` should be a list of regext that should match
         * the first line of the cell to trigger this mode.
         *
         * if `key` is prefixed by the `magic_` prefix the codemirror `mode`
         * will be applied only at the end of the first line
         *
         * @attribute cell_magic_highlight
         * @example
         * This would trigger javascript mode
         * from the second line if first line start with `%%javascript` or `%%jsmagic`
         *
         *     cell_magic_highlight['magic_javascript'] = {'reg':[/^%%javascript/,/^%%jsmagic/]}
         * @example
         * This would trigger javascript mode
         * from the second line if first line start with `var`
         *
         *     cell_magic_highlight['javascript'] = {'reg':[/^var/]}
         */
        cell_magic_highlight : {
              'magic_javascript':{'reg':[/^%%javascript/]}
             ,'magic_perl'      :{'reg':[/^%%perl/]}
             ,'magic_ruby'      :{'reg':[/^%%ruby/]}
             ,'magic_python'    :{'reg':[/^%%python3?/]}
             ,'magic_shell'      :{'reg':[/^%%bash/]}
             ,'magic_r'         :{'reg':[/^%%R/]}
            },

        /**
         * same as `cell_magic_highlight` but for raw cells
         * @attribute raw_cell_highlight
         */
        raw_cell_highlight : {
             'diff'         :{'reg':[/^diff/]}
            },

        tooltip_on_tab : true,
        };

    // use the same method to merge user configuration
    IPython.config = {};
    $.extend(IPython.config, default_config);

    return IPython;

}(IPython));


@@ -1951,16 +1951,20 @@
 ascript'
+    
 :%7B'reg':
@@ -2006,32 +2006,36 @@
 agic_perl'      
+    
 :%7B'reg':%5B/%5E%25%25per
@@ -2067,24 +2067,28 @@
 _ruby'      
+   
+ 
 :%7B'reg':%5B/%5E%25
@@ -2124,16 +2124,20 @@
 _python'
+    
     :%7B'r
@@ -2186,24 +2186,27 @@
 shell'      
+   
 :%7B'reg':%5B/%5E%25
@@ -2238,32 +2238,36 @@
 agic_r'         
+  
+  
 :%7B'reg':%5B/%5E%25%25R/%5D
@@ -2264,24 +2264,83 @@
 ':%5B/%5E%25%25R/%5D%7D%0A
+             ,'magic_text/x-cython' :%7B'reg':%5B/%5E%25%25cython/%5D%7D%0A
             

enable cython highlight in notebook