Skip to content
Draft
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
14 changes: 1 addition & 13 deletions d2cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,19 +479,6 @@ func RouterResolver(ctx context.Context, ms *xmain.State, plugins []d2plugin.Plu
}

func compile(ctx context.Context, ms *xmain.State, plugins []d2plugin.Plugin, fs fs.FS, layout *string, renderOpts d2svg.RenderOpts, fontFamily *d2fonts.FontFamily, monoFontFamily *d2fonts.FontFamily, animateInterval int64, inputPath, outputPath string, boardPath []string, noChildren, bundle, forceAppendix bool, page playwright.Page, ext exportExtension, asciiMode string) (_ []byte, written bool, _ error) {
// Use ELK layout for ascii outputs when layout is dagre or unspecified
if ext == TXT {
if layout == nil || *layout == "dagre" {
if ms.Log.Debug != nil {
prevLayout := "unspecified"
if layout != nil {
prevLayout = *layout
}
ms.Log.Debug.Printf("switching layout engine to ELK for ASCII format (was %s)", prevLayout)
}
layout = go2.Pointer("elk")
}
}

start := time.Now()
input, err := ms.ReadPath(inputPath)
Expand All @@ -508,6 +495,7 @@ func compile(ctx context.Context, ms *xmain.State, plugins []d2plugin.Plugin, fs
Ruler: ruler,
FontFamily: fontFamily,
MonoFontFamily: monoFontFamily,
ASCII: ext == TXT,
InputPath: inputPath,
LayoutResolver: LayoutResolver(ctx, ms, plugins),
Layout: layout,
Expand Down
Loading
Loading