Repository: kmahelona/ipython_notebook_goodies Branch: gh-pages Commit: aaefb28c21c1 Files: 7 Total size: 13.4 KB Directory structure: gitextract_ujpddqpt/ ├── README.md ├── index.html ├── ipython_notebook_toc.js ├── javascripts/ │ └── scale.fix.js ├── params.json └── stylesheets/ ├── pygment_trac.css └── styles.css ================================================ FILE CONTENTS ================================================ ================================================ FILE: README.md ================================================ ipython_notebook_goodies ======================== Random goodies for use in iPython Notebooks. Tested with the latest iPython Notebook 3.2.0 1. Table of Contents -------------------- Make a table of contents for your notebook. Uses headings (e.g. H1, H2, etc.) to build TOC, and provides anchors (added where needed). **Usage:** 1. Add a *markdown* cell at the top of your notebook with the following: ```

Table of Contents

``` 2. Add a *code* cell anywhere in the notebook with the following: ``` %%javascript $.getScript('https://kmahelona.github.io/ipython_notebook_goodies/ipython_notebook_toc.js') ``` ================================================ FILE: index.html ================================================ iPython Notebook Goodies by kmahelona

iPython Notebook Goodies

Random goodies for use in iPython Notebooks

View the Project on GitHub kmahelona/ipython_notebook_goodies

ipython_notebook_goodies

Random goodies for use in iPython Notebooks

1. Table of Contents

Make a table of contents for your notebook. Uses headings (e.g. H1, H2, etc.) to build TOC, and provides anchors (added where needed).

Usage: Include the following at the top of your notebook:

<h1 id="tocheading">Table of Contents</h1>
<div id="toc"></div>
<script type="text/javascript" src="https://raw.github.com/kmahelona/ipython_notebook_goodies/master/ipython_notebook_toc.js">
================================================ FILE: ipython_notebook_toc.js ================================================ // Converts integer to roman numeral function romanize(num) { var lookup = {M:1000,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1}, roman = '', i; for ( i in lookup ) { while ( num >= lookup[i] ) { roman += i; num -= lookup[i]; } } return roman; } // Builds a "); } $('#toc').append(toc); }; // Executes the createToc function setTimeout(function(){createTOC();},100); // Rebuild to TOC every minute setInterval(function(){createTOC();},60000); ================================================ FILE: javascripts/scale.fix.js ================================================ var metas = document.getElementsByTagName('meta'); var i; if (navigator.userAgent.match(/iPhone/i)) { for (i=0; iTable of Contents\r\n\t
\r\n\t