Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Example usage:
--listcolorschemes List color schemes
--marginsize WxH Margin size (in either pixel or font units)
--transparent Transparent background
--fillonly Remove strokes from SVG output (use fills only)
Comment thread
wader marked this conversation as resolved.
Outdated
--version, -v Show version
--width, -w NUMBER Terminal width (auto if not set)
```
Expand Down
Binary file added ansisvg
Binary file not shown.
3 changes: 3 additions & 0 deletions ansitosvg/ansisvg.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Options struct {
ColorScheme string
Transparent bool
GridMode bool
FillOnly bool
LineHeight float32
}

Expand All @@ -31,6 +32,7 @@ var DefaultOptions = Options{
MarginSize: xydim.XyDimFloat{X: 0, Y: 0},
ColorScheme: "Builtin Dark",
Transparent: false,
FillOnly: false,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gofmt seem to want to indent this false a bit to align with the rest

LineHeight: 1.0,
}

Expand Down Expand Up @@ -143,6 +145,7 @@ func Convert(r io.Reader, w io.Writer, opts Options) error {
NrLines: ad.MaxY + 1,
Lines: lines,
GridMode: opts.GridMode,
FillOnly: opts.FillOnly,
}
return s.Render(w)
}
2 changes: 2 additions & 0 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func Main(env Env) error {
var listColorSchemesFlag = fs.Bool("listcolorschemes", false, "List color schemes")
var transparentFlag = fs.Bool("transparent", ansitosvg.DefaultOptions.Transparent, "Transparent background")
var gridModeFlag = fs.Bool("grid", false, "Grid mode (sets position for each character)")
var fillOnlyFlag = fs.Bool("fillonly", false, "Remove strokes from SVG output (use fills only)")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want ansitosvg.DefaultOptions.FillOnly here

var helpFlag bool
fs.BoolVar(&helpFlag, "h", false, "")
fs.BoolVar(&helpFlag, "help", false, "Show help")
Expand Down Expand Up @@ -144,6 +145,7 @@ Example usage:
ColorScheme: *colorSchemeFlag,
Transparent: *transparentFlag,
GridMode: *gridModeFlag,
FillOnly: *fillOnlyFlag,
},
)
}
1 change: 1 addition & 0 deletions svgscreen/svgscreen.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ type Screen struct {
NrLines int
Lines []Line
GridMode bool
FillOnly bool
Dom SvgDom
}

Expand Down
12 changes: 10 additions & 2 deletions svgscreen/template.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading