diff --git a/Dockerfile b/Dockerfile index 58ff87d..0efc883 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,7 @@ RUN wget --quiet --output-document=- "https://go.dev/dl/go${GO_VERSION}.linux-am && go version # Install GoNB (https://github.com/janpfeifer/gonb) in the user account -ARG GONB_VERSION="v0.10.4" +ARG GONB_VERSION="v0.10.5" USER $NB_USER WORKDIR ${HOME} RUN export GOPROXY=direct && \ diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 734821c..fcc526f 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,9 @@ # GoNB Changelog +## v0.10.5, Added SendAsDownload + +* Added `dom.SendAsDownload` to send data from cells to the client by triggering a browser download. #134 + ## v0.10.4, Fixed #131 * Issue #131: proper handling of tuple variable declarations like `var contents, _ = os.ReadFile(...)` diff --git a/docs/coverage.txt b/docs/coverage.txt index 5123801..348853f 100644 --- a/docs/coverage.txt +++ b/docs/coverage.txt @@ -26,7 +26,7 @@ github.com/janpfeifer/gonb/cache/cache.go *Storage.Reset 75.0% github.com/janpfeifer/gonb/cache/cache.go Reset 0.0% github.com/janpfeifer/gonb/cache/cache.go CacheWith 91.7% github.com/janpfeifer/gonb/cache/cache.go Cache 0.0% -github.com/janpfeifer/gonb/cmd/nbexec/nbexec.go main 72.2% +github.com/janpfeifer/gonb/cmd/nbexec/nbexec.go main 74.3% github.com/janpfeifer/gonb/cmd/nbexec/nbexec.go startJupyterNotebook 73.2% github.com/janpfeifer/gonb/cmd/nbexec/nbexec.go executeNotebook 78.6% github.com/janpfeifer/gonb/cmd/nbexec/nbexec.go checkForInputBoxes 95.7% @@ -59,8 +59,8 @@ github.com/janpfeifer/gonb/common/common.go *ArrayFlag.String 66.7% github.com/janpfeifer/gonb/common/common.go *ArrayFlag.Set 0.0% github.com/janpfeifer/gonb/gonbui/gonbui.go init 100.0% github.com/janpfeifer/gonb/gonbui/gonbui.go Logf 50.0% -github.com/janpfeifer/gonb/gonbui/gonbui.go Error 100.0% -github.com/janpfeifer/gonb/gonbui/gonbui.go Open 100.0% +github.com/janpfeifer/gonb/gonbui/gonbui.go Error 100.0% +github.com/janpfeifer/gonb/gonbui/gonbui.go Open 100.0% github.com/janpfeifer/gonb/gonbui/gonbui.go openLocked 67.7% github.com/janpfeifer/gonb/gonbui/gonbui.go closePipesLocked 0.0% github.com/janpfeifer/gonb/gonbui/gonbui.go SendData 54.5% @@ -107,6 +107,7 @@ github.com/janpfeifer/gonb/gonbui/dom/dom.go SetInnerText 100.0% github.com/janpfeifer/gonb/gonbui/dom/dom.go GetInnerHtml 83.3% github.com/janpfeifer/gonb/gonbui/dom/dom.go Remove 100.0% github.com/janpfeifer/gonb/gonbui/dom/dom.go Persist 66.7% +github.com/janpfeifer/gonb/gonbui/dom/download.go SendAsDownload 0.0% github.com/janpfeifer/gonb/gonbui/dom/script.go LoadScriptModuleAndRun 0.0% github.com/janpfeifer/gonb/gonbui/dom/script.go LoadScriptOrRequireJSModuleAndRun 0.0% github.com/janpfeifer/gonb/gonbui/dom/script.go LoadScriptOrRequireJSModuleAndRunTransient 0.0% @@ -180,7 +181,7 @@ github.com/janpfeifer/gonb/internal/goexec/composer.go *WriterWithCursor.Error github.com/janpfeifer/gonb/internal/goexec/composer.go *WriterWithCursor.Writef 75.0% github.com/janpfeifer/gonb/internal/goexec/composer.go *WriterWithCursor.Write 76.9% github.com/janpfeifer/gonb/internal/goexec/composer.go *Declarations.RenderImports 100.0% -github.com/janpfeifer/gonb/internal/goexec/composer.go *Declarations.RenderVariables 92.0% +github.com/janpfeifer/gonb/internal/goexec/composer.go *Declarations.RenderVariables 91.2% github.com/janpfeifer/gonb/internal/goexec/composer.go *Declarations.RenderFunctions 100.0% github.com/janpfeifer/gonb/internal/goexec/composer.go *Declarations.RenderTypes 100.0% github.com/janpfeifer/gonb/internal/goexec/composer.go *Declarations.RenderConstants 100.0% @@ -215,6 +216,7 @@ github.com/janpfeifer/gonb/internal/goexec/goexec.go NewDeclarations 100.0 github.com/janpfeifer/gonb/internal/goexec/goexec.go *Declarations.Copy 100.0% github.com/janpfeifer/gonb/internal/goexec/goexec.go *Declarations.MergeFrom 100.0% github.com/janpfeifer/gonb/internal/goexec/goexec.go copyMap 100.0% +github.com/janpfeifer/gonb/internal/goexec/goexec.go variablesCopyFrom 100.0% github.com/janpfeifer/gonb/internal/goexec/goexec.go *Declarations.ClearCursor 100.0% github.com/janpfeifer/gonb/internal/goexec/goexec.go clearCursor 100.0% github.com/janpfeifer/gonb/internal/goexec/goexec.go *Declarations.DropFuncInit 100.0% @@ -248,7 +250,7 @@ github.com/janpfeifer/gonb/internal/goexec/parser.go *State.parseFromGoCode github.com/janpfeifer/gonb/internal/goexec/parser.go NewImport 88.9% github.com/janpfeifer/gonb/internal/goexec/parser.go *parseInfo.ParseImportEntry 100.0% github.com/janpfeifer/gonb/internal/goexec/parser.go *parseInfo.ParseFuncEntry 100.0% -github.com/janpfeifer/gonb/internal/goexec/parser.go *parseInfo.ParseVarEntry 81.2% +github.com/janpfeifer/gonb/internal/goexec/parser.go *parseInfo.ParseVarEntry 84.6% github.com/janpfeifer/gonb/internal/goexec/parser.go *parseInfo.ParseConstEntry 100.0% github.com/janpfeifer/gonb/internal/goexec/parser.go *parseInfo.ParseTypeEntry 100.0% github.com/janpfeifer/gonb/internal/goexec/parser.go *State.parseLinesAndComposeMain 74.3% @@ -404,7 +406,7 @@ github.com/janpfeifer/gonb/internal/specialcmd/definitions.go resetDefinitions github.com/janpfeifer/gonb/internal/specialcmd/definitions.go displayEnumeration 90.9% github.com/janpfeifer/gonb/internal/specialcmd/definitions.go listDefinitions 100.0% github.com/janpfeifer/gonb/internal/specialcmd/definitions.go removeDefinitionImpl 87.5% -github.com/janpfeifer/gonb/internal/specialcmd/definitions.go removeDefinitions 75.0% +github.com/janpfeifer/gonb/internal/specialcmd/definitions.go removeDefinitions 91.7% github.com/janpfeifer/gonb/internal/specialcmd/specialcmd.go Parse 84.6% github.com/janpfeifer/gonb/internal/specialcmd/specialcmd.go joinLine 87.5% github.com/janpfeifer/gonb/internal/specialcmd/specialcmd.go execSpecialConfig 55.3% @@ -414,4 +416,4 @@ github.com/janpfeifer/gonb/internal/specialcmd/track.go execTrack 27.3% github.com/janpfeifer/gonb/internal/specialcmd/track.go execUntrack 54.5% github.com/janpfeifer/gonb/internal/specialcmd/track.go showTrackedList 91.7% github.com/janpfeifer/gonb/internal/websocket/websocket.go Javascript 83.3% -total (statements) 64.3% +total (statements) 64.4% diff --git a/examples/tests/bash_script.ipynb b/examples/tests/bash_script.ipynb index 55cf0dd..94b9c3f 100644 --- a/examples/tests/bash_script.ipynb +++ b/examples/tests/bash_script.ipynb @@ -34,7 +34,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "/tmp/gonb_43bd76c8\n" + "/tmp/gonb_b9edd581\n" ] } ], @@ -59,7 +59,7 @@ "output_type": "stream", "text": [ "/home/janpf/Projects/gonb/examples/tests\n", - "/tmp/gonb_43bd76c8\n", + "/tmp/gonb_b9edd581\n", "/home/janpf/Projects/gonb\n", "/home/janpf/Projects/gonb\n" ] @@ -86,7 +86,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.23.0" + "version": "go1.23.2" } }, "nbformat": 4, diff --git a/examples/tests/comms.ipynb b/examples/tests/comms.ipynb index c214f4d..66573ae 100644 --- a/examples/tests/comms.ipynb +++ b/examples/tests/comms.ipynb @@ -308,7 +308,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.23.0" + "version": "go1.23.2" } }, "nbformat": 4, diff --git a/examples/tests/dom.ipynb b/examples/tests/dom.ipynb index e52f564..4f8b32a 100644 --- a/examples/tests/dom.ipynb +++ b/examples/tests/dom.ipynb @@ -88,7 +88,7 @@ { "data": { "text/html": [ - "
" + "" ] }, "metadata": {}, @@ -152,7 +152,7 @@ { "data": { "text/html": [ - "" + "" ] }, "metadata": {}, @@ -197,7 +197,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.23.0" + "version": "go1.23.2" } }, "nbformat": 4, diff --git a/examples/tests/functions.ipynb b/examples/tests/functions.ipynb index 40c3f0d..35bf299 100644 --- a/examples/tests/functions.ipynb +++ b/examples/tests/functions.ipynb @@ -65,7 +65,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.23.0" + "version": "go1.23.2" } }, "nbformat": 4, diff --git a/examples/tests/goflags.ipynb b/examples/tests/goflags.ipynb index d2f12a1..f9a8334 100644 --- a/examples/tests/goflags.ipynb +++ b/examples/tests/goflags.ipynb @@ -153,9 +153,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "gonb_d53941d6/main.go:8:\tA\t\t100.0%\n", - "gonb_d53941d6/main.go:12:\tB\t\t0.0%\n", - "gonb_d53941d6/main.go:17:\tmain\t\t100.0%\n", + "gonb_0cdc700f/main.go:8:\tA\t\t100.0%\n", + "gonb_0cdc700f/main.go:12:\tB\t\t0.0%\n", + "gonb_0cdc700f/main.go:17:\tmain\t\t100.0%\n", "total\t\t\t\t(statements)\t75.0%\n" ] } @@ -238,7 +238,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "# gonb_d53941d6\n", + "# gonb_0cdc700f\n", "./main.go:10:6: can inline (*Point).ManhattanLen\n", "./main.go:16:12: inlining call to flag.Parse\n", "./main.go:18:27: inlining call to (*Point).ManhattanLen\n", @@ -267,7 +267,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.23.0" + "version": "go1.23.2" } }, "nbformat": 4, diff --git a/examples/tests/gonbui.ipynb b/examples/tests/gonbui.ipynb index 53c9d05..9a35591 100644 --- a/examples/tests/gonbui.ipynb +++ b/examples/tests/gonbui.ipynb @@ -22,7 +22,7 @@ "output_type": "stream", "text": [ "%goflags=[\"--cover\" \"--covermode=set\"]\n", - "GOCOVERDIR=/tmp/gonb_test_coverage.eLusFuePYS\n" + "GOCOVERDIR=/tmp/gonb_test_coverage.fmW2jDEhWf\n" ] } ], @@ -133,7 +133,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.23.0" + "version": "go1.23.2" } }, "nbformat": 4, diff --git a/examples/tests/gotest.ipynb b/examples/tests/gotest.ipynb index 4815d98..a3447a6 100644 --- a/examples/tests/gotest.ipynb +++ b/examples/tests/gotest.ipynb @@ -287,12 +287,12 @@ "text": [ "goos: linux\n", "goarch: amd64\n", - "pkg: gonb_103d9b0e\n", + "pkg: gonb_a1453c14\n", "cpu: 12th Gen Intel(R) Core(TM) i9-12900K\n", "BenchmarkFibonacciA32\n", - "BenchmarkFibonacciA32-24 \t 182\t 6454740 ns/op\n", + "BenchmarkFibonacciA32-24 \t 169\t 7058908 ns/op\n", "BenchmarkFibonacciB32\n", - "BenchmarkFibonacciB32-24 \t130921929\t 9.613 ns/op\n", + "BenchmarkFibonacciB32-24 \t285643864\t 3.680 ns/op\n", "PASS\n", "coverage: [no statements]\n" ] @@ -334,10 +334,10 @@ "text": [ "goos: linux\n", "goarch: amd64\n", - "pkg: gonb_103d9b0e\n", + "pkg: gonb_a1453c14\n", "cpu: 12th Gen Intel(R) Core(TM) i9-12900K\n", - "BenchmarkFibonacciA32-24 \t 171\t 6435921 ns/op\n", - "BenchmarkFibonacciB32-24 \t121723155\t 9.476 ns/op\n", + "BenchmarkFibonacciA32-24 \t 168\t 7082427 ns/op\n", + "BenchmarkFibonacciB32-24 \t308541147\t 3.901 ns/op\n", "PASS\n", "coverage: [no statements]\n" ] @@ -361,7 +361,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.23.0" + "version": "go1.23.2" } }, "nbformat": 4, diff --git a/examples/tests/gowork.ipynb b/examples/tests/gowork.ipynb index 558f8e7..88d5e99 100644 --- a/examples/tests/gowork.ipynb +++ b/examples/tests/gowork.ipynb @@ -36,7 +36,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "/tmp/gonb_tests_gowork_D4ZtmNON" + "/tmp/gonb_tests_gowork_IBSuBo7n" ] } ], @@ -64,7 +64,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Temporary test package: /tmp/gonb_tests_gowork_D4ZtmNON\n" + "Temporary test package: /tmp/gonb_tests_gowork_IBSuBo7n\n" ] } ], @@ -136,7 +136,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "\t- Added replace rule for module \"a.com/a/pkg\" to local directory \"/tmp/gonb_tests_gowork_D4ZtmNON\".\n" + "\t- Added replace rule for module \"a.com/a/pkg\" to local directory \"/tmp/gonb_tests_gowork_IBSuBo7n\".\n" ] } ], @@ -155,9 +155,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "module gonb_b0524c9c\n", + "module gonb_05a80086\n", "\n", - "go 1.23.0\n", + "go 1.23.2\n", "\n", "replace a.com/a/pkg => TMP_PKG\n" ] @@ -186,7 +186,7 @@ "text/html": [ "List of files/directories being tracked:\n", "_~154179
_~653277
a
c