SublimeIPythonNotebook icon indicating copy to clipboard operation
SublimeIPythonNotebook copied to clipboard

Question: a build system

Open sglyon opened this issue 12 years ago • 14 comments

What if we have a sublime-build that would open the ipynb in the browser and reload that browser so we can see updated markdown/code results?

sglyon avatar Oct 07 '13 18:10 sglyon

That's an interesting suggestion. I was thinking that maybe it will be even better to somehow serve ipynb file locally instead of saving it (maybe already rendered as html) and asking the browser to reload it - that way it will be faster (I am using IPython Notebook over the ssh tunnel and it takes considerable time to open some large notebooks) and there will be less chance of accidentally overwriting it. Patches are of course welcome.

maximsch2 avatar Oct 08 '13 00:10 maximsch2

So, if I understand your comment, one possible way to do this would be to write out a temporary (local) version of the notebook, use nbconvert to write static html, serve that , and then clean up the temporary ipynb and html when we are done?

sglyon avatar Oct 11 '13 19:10 sglyon

Yes, I think we can even put nbconvert into the plugin's source tree and call it directly, that way we will not depend on nbconvert being installed.

Maxim Grechkin

On Fri, Oct 11, 2013 at 12:20 PM, Spencer Lyon [email protected]:

So, if I understand your comment, one possible way to do this would be to write out a temporary local version of the notebook, use nbconvert to write static html, serve that , and then clean up the temporary ipynb and html when we are done?

— Reply to this email directly or view it on GitHubhttps://github.com/maximsch2/SublimeIPythonNotebook/issues/13#issuecomment-26164352 .

maximsch2 avatar Oct 11 '13 19:10 maximsch2

Good idea.

I'm experienced in python development, but not with sublime, so I might have some routine questions along the way. One of of which is:

Do we need to make sure that IPython (and our local nbconvert) is available to Sublime's internal python?

sglyon avatar Oct 11 '13 19:10 sglyon

Yes. I think we can just put full IPython into external folder and import it from there (we already have a small portion of it for manipulating ipython notebooks). Additional problem will be Python 2 vs Python 3: we should either have two copies of IPython for ST2 and ST3 or just drop ST2 support (probably easier way).

Maxim Grechkin

On Fri, Oct 11, 2013 at 12:29 PM, Spencer Lyon [email protected]:

Good idea.

I'm experienced in python development, but not with sublime, so I might have some routine questions along the way. One of of which is:

Do we need to make sure that IPython (and our local nbconvert) is available to Sublime's internal python?

— Reply to this email directly or view it on GitHubhttps://github.com/maximsch2/SublimeIPythonNotebook/issues/13#issuecomment-26165131 .

maximsch2 avatar Oct 11 '13 19:10 maximsch2

Sounds good.

I'd say we might as well pull in IPython 1.0+ so that it has nbconvert included. Do you have a preference for anything else?

sglyon avatar Oct 11 '13 19:10 sglyon

No, overall idea sounds fine. We might want to look at something like LiveReload to do reloading smarter later down the road, but for now that's not important.

I also think we can just consider ST2 support dropped - so you don't have to worry about it. I'll try to set up Package Control to point to the latest version supporting ST2 for legacy users.

For ST3, you will probably need to run 2to3 on ipython source code to convert it to py3k.

Maxim Grechkin

On Fri, Oct 11, 2013 at 12:52 PM, Spencer Lyon [email protected]:

Sounds good.

I'd say we might as well pull in IPython 1.0+ so that it has nbconvert included. Do you have a preference for anything else?

— Reply to this email directly or view it on GitHubhttps://github.com/maximsch2/SublimeIPythonNotebook/issues/13#issuecomment-26166992 .

maximsch2 avatar Oct 11 '13 19:10 maximsch2

Great, I'm on ST3 and everyone I know that uses sublime is also on it, so I think that should be fine.

I believe that IPython supports python 3.X, you would just need to call ipython3 from the command line instead of ipython.

Do you still see a need to run 2to3 on it?

sglyon avatar Oct 11 '13 20:10 sglyon

I think we used to have to run 2to3 several months ago (look at external/copy_ipython_subset.sh). Btw, we might want to keep that script and strip down IPython from stuff that we don't need to reduce package size.

Maxim Grechkin

On Fri, Oct 11, 2013 at 1:02 PM, Spencer Lyon [email protected]:

Great, I'm on ST3 and everyone I know that uses sublime is also on it, so I think that should be fine.

I believe that IPython supports python 3.X, you would just need to call ipython3 from the command line instead of ipython.

Do you still see a need to run 2to3 on it?

— Reply to this email directly or view it on GitHubhttps://github.com/maximsch2/SublimeIPythonNotebook/issues/13#issuecomment-26167788 .

maximsch2 avatar Oct 11 '13 20:10 maximsch2

I've just submitted a pull request for package_control_channel, that will split ST2 and ask Package Control to install plugin from separate branch for ST2. We are now safe to drop ST2 support in master branch. I'll push some changes soon to make it apparent.

Maxim Grechkin

On Fri, Oct 11, 2013 at 1:06 PM, Maxim Grechkin [email protected] wrote:

I think we used to have to run 2to3 several months ago (look at external/copy_ipython_subset.sh). Btw, we might want to keep that script and strip down IPython from stuff that we don't need to reduce package size.

Maxim Grechkin

On Fri, Oct 11, 2013 at 1:02 PM, Spencer Lyon [email protected]:

Great, I'm on ST3 and everyone I know that uses sublime is also on it, so I think that should be fine.

I believe that IPython supports python 3.X, you would just need to call ipython3 from the command line instead of ipython.

Do you still see a need to run 2to3 on it?

— Reply to this email directly or view it on GitHubhttps://github.com/maximsch2/SublimeIPythonNotebook/issues/13#issuecomment-26167788 .

maximsch2 avatar Oct 11 '13 20:10 maximsch2

Sounds good. If i have some time, I'll make an attempt to implement for ST3 in the next day or two

sglyon avatar Oct 11 '13 20:10 sglyon

IPython now supports both Python 2 and 3 from single codebase: http://mail.scipy.org/pipermail/ipython-dev/2013-October/012551.html. So there is no need for 2to3 conversion, making this issue a little easier.

maximsch2 avatar Nov 07 '13 23:11 maximsch2

Btw, new version of ST3 allows picture preview in separate tabs, this sounds like steps away from allowing pictures to be inserted into the document, and then we can replicate the whole IPython Notebook system

maximsch2 avatar Dec 19 '13 21:12 maximsch2

That would be awesome.

sglyon avatar Dec 20 '13 04:12 sglyon