mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 01:21:38 -05:00

NBformat 4 has a tag key in the cell metadata. We use it to tag a cell depending on which worksheet it is in. For now the code does nothing else with this tag, but the goal is to reimplement multiple worksheets in ein.
175 lines
3.1 KiB
Text
175 lines
3.1 KiB
Text
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {
|
|
"collapsed": true,
|
|
"tags": [
|
|
"worksheet-0"
|
|
]
|
|
},
|
|
"source": [
|
|
"# Adding Imenu Support"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {
|
|
"collapsed": true,
|
|
"tags": [
|
|
"worksheet-0"
|
|
]
|
|
},
|
|
"source": [
|
|
"## Subheader"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {
|
|
"collapsed": true,
|
|
"tags": [
|
|
"worksheet-0"
|
|
]
|
|
},
|
|
"source": [
|
|
"Seems to be a couple ways of doing this:\n",
|
|
"\n",
|
|
"1. Configuring a [imenu-generic-expression](http://emacswiki.org/emacs/ImenuMode#toc12) regex's.\n",
|
|
"\n",
|
|
"2. Redifining imenu-create-index ala python.el.\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {
|
|
"collapsed": false,
|
|
"tags": [
|
|
"worksheet-0"
|
|
]
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"def func():\n",
|
|
" pass\n",
|
|
"\n",
|
|
"\n",
|
|
"class my_class(object):\n",
|
|
" def __init__(self):\n",
|
|
" pass\n",
|
|
"\n",
|
|
" def funcme(arg1):\n",
|
|
" pass\n",
|
|
"\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {
|
|
"collapsed": true,
|
|
"tags": [
|
|
"worksheet-0"
|
|
]
|
|
},
|
|
"source": [
|
|
"# Another Header"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {
|
|
"collapsed": false,
|
|
"tags": [
|
|
"worksheet-0"
|
|
]
|
|
},
|
|
"outputs": [
|
|
{
|
|
"ename": "ZeroDivisionError",
|
|
"evalue": "division by zero",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
|
|
"\u001b[1;32m<ipython-input-4-05c9758a9c21>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;36m1\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
|
|
"\u001b[1;31mZeroDivisionError\u001b[0m: division by zero"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"1/0"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"metadata": {
|
|
"collapsed": false,
|
|
"tags": [
|
|
"worksheet-0"
|
|
]
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"import inspect"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {
|
|
"collapsed": false,
|
|
"tags": [
|
|
"worksheet-0"
|
|
]
|
|
},
|
|
"outputs": [],
|
|
"source": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {
|
|
"collapsed": false,
|
|
"tags": [
|
|
"worksheet-1"
|
|
]
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"1+1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {
|
|
"collapsed": false,
|
|
"tags": [
|
|
"worksheet-1"
|
|
]
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"inspect"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {
|
|
"collapsed": false,
|
|
"tags": [
|
|
"worksheet-1"
|
|
]
|
|
},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 0
|
|
}
|