Skip to content

Commit c9da868

Browse files
author
Jérôme Schneider
authored
Refac + Golang rewrite (#74)
1 parent 80c6f5d commit c9da868

File tree

212 files changed

+2831
-5339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+2831
-5339
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
node_modules
22
.cache
3-
/dist/*.map
3+
/dist/frontend/*.map
44
.DS_Store
5+
src/core/core
6+
dist/nbk
7+
pkged.go

.travis.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2018 Net Gusto
1+
Copyright 2020 Jérôme Schneider
22

33
Permission to use, copy, modify, and/or distribute this software for any
44
purpose with or without fee is hereby granted, provided that the above

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.PHONY: deps build install deps-frontend build-frontend embed-frontend
2+
3+
deps:
4+
go get github.com/markbates/pkger/cmd/pkger
5+
6+
embed-frontend:
7+
pkger
8+
9+
build: embed-frontend
10+
go build -o dist/nodebook .
11+
12+
install: embed-frontend
13+
go install .
14+
@echo "nodebook built and installed."
15+
16+
deps-frontend:
17+
cd src/frontend && npm i
18+
19+
build-frontend:
20+
cd src/frontend && npm run build
21+
rm -Rf dist/frontend/*.map

README.md

Lines changed: 20 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# nodebook [![Build Status](https://travis-ci.com/netgusto/nodebook.svg?branch=master)](https://travis-ci.com/netgusto/nodebook)
1+
# nodebook
22

33
Nodebook - Multi-Language REPL with Web UI + CLI code runner
44

@@ -39,35 +39,34 @@ A notebook is a folder containing an `{index|main}.{js,py,c,cpp,...}` file. The
3939

4040
If `--docker` is set on the command line, each of these environments will run inside a specific docker container.
4141

42-
Otherwise, the development environments on your local machine will be used.
42+
Otherwise, the local toolchains will be used.
4343

44-
## Install and run as package (npm)
44+
## Install from source
45+
46+
Building requires go.
4547

4648
```bash
47-
# Install
48-
$ npm i -g --production nbk
49+
$ make deps
50+
$ make install
51+
# nodebook should be available under $GOPATH/bin/nodebook or $GOBIN/nodebook
52+
```
4953

50-
# Run with Web UI
51-
$ nbk path/to/notebooks
52-
# Or
53-
$ nbk --notebooks path/to/notebooks
54+
## Run with Web UI
5455

55-
# Run on CLI
56-
$ nbkcli path/to/notebooks
57-
# Or
58-
$ nbkcli --notebooks path/to/notebooks
5956
```
57+
# With dockerized toolchains
58+
$ nodebook --docker path/to/notebooks
6059
61-
## Install and run from source
60+
# With local toolchains
61+
$ nodebook path/to/notebooks
62+
```
6263

63-
```bash
64-
# Install
65-
$ git clone https://github.com/netgusto/nodebook
66-
$ cd nodebook
67-
$ npm install --production
64+
# Run on CLI (watch and run mode)
6865

69-
# Run
70-
$ node . --notebooks path/to/notebooks
66+
```
67+
$ nodebook cli --docker path/to/notebooks
68+
# Or
69+
$ nodebook cli path/to/notebooks
7170
```
7271

7372
## Usage
@@ -88,7 +87,6 @@ The notebook's name will be the name of the folder. The notebook language is det
8887

8988
### Command line options
9089

91-
* **--notebooks**: path to notebook folders; *required*
9290
* **--docker**: Execute code in disposable docker containers instead of local system; defaults to `false`
9391

9492
**Web UI only**:
@@ -114,23 +112,3 @@ Do not run the Web UI on a port open to public traffic! Doing so would allow rem
114112

115113
By default, the server binds to `127.0.0.1`, which allows connection from the localhost only. You can override the bind address using `--bindaddress`, but do it only if you know what you're doing.
116114

117-
## Develop
118-
119-
To iterate on the code:
120-
121-
```bash
122-
$ npm install
123-
$ PARAMS="--notebooks path/to/notebooks" npm run dev
124-
```
125-
126-
To build:
127-
128-
```bash
129-
$ npm run build
130-
```
131-
132-
To test:
133-
134-
```bash
135-
$ npm test
136-
```

backlog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* recipe: markdown
2+
* organize notebooks
3+
* packages autoinstall

bin/nbk

Lines changed: 0 additions & 3 deletions
This file was deleted.

bin/nbkcli

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/frontend/frontend.2e82defb.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)