Commit graph

256 commits

Author SHA1 Message Date
John Miller
64eb1b1e5b Cleaner indenting, run before-save-hook hooks before saving.
Some users have seen problems indenting Python code in codecells; this may be
due to having `indent-tabs-mode` set to a non-nil value. I now force it to be
nil in all ein notebook/worksheet buffers.

Also before saving a notebook hooks defined in `before-save-hook` are run.
2016-12-12 10:26:38 -06:00
John Miller
87053c7459 Formatting, tweaks to menu and an improved error message.
Adding a couple commands to EIN's menu and an attempt to make cell execution
message more informative.
2016-11-23 12:34:06 -06:00
John Miller
7978961d96 Save a copy of the notebook, fix deleting notebooks.
Can save a copy of an existing notebook to a new name via
`ein:notebook-save-to-command` (I still haven't thought of a good,
default keybinding, however).

Deleting notebooks now works again.
2016-11-10 21:31:38 -06:00
John Miller
c70dee7733 Taceback from cell edit buffer, more informative version
Jump to tracebacks from cell edit buffers.

Slightly more informative on version of jupyter we are working with.
2016-11-05 17:49:52 -05:00
John Miller
1c04701a90 Only autosave if the buffer has been modified. 2016-10-28 14:54:07 -05:00
John Miller
fb1fd315a6 Anaconda-mode workaround, building for a multi-language kernel
Small hack to allow python mode source editing popout buffers (ala C-c')
work with anaconda-mode.

Do major mode selection based on language specified in kernelspec, this
should allow better support when using ein with kernels other than python.
2016-10-28 14:13:32 -05:00
John Miller
c0144e2cbf Edit notebook cells in popout buffer ala org-mode
Using C-c', users can create a temporary buffer running an appropriate
mode to edit the contents of a notebook cell. This functionality is
intentionally very similar to what org-mode provides for editing blocks
of code or other.
2016-10-25 18:00:51 -05:00
John Miller
dd494cba59 Less talkative notebook saving.
EIN now logs messages regarding notebook saving using 'verbose level.
2016-10-23 19:26:21 -05:00
John Miller
701ddbe39c Autosaving and checkpoints as distinct actions.
Saving a notebook and creating a checkpoint are related, but distinct
activities. EIN does better now with this distinction. See updates to
the documentaiton (which should get pushed to github any day now).
2016-10-21 12:10:49 -05:00
John Miller
c7bf4f6521 Update docs, get scoping right for notebook checkpoint calls
Document the new checkpoint functions. Fix issue that was preventing
the list of checkpoints from being updated in the notebook.
2016-10-20 11:14:23 -05:00
John Miller
bb95f71f5e Give ein notebooks content checkpoint functionality. 2016-10-19 14:43:19 -05:00
John Miller
9ca012d1c2 Better notification header.
Interactivity! Click to switch kernels.

Also fixed an embarassing typo...
2016-08-31 09:37:58 -05:00
John Miller
e49fe22774 Bug fix, better info on running kernel.
Fixed bug with `ein:notebook-open-in-browser`; this command should now
work in IPython notebook 3.0 and later.

Notebook/worksheets now display the name of the kernel that the notebook
is running under. Next step is to make this clickable!

Also some documentation for my new super-secret project to add
evaluation of dynamic javascript to ein.
2016-08-31 09:13:25 -05:00
John Miller
5043ba9bb6 A little bit of documentation, add to menu
Document the new interactive function `ein:notebook-switch-kernel`
and add it to the menu. Not sure yet if it is worth giving a default
keybinding.
2016-08-28 20:56:00 -05:00
John Miller
586879598a Switch kernel in running notebook.
Does so by changing kernelspec and restarting notebook.
2016-08-26 20:52:54 -05:00
John Miller
3e1baa0657 Toggle viewing of slide metadata in worksheet.
Let the user control whether or not to view slide attributes in current
worksheet via `ein:worksheet-toggle-slideshow-view` (C-c S).

Also added a couple more slide attributes (fragment, notes) as
these appear to be support in current Jupyter version.
2016-07-20 12:50:04 -05:00
Guillaume Anciaux
62c0c21d28
cleaning some debug messages 2016-07-19 10:46:50 +02:00
Guillaume Anciaux
1c549e72d7
addîng the slide info in prompt and allow switch slide type with C-c C-d 2016-07-19 10:37:00 +02:00
John Miller
71ee42a803 Load secure cookies when using secure connection.
Secure connections (i.e. wss, https) store cookies in a secure jar,
websocket connections now take this into account when connecting
using wss protocol.
2016-04-08 21:22:14 -05:00
John Miller
bd9668702a Fix for issue #92
Use lexical-let vs let in `ein:notebooklist-render.`
2016-03-23 12:31:47 -05:00
John Miller
a752e45772 Undo buffer-file-name madness.
No longer set buffer-file-name for ein:notebook buffers. This was
causing unexpected and potentially disastrous (as in data corruption)
behavior.

Some updates to travis configuration and testing. Still a long ways
from having that working, though.
2016-03-03 08:31:05 -06:00
John Miller
c5cf44a795 Fix saving new notebooks, whitespace updates.
Newly created notebooks no longer error on saving - bug in how
kernelspec metadata was being filled in.

Also a number of miscellaneous fixes to indentation that have
inexplicably appeared in the code.

Some small fixes for typos and catching up on version info.
2016-03-01 16:02:00 -06:00
John Miller
6facffd586 Be even more respectful of kernelspec data. 2016-01-13 18:24:59 -06:00
John Miller
5dec56eec2 Respect kernelspec info in notebook metadata.
This should allow us to reload notebooks using the same
kernel they were running when saved.
2016-01-13 18:07:15 -06:00
John Miller
a89aa6aebd Including kernelspecs into the notebooklist view.
EIN now shows kernels available for the Jupyter server being view in the
notebooklist buffer. We don't do much with the info, yet, though.
2016-01-13 07:52:02 -06:00
John Miller
25d1437de6 Ask for kernel when creating named notebook.
We don't do anything with the info, yet, but it is a good
test for our code for getting available kernels from the Jupyter
server.
2016-01-11 20:21:19 -07:00
John Miller
4f382f7312 Merge branch 'master' into kernelspecs 2016-01-11 15:40:08 -07:00
John Miller
1987f601c7 Fix event firing for content save errors.
Code wasn't calling `ein:notebook-save-notebook-error` when content
saving failed. Small detail, but would result in "Notebook saving"
eternally hanging out in notebook message display.
2016-01-11 15:11:14 -07:00
John Miller
447854fdac Query Jupyter for kernelspecs
Structures and logic for querying Jupyter server for a list of available
kernelspecs.
2016-01-11 09:20:40 -07:00
John Miller
a4ab2a52f5 Simplifying and fixing code for saving notebooks
Code for generating v4 notebook json much cleaner and easier to
understand. As added bonus have fix for saving images.
2015-12-22 12:32:21 -06:00
John Miller
b8aa391b31 Fix ein:make-content-hierarchy.
In the end so ein:notebooklist-open-notebook-global can work.
2015-12-04 14:15:41 -06:00
John Miller
488bb67f09 Add kernel reconnect command, fix restart.
New commend `ein:notebook-reconnect-kernel` which will close then reopen
the websocket connection to a running kernel - without killing the
kernel.

Was not correctly killing and restarting the kernel in
`ein:kernel-restart.`

Fixed `ein-restart-kernel` to use REST API to kill kernel, then
restart/reconnect, again using the REST API.

Got rid of the `ein:kernel-stop` function. Seems confusing to have
'stop' and 'kill' methods running around.
2015-07-05 22:27:52 -05:00
John Miller
68dcef083f Deprecate ein:notebook-set-buffer-file-name, update docs. 2015-05-16 07:46:47 -05:00
John Miller
a4c6892551 Support set-buffer-file-name
In support of fixing issues #46 and #47.
2015-05-15 23:23:56 -05:00
John Miller
8e72876ae8 Fix for worksheet tag, clean up some comments. 2015-05-15 18:28:13 -05:00
John Miller
5886498684 Add worksheet tags to nbformat 4 notebooks
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.
2015-05-14 09:39:47 -05:00
John Miller
fe4950cbb7 Correctly start sessions in ipython 3.x
Now start sessions correctly (I think) in IPython 3.x, but somehow this
seems to break IPython 2.x.
2015-05-04 22:59:18 -05:00
John Miller
2eeae04a03 Fix issue #35
Get ein:junk-new working again under IPython 2.x.

Some non-related work on fixing `ein:pytools-export-buffer`. Not quite
there yet, but I have an idea of what is going on.
2015-03-25 09:52:16 -05:00
John Miller
9774ab910f Fixing misnamed variable. 2015-02-16 21:54:21 -06:00
John Miller
c1ce100f31 Renaming notebooks works again in IPython 2.x
As an added bonus you should be able to move notebooks to different
directories in the notebook hierarchy. Not tested, though, so I'm not
sure how well that works.
2015-02-16 21:14:47 -06:00
John Miller
ff415f3ebc Unbreaking ein:notebook-rename-command 2015-02-16 13:06:35 -06:00
John Miller
098dddd3e9 Regain IPython 2.x compatibility I
Notebooks now save in IPython 2.x and 3.x.
2015-02-12 08:45:29 -06:00
John Miller
f71676ac88 Refactoring notebook management
Work in progress.

Lots and lots of changes trying to clean up code so there are not so
many checks of IPython version. Also a significant amount of refactoring
all notebook server requests code to ein-contents-api.

Also moving away from notebook-id concept; instead use notebook path to
uniquely identify notebooks/content.

Made `ein:query-ipython-version` more efficient by caching results.
2015-02-10 14:53:08 -06:00
millejoh
84f478aed6 Improving ipython 3 support in testein.py. Lots of fixes for notebook tests to
properly test nbformat 3 notebooks.
2015-02-02 13:20:24 -06:00
John Miller
9637ea7317 Fix null metadata
ein was incorrectly writing empty metadata as a Null object, which was
causing errors in ipython.

Added a helper function to write json encoding of a notebook to a
temporary buffer to help debug code for encoding nbformat4 json from
cell data.
2015-01-09 10:00:22 -06:00
John Miller
5b84bf8874 Fix extraneous notebok-path argument
Had two arguments for notebook-path in various function signatures.
2014-12-04 12:01:33 -06:00
John Miller
9182acc258 NBFormat v4 Tweaks, fixing rename-notebook
Renaming notebooks should work a bit better now, tweaked code for saving
nbformat v4 to correctly include execution_count parameter even if cell
has not been executed.

Cleaned up some silliness in ein:query-singleton-ajax.
2014-11-11 11:33:14 -06:00
John Miller
5112873f7c Bug in saved v4 notebook format
Wasn't generating correct format for output elements in code_cells.
2014-11-10 09:36:44 -06:00
John Miller
849adda708 Support for nbformat v4
BEWARE! This is a large commit and the code here is still mostly
untested. Back up your notebooks before giving this changeset a try with
the current IPython-dev version.

Given that, ein is now able to open and save basic notebooks saved in
nbformat 4. Still haven't tested more complex notebooks with embedded
images.
2014-11-07 19:28:09 -06:00
John Miller
f39c57a633 Directory bugfix. First steps in IPython 3.0 support.
Fixed bug in accessing directories a depths greater than 1 level.

Some initial support for IPython 3.0 and IPEP 27. Can open notebooklists
and notebooks, but having some issues connecting to websocket.
2014-10-17 16:44:04 -05:00