Skip to content

Commit

Permalink
Improve getting started example
Browse files Browse the repository at this point in the history
  • Loading branch information
teutat3s committed Oct 16, 2020
1 parent c78c821 commit c8bb097
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ go get github.com/blushft/go-diagrams
Create a diagram:

```golang
d, err := diagram.New(diagram.Label("my-diagram"), diagram.Filename("diagram"))
d, err := diagram.New(diagram.Label("my-diagram"), diagram.Filename("my-diagram"))
if err != nil {
log.Fatal(err)
}
Expand All @@ -78,8 +78,13 @@ if err := d.Render(); err != nil {

Go-Diagrams will create a folder in the current working directory with the graphviz DOT file and any image assets.

```sh
go build -o diagram-example .
./diagram-example
```

Create an ouput image with any graphviz compatible renderer:

```sh
dot -Tpng diagram.dot > diagram.png
dot -Tpng go-diagrams/my-diagram.dot > diagram-example.png
```

0 comments on commit c8bb097

Please sign in to comment.