Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop excessive data in test files #11

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions example/nbee/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
golang 1.18
18 changes: 14 additions & 4 deletions example/nbee/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,30 @@
Compile the package on the fly 🐝

```sh
go run github.com/bevzzz/nb/example/nbee
go run github.com/bevzzz/nb/example/nbee -f path/to/notebook.ipynb
```

Or, install a binary 🗑

```sh
go install github.com/bevzzz/nb/example/nbee
# Build from source:
git clone https://github.com/bevzzz/nb.git
cd nb/example/nbee
go install

# Install from remote repository (Go 1.17+):
go install github.com/bevzzz/nb/example/nbee@latest
```

Try it out:

```sh
nbee # convert the default notebook to HTML
nbee -f "my_notebook.ipynb" # convert your own notebooks
# If you already have bevzzz/nb checked out:
cd nb/testdata
nbee -f notebook.ipynb

# Convert your own notebooks
nbee -f my_jupyter.ipynb
```

## Disclaimer
Expand Down
16 changes: 8 additions & 8 deletions example/nbee/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ import (
synth "github.com/bevzzz/nb-synth"
"github.com/bevzzz/nb/extension"
"github.com/bevzzz/nb/extension/adapter"
jupyter "github.com/bevzzz/nb/extension/extra/goldmark-jupyter"
"github.com/bevzzz/nb/render"
"github.com/bevzzz/nb/render/html"
jupyter "github.com/bevzzz/nb/extension/extra/goldmark-jupyter"
"github.com/robert-nix/ansihtml"
"github.com/yuin/goldmark"
highlighting "github.com/yuin/goldmark-highlighting/v2"
)

var (
file = flag.String("f", "notebook.ipynb", "Jupyter notebook file")
file = flag.String("f", "", "Jupyter notebook file")
)

//go:embed notebook.ipynb
var defaultNotebook []byte

func main() {
flag.Parse()
var err error
if *file == "" {
log.Fatal("-f must be a valid path to notebook")
}

b := defaultNotebook
var b []byte
var err error
outFile := "notebook.html"

if f := *file; file != nil {
if f := *file; f != "" {
if b, err = os.ReadFile(f); err != nil {
log.Fatal(err)
}
Expand Down
237 changes: 0 additions & 237 deletions example/nbee/notebook.ipynb

This file was deleted.

7 changes: 2 additions & 5 deletions testdata/notebook.golden

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions testdata/notebook.ipynb

Large diffs are not rendered by default.

Loading