Render on double click
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.
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)
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
$PATHand you can then callnbview notebook.ipynbfrom 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