commit
9e65f72952
3 changed files with 8 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#### Improvements 🧹
|
||||
|
||||
- `--browser` flag on CLI controls `BROWSER` environment variable for not opening browser in watch mode. [#1052](https://github.com/terrastruct/d2/pull/1052)
|
||||
- `elk` layout containers no longer overlap the label with children. [#1055](https://github.com/terrastruct/d2/pull/1055)
|
||||
- `<title>` attribute of HTML in watch mode is the base file name, instead of the whole path. [#1054](https://github.com/terrastruct/d2/pull/1054)
|
||||
|
||||
|
|
|
|||
|
|
@ -83,6 +83,9 @@ Center the SVG in the containing viewbox, such as your browser screen
|
|||
.It Fl -pad Ar 100
|
||||
Pixels padded around the rendered diagram
|
||||
.Ns .
|
||||
.It Fl -browser Ar true
|
||||
Browser executable that watch opens. Setting to 0 opens no browser
|
||||
.Ns .
|
||||
.It Fl l , -layout Ar dagre
|
||||
Set the diagram layout engine to the passed string. For a list of available options, run
|
||||
.Ar layout
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ func Run(ctx context.Context, ms *xmain.State) (err error) {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
browserFlag := ms.Opts.String("BROWSER", "browser", "", "", "browser executable that watch opens. Setting to 0 opens no browser.")
|
||||
centerFlag, err := ms.Opts.Bool("D2_CENTER", "center", "c", false, "center the SVG in the containing viewbox, such as your browser screen")
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -130,6 +131,9 @@ func Run(ctx context.Context, ms *xmain.State) (err error) {
|
|||
if *debugFlag {
|
||||
ms.Env.Setenv("DEBUG", "1")
|
||||
}
|
||||
if *browserFlag != "" {
|
||||
ms.Env.Setenv("BROWSER", *browserFlag)
|
||||
}
|
||||
|
||||
var inputPath string
|
||||
var outputPath string
|
||||
|
|
|
|||
Loading…
Reference in a new issue