[
  {
    "path": "README.md",
    "content": "ipython_notebook_goodies\n========================\n\nRandom goodies for use in iPython Notebooks. \nTested with the latest iPython Notebook 3.2.0\n\n1. Table of Contents\n--------------------\n\nMake a table of contents for your notebook. Uses headings (e.g. H1, H2, etc.) to build TOC, \nand provides anchors (added where needed).\n\n**Usage:** \n\n1. Add a *markdown* cell at the top of your notebook with the following:\n```\n<h1 id=\"tocheading\">Table of Contents</h1>\n<div id=\"toc\"></div>\n```\n2. Add a *code* cell anywhere in the notebook with the following:\n```\n%%javascript\n$.getScript('https://kmahelona.github.io/ipython_notebook_goodies/ipython_notebook_toc.js')\n```\n"
  },
  {
    "path": "index.html",
    "content": "<!doctype html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"chrome=1\">\n    <title>iPython Notebook Goodies by kmahelona</title>\n\n    <link rel=\"stylesheet\" href=\"stylesheets/styles.css\">\n    <link rel=\"stylesheet\" href=\"stylesheets/pygment_trac.css\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\">\n    <!--[if lt IE 9]>\n    <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n  </head>\n  <body>\n    <div class=\"wrapper\">\n      <header>\n        <h1>iPython Notebook Goodies</h1>\n        <p>Random goodies for use in iPython Notebooks</p>\n\n        <p class=\"view\"><a href=\"https://github.com/kmahelona/ipython_notebook_goodies\">View the Project on GitHub <small>kmahelona/ipython_notebook_goodies</small></a></p>\n\n\n        <ul>\n          <li><a href=\"https://github.com/kmahelona/ipython_notebook_goodies/zipball/master\">Download <strong>ZIP File</strong></a></li>\n          <li><a href=\"https://github.com/kmahelona/ipython_notebook_goodies/tarball/master\">Download <strong>TAR Ball</strong></a></li>\n          <li><a href=\"https://github.com/kmahelona/ipython_notebook_goodies\">View On <strong>GitHub</strong></a></li>\n        </ul>\n      </header>\n      <section>\n        <h1>\n<a name=\"ipython_notebook_goodies\" class=\"anchor\" href=\"#ipython_notebook_goodies\"><span class=\"octicon octicon-link\"></span></a>ipython_notebook_goodies</h1>\n\n<p>Random goodies for use in iPython Notebooks</p>\n\n<h2>\n<a name=\"1-table-of-contents\" class=\"anchor\" href=\"#1-table-of-contents\"><span class=\"octicon octicon-link\"></span></a>1. Table of Contents</h2>\n\n<p>Make a table of contents for your notebook. Uses headings (e.g. H1, H2, etc.) to build TOC, \nand provides anchors (added where needed).</p>\n\n<p><strong>Usage:</strong> Include the following at the top of your notebook:</p>\n\n<pre><code>&lt;h1 id=\"tocheading\"&gt;Table of Contents&lt;/h1&gt;\n&lt;div id=\"toc\"&gt;&lt;/div&gt;\n&lt;script type=\"text/javascript\" src=\"https://raw.github.com/kmahelona/ipython_notebook_goodies/master/ipython_notebook_toc.js\"&gt;\n</code></pre>\n      </section>\n      <footer>\n        <p>This project is maintained by <a href=\"https://github.com/kmahelona\">kmahelona</a></p>\n        <p><small>Hosted on GitHub Pages &mdash; Theme by <a href=\"https://github.com/orderedlist\">orderedlist</a></small></p>\n      </footer>\n    </div>\n    <script src=\"javascripts/scale.fix.js\"></script>\n    \n  </body>\n</html>"
  },
  {
    "path": "ipython_notebook_toc.js",
    "content": "// Converts integer to roman numeral\nfunction romanize(num) {\n    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},\n\troman = '',\n\t    i;\n\tfor ( i in lookup ) {\n\t    while ( num >= lookup[i] ) {\n\t\troman += i;\n\t\tnum -= lookup[i];\n\t    }\n\t}\n\treturn roman;\n }\n\n// Builds a <ul> Table of Contents from all <headers> in DOM\nfunction createTOC(){\n    var toc = \"\";\n    var level = 0;\n    var levels = {}\n    $('#toc').html('');\n\n    $(\":header\").each(function(i){\n\t    if (this.id=='tocheading'){return;}\n        \n\t    var titleText = this.innerHTML;\n\t    var openLevel = this.tagName[1];\n\n\t    if (levels[openLevel]){\n\t\tlevels[openLevel] += 1;\n\t    } else{\n\t\tlevels[openLevel] = 1;\n\t    }\n\n\t    if (openLevel > level) {\n\t\ttoc += (new Array(openLevel - level + 1)).join('<ul class=\"toc\">');\n\t    } else if (openLevel < level) {\n\t\ttoc += (new Array(level - openLevel + 1)).join(\"</ul>\");\n\t\tfor (i=level;i>openLevel;i--){levels[i]=0;}\n\t    }\n\n\t    level = parseInt(openLevel);\n\n\n\t    if (this.id==''){this.id = this.innerHTML.replace(/ /g,\"-\")}\n\t    var anchor = this.id;\n        \n\t    toc += '<li><a href=\"#' + encodeURIComponent(anchor) + '\">'\n\t\t+ romanize(levels[openLevel].toString()) + '. ' + titleText\n\t\t+ '</a></li>';\n        \n\t});\n\n    \n    if (level) {\n\ttoc += (new Array(level + 1)).join(\"</ul>\");\n    }\n\n \n    $('#toc').append(toc);\n\n};\n\n// Executes the createToc function\nsetTimeout(function(){createTOC();},100);\n\n// Rebuild to TOC every minute\nsetInterval(function(){createTOC();},60000);\n"
  },
  {
    "path": "javascripts/scale.fix.js",
    "content": "var metas = document.getElementsByTagName('meta');\nvar i;\nif (navigator.userAgent.match(/iPhone/i)) {\n  for (i=0; i<metas.length; i++) {\n    if (metas[i].name == \"viewport\") {\n      metas[i].content = \"width=device-width, minimum-scale=1.0, maximum-scale=1.0\";\n    }\n  }\n  document.addEventListener(\"gesturestart\", gestureStart, false);\n}\nfunction gestureStart() {\n  for (i=0; i<metas.length; i++) {\n    if (metas[i].name == \"viewport\") {\n      metas[i].content = \"width=device-width, minimum-scale=0.25, maximum-scale=1.6\";\n    }\n  }\n}"
  },
  {
    "path": "params.json",
    "content": "{\"name\":\"iPython Notebook Goodies\",\"tagline\":\"Random goodies for use in iPython Notebooks\",\"body\":\"ipython_notebook_goodies\\r\\n========================\\r\\n\\r\\nRandom goodies for use in iPython Notebooks\\r\\n\\r\\n1. Table of Contents\\r\\n--------------------\\r\\n\\r\\nMake a table of contents for your notebook. Uses headings (e.g. H1, H2, etc.) to build TOC, \\r\\nand provides anchors (added where needed).\\r\\n\\r\\n**Usage:** Include the following at the top of your notebook:\\r\\n\\r\\n\\t<h1 id=\\\"tocheading\\\">Table of Contents</h1>\\r\\n\\t<div id=\\\"toc\\\"></div>\\r\\n\\t<script type=\\\"text/javascript\\\" src=\\\"https://raw.github.com/kmahelona/ipython_notebook_goodies/master/ipython_notebook_toc.js\\\">\\r\\n\\r\\n\",\"google\":\"\",\"note\":\"Don't delete this file! It's used internally to help with page regeneration.\"}"
  },
  {
    "path": "stylesheets/pygment_trac.css",
    "content": ".highlight  { background: #ffffff; }\n.highlight .c { color: #999988; font-style: italic } /* Comment */\n.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */\n.highlight .k { font-weight: bold } /* Keyword */\n.highlight .o { font-weight: bold } /* Operator */\n.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */\n.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */\n.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */\n.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */\n.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */\n.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */\n.highlight .ge { font-style: italic } /* Generic.Emph */\n.highlight .gr { color: #aa0000 } /* Generic.Error */\n.highlight .gh { color: #999999 } /* Generic.Heading */\n.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */\n.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */\n.highlight .go { color: #888888 } /* Generic.Output */\n.highlight .gp { color: #555555 } /* Generic.Prompt */\n.highlight .gs { font-weight: bold } /* Generic.Strong */\n.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */\n.highlight .gt { color: #aa0000 } /* Generic.Traceback */\n.highlight .kc { font-weight: bold } /* Keyword.Constant */\n.highlight .kd { font-weight: bold } /* Keyword.Declaration */\n.highlight .kn { font-weight: bold } /* Keyword.Namespace */\n.highlight .kp { font-weight: bold } /* Keyword.Pseudo */\n.highlight .kr { font-weight: bold } /* Keyword.Reserved */\n.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */\n.highlight .m { color: #009999 } /* Literal.Number */\n.highlight .s { color: #d14 } /* Literal.String */\n.highlight .na { color: #008080 } /* Name.Attribute */\n.highlight .nb { color: #0086B3 } /* Name.Builtin */\n.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */\n.highlight .no { color: #008080 } /* Name.Constant */\n.highlight .ni { color: #800080 } /* Name.Entity */\n.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */\n.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */\n.highlight .nn { color: #555555 } /* Name.Namespace */\n.highlight .nt { color: #000080 } /* Name.Tag */\n.highlight .nv { color: #008080 } /* Name.Variable */\n.highlight .ow { font-weight: bold } /* Operator.Word */\n.highlight .w { color: #bbbbbb } /* Text.Whitespace */\n.highlight .mf { color: #009999 } /* Literal.Number.Float */\n.highlight .mh { color: #009999 } /* Literal.Number.Hex */\n.highlight .mi { color: #009999 } /* Literal.Number.Integer */\n.highlight .mo { color: #009999 } /* Literal.Number.Oct */\n.highlight .sb { color: #d14 } /* Literal.String.Backtick */\n.highlight .sc { color: #d14 } /* Literal.String.Char */\n.highlight .sd { color: #d14 } /* Literal.String.Doc */\n.highlight .s2 { color: #d14 } /* Literal.String.Double */\n.highlight .se { color: #d14 } /* Literal.String.Escape */\n.highlight .sh { color: #d14 } /* Literal.String.Heredoc */\n.highlight .si { color: #d14 } /* Literal.String.Interpol */\n.highlight .sx { color: #d14 } /* Literal.String.Other */\n.highlight .sr { color: #009926 } /* Literal.String.Regex */\n.highlight .s1 { color: #d14 } /* Literal.String.Single */\n.highlight .ss { color: #990073 } /* Literal.String.Symbol */\n.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */\n.highlight .vc { color: #008080 } /* Name.Variable.Class */\n.highlight .vg { color: #008080 } /* Name.Variable.Global */\n.highlight .vi { color: #008080 } /* Name.Variable.Instance */\n.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */\n\n.type-csharp .highlight .k { color: #0000FF }\n.type-csharp .highlight .kt { color: #0000FF }\n.type-csharp .highlight .nf { color: #000000; font-weight: normal }\n.type-csharp .highlight .nc { color: #2B91AF }\n.type-csharp .highlight .nn { color: #000000 }\n.type-csharp .highlight .s { color: #A31515 }\n.type-csharp .highlight .sc { color: #A31515 }\n"
  },
  {
    "path": "stylesheets/styles.css",
    "content": "@import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700);\n\nbody {\n  padding:50px;\n  font:14px/1.5 Lato, \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n  color:#777;\n  font-weight:300;\n}\n\nh1, h2, h3, h4, h5, h6 {\n  color:#222;\n  margin:0 0 20px;\n}\n\np, ul, ol, table, pre, dl {\n  margin:0 0 20px;\n}\n\nh1, h2, h3 {\n  line-height:1.1;\n}\n\nh1 {\n  font-size:28px;\n}\n\nh2 {\n  color:#393939;\n}\n\nh3, h4, h5, h6 {\n  color:#494949;\n}\n\na {\n  color:#39c;\n  font-weight:400;\n  text-decoration:none;\n}\n\na small {\n  font-size:11px;\n  color:#777;\n  margin-top:-0.6em;\n  display:block;\n}\n\n.wrapper {\n  width:860px;\n  margin:0 auto;\n}\n\nblockquote {\n  border-left:1px solid #e5e5e5;\n  margin:0;\n  padding:0 0 0 20px;\n  font-style:italic;\n}\n\ncode, pre {\n  font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal;\n  color:#333;\n  font-size:12px;\n}\n\npre {\n  padding:8px 15px;\n  background: #f8f8f8;  \n  border-radius:5px;\n  border:1px solid #e5e5e5;\n  overflow-x: auto;\n}\n\ntable {\n  width:100%;\n  border-collapse:collapse;\n}\n\nth, td {\n  text-align:left;\n  padding:5px 10px;\n  border-bottom:1px solid #e5e5e5;\n}\n\ndt {\n  color:#444;\n  font-weight:700;\n}\n\nth {\n  color:#444;\n}\n\nimg {\n  max-width:100%;\n}\n\nheader {\n  width:270px;\n  float:left;\n  position:fixed;\n}\n\nheader ul {\n  list-style:none;\n  height:40px;\n  \n  padding:0;\n  \n  background: #eee;\n  background: -moz-linear-gradient(top, #f8f8f8 0%, #dddddd 100%);\n  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#dddddd));\n  background: -webkit-linear-gradient(top, #f8f8f8 0%,#dddddd 100%);\n  background: -o-linear-gradient(top, #f8f8f8 0%,#dddddd 100%);\n  background: -ms-linear-gradient(top, #f8f8f8 0%,#dddddd 100%);\n  background: linear-gradient(top, #f8f8f8 0%,#dddddd 100%);\n  \n  border-radius:5px;\n  border:1px solid #d2d2d2;\n  box-shadow:inset #fff 0 1px 0, inset rgba(0,0,0,0.03) 0 -1px 0;\n  width:270px;\n}\n\nheader li {\n  width:89px;\n  float:left;\n  border-right:1px solid #d2d2d2;\n  height:40px;\n}\n\nheader ul a {\n  line-height:1;\n  font-size:11px;\n  color:#999;\n  display:block;\n  text-align:center;\n  padding-top:6px;\n  height:40px;\n}\n\nstrong {\n  color:#222;\n  font-weight:700;\n}\n\nheader ul li + li {\n  width:88px;\n  border-left:1px solid #fff;\n}\n\nheader ul li + li + li {\n  border-right:none;\n  width:89px;\n}\n\nheader ul a strong {\n  font-size:14px;\n  display:block;\n  color:#222;\n}\n\nsection {\n  width:500px;\n  float:right;\n  padding-bottom:50px;\n}\n\nsmall {\n  font-size:11px;\n}\n\nhr {\n  border:0;\n  background:#e5e5e5;\n  height:1px;\n  margin:0 0 20px;\n}\n\nfooter {\n  width:270px;\n  float:left;\n  position:fixed;\n  bottom:50px;\n}\n\n@media print, screen and (max-width: 960px) {\n  \n  div.wrapper {\n    width:auto;\n    margin:0;\n  }\n  \n  header, section, footer {\n    float:none;\n    position:static;\n    width:auto;\n  }\n  \n  header {\n    padding-right:320px;\n  }\n  \n  section {\n    border:1px solid #e5e5e5;\n    border-width:1px 0;\n    padding:20px 0;\n    margin:0 0 20px;\n  }\n  \n  header a small {\n    display:inline;\n  }\n  \n  header ul {\n    position:absolute;\n    right:50px;\n    top:52px;\n  }\n}\n\n@media print, screen and (max-width: 720px) {\n  body {\n    word-wrap:break-word;\n  }\n  \n  header {\n    padding:0;\n  }\n  \n  header ul, header p.view {\n    position:static;\n  }\n  \n  pre, code {\n    word-wrap:normal;\n  }\n}\n\n@media print, screen and (max-width: 480px) {\n  body {\n    padding:15px;\n  }\n  \n  header ul {\n    display:none;\n  }\n}\n\n@media print {\n  body {\n    padding:0.4in;\n    font-size:12pt;\n    color:#444;\n  }\n}\n"
  }
]