##// END OF EJS Templates
add js_extensions_path...
add js_extensions_path serves files in `IPYTHONDIR/js_extensions` at `/js_extensions`. This is a location for users / devs to drop-in frontend customization as js modules, css, etc. The model is very much like the extensions dir (hence the name) - it's a location made available, but not loaded by default. You can load things from there with require, etc. It's a configurable search path, just like static. This way we can define a system-wide location at a later point (/usr/share/ipython/js_extensions?) and still have user installs.

File last commit:

r12495:05852a70
r12800:e6dfc2ae
Show More
config.js
80 lines | 2.7 KiB | application/javascript | JavascriptLexer
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202 //----------------------------------------------------------------------------
// 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
//============================================================================
Matthias BUSSONNIER
more docs, organize in namespace
r8739 /**
* @module IPython
* @namespace IPython
**/
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202
Matthias BUSSONNIER
more docs, organize in namespace
r8739 var IPython = (function (IPython) {
Matthias BUSSONNIER
"use strict" in most (if not all) our javascript...
r12103 "use strict";
Matthias BUSSONNIER
more docs, organize in namespace
r8739 /**
* A place where some stuff can be confugured.
*
* @class config
* @static
*
**/
Bussonnier Matthias
shift tqb for tooltip
r8949 var default_config = {
Matthias BUSSONNIER
more docs, organize in namespace
r8739 /**
* 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/]}
*/
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202 cell_magic_highlight : {
Matthias BUSSONNIER
enable cython highlight in notebook
r12495 'magic_javascript' :{'reg':[/^%%javascript/]}
,'magic_perl' :{'reg':[/^%%perl/]}
,'magic_ruby' :{'reg':[/^%%ruby/]}
,'magic_python' :{'reg':[/^%%python3?/]}
,'magic_shell' :{'reg':[/^%%bash/]}
,'magic_r' :{'reg':[/^%%R/]}
,'magic_text/x-cython' :{'reg':[/^%%cython/]}
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202 },
Matthias BUSSONNIER
more docs, organize in namespace
r8739
/**
* same as `cell_magic_highlight` but for raw cells
* @attribute raw_cell_highlight
*/
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202 raw_cell_highlight : {
'diff' :{'reg':[/^diff/]}
Bussonnier Matthias
shift tqb for tooltip
r8949 },
tooltip_on_tab : true,
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202 };
Bussonnier Matthias
shift tqb for tooltip
r8949 // use the same method to merge user configuration
IPython.config = {};
$.extend(IPython.config, default_config);
Matthias BUSSONNIER
autochange highlight with cell magics...
r8202
return IPython;
}(IPython));