Skip to content

Commit

Permalink
Updated README.md; Added /var/folders to list of temporary directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
janpfeifer committed Feb 18, 2024
1 parent bc6d62f commit f1db152
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@

* Auto-complete and contextual help while coding.
* Rich content display: HTML, markdown (with latex), images, javascript, svg, videos, etc.
* (**NEW**) Widgets (sliders, buttons) support: interact using HTML elements. Create your own widgets!
* Widgets (sliders, buttons) support: interact using HTML elements. Create your own widgets!
* [Plotly integration](https://plotly.com/javascript/), using [go-plotly](https://github.com/MetalBlueberry/go-plotly) (see example in [tutorial](examples/tutorial.ipynb))
* Uses standard Go compiler: 100% compatibility with projects, even those using CGO.
It also supports arbitrary Go compilation flags to be used when executing the cells.
* Faster execution than interpreted Go, used in other similar kernels -- at the cost of imperceptible increased
start up, since each cell is compiled.
* Run cell's `Test*` and `Benchmark*` functions with `go test`, simply adding `%test` to cell.
* Compile and execute the Go code as WASM: allows one to do interactive widgets in notebooks. See `%wasm` (EXPERIMENTAL).
* Support for `go.mod` and `go.work`, to allow local development. Including importing specific versions of libraries.
* Shell command executions with `!` -- handy at times, for instance to install packages.
* Reported to work with Github Codespace, VSCode, Binder, Google's Colab, etc.
* Very well documented and supported.
* Great for data-science, testing, writing reports, live demos, etc.
* Includes a [pre-built docker](https://hub.docker.com/r/janpfeifer/gonb_jupyterlab), that includes JupyterLab and GoNB, that can be used to easily try it out. Alternatively, there is a [Google's Colab](https://colab.research.google.com/drive/1vUd3SSoOm2K6UQLnkJQursZZx4CaIT_1?usp=sharing), that bootstraps **GoNB** and can be used online.
* Online help and much more, see `%help`.
* Compile and execute the Go code as WASM: allows one to do interactive widgets in notebooks. See `%wasm` (EXPERIMENTAL).

## Examples:

Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Updated gopls dependencies: new jsonrpc2 API.
* Added `LoadScriptModuleAndRun`.
* Added [Plotly Javascript](https://plotly.com/javascript/) support, in `gonbui.plotly` package. Also added example in tutorial.
* During installation, consider `/var/folders` also a temporary directory.

## 0.9.5, 2024/01/10

Expand Down
6 changes: 4 additions & 2 deletions internal/kernel/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ func Install(extraArgs []string, forceDeps, forceCopy bool) error {
return errors.WithMessagef(err, "failed to create configuration directory %q", kernelDir)
}

// If binary is in /tmp, then presumably it is a temporary compilation of Go binary,
// If binary is in `/tmp` or `/var/folders`, then presumably it is a temporary compilation of Go binary,
// and we make a copy of the binary (since it will be deleted) to the configuration
// directory -- otherwise we just point to the current binary.
if strings.HasPrefix(os.Args[0], "/tmp/") || forceCopy {
if forceCopy ||
strings.HasPrefix(os.Args[0], "/tmp/") ||
strings.HasPrefix(os.Args[0], "/var/folders") {
newBinary := path.Join(kernelDir, "gonb")
// Move the previous version out of the way.
if _, err := os.Stat(newBinary); err == nil {
Expand Down

0 comments on commit f1db152

Please sign in to comment.