[Level 1] Install slideshow support in iPython notebook.
Just found an iPython notebook extension support slideshow
and you could install by the following steps.
Precondition:
Because this introduction would try to clone a github project,
you have install git utility first.
Wish this helps.
regards,
Stanley Huang
$ sudo apt-get -y install git1. Use the following commands to install slideshow support.
## get porfile directory
profile_dir = get_ipython().profile_dir.location
## clone extension from github
import os
tgt = os.path.join( profile_dir, 'static', 'custom')
!git clone https://github.com/ipython-contrib/IPython-notebook-extensions.git $tgt
%cd $tgt
## create a javascript for supporting slideshow
%%writefile custom.js
// we want strict javascript that fails
// on ambiguous syntax
"using strict";
// do not use notebook loaded event as it is re-triggerd on
// revert to checkpoint but this allow extesnsion to be loaded
// late enough to work.
//
$([IPython.events]).on('app_initialized.NotebookApp', function(){
/** Use path to js file relative to /static/ dir without leading slash, or
* js extension.
* Link directly to file is js extension.
*
* first argument of require is a **list** that can contains several modules if needed.
**/
// require(['custom/noscroll']);
// require(['custom/clean_start'])
// require(['custom/toggle_all_line_number'])
// require(['custom/gist_it']);
/**
* Link to entrypoint if extesnsion is a folder.
* to be consistent with commonjs module, the entrypoint is main.js
* here youcan also trigger a custom function on load that will do extra
* action with the module if needed
**/
require(['custom/slidemode/main'],function(slidemode){
// // do stuff
})
});
2. restart iPython Notebook and reload page to get slideshow button. (Just on the right of cell type)
Wish this helps.
regards,
Stanley Huang
Comments
Post a Comment