nbviewer.js icon indicating copy to clipboard operation
nbviewer.js copied to clipboard

Render on double click

Open kokes opened this issue 9 years ago • 2 comments

There have been multiple requests to support rendering the file upon a double click.

An initial implementation is in /cmd/, it's a Go file that embeds all the necessary JS/HTML/CSS, saves it to a temporary folder, alongside the clicked file. Then opens the browser.

kokes avatar Aug 12 '16 16:08 kokes

The binary implementation works (in cmd) by embedding the static files, copying them over to a temp directory, that's all good (apart from the fact that the static files aren't autogenerated), it's just mildly annoying that on Windows, a cmd.exe window opens up upon launch.

I tried go build -ldflags "-H windowsgui" nbview.go as suggested elsewhere, but it didn't seem to do the trick (Go 1.7, Windows 10).

(Edit: Sigh, the window is obviously the one opened by os.Exec, where we explicitly call cmd)

kokes avatar Aug 19 '16 09:08 kokes

Right, so:

  • the Windows version works just fine (except for the annoying popup, we can't do much about that).
  • the Linux version just needs to be copied to a folder in your $PATH and you can then call nbview notebook.ipynb from the terminal, or, if in a GUI, you'd need to register it somehow (how exactly?)
  • I packaged the Mac version into a folder as one should, but I can't get any files opened with it to be passed on to os.Args, I don't know if one has to explicitly allow this or what

kokes avatar Nov 21 '16 13:11 kokes