diff --git a/README.md b/README.md index 533a1de..eda601f 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ Screenshots can be customized with `--flags` or [Configuration](#configuration) - [`--font.file`](#font): File path to the font to use (embedded in the SVG). - [`--line-height`](#font): Line height relative to font size. - [`--show-line-numbers`](#line-numbers): Show line numbers. +- [`--copy`](#copy): Copy the output image to the clipboard. - [`--lines`](#line-numbers): Lines to capture (start,end). ### Language @@ -159,6 +160,14 @@ freeze main.go --output out.webp freeze main.go --output out.{svg,png,webp} ``` +### Copy + +Copy the output image to your clipboard, so you can paste it anywhere. + +```bash +freeze main.go --copy +``` + ### Font Specify the font family, font size, and font line height of the output image. diff --git a/configurations/full.json b/configurations/full.json index 40d5131..36f5fde 100644 --- a/configurations/full.json +++ b/configurations/full.json @@ -29,5 +29,6 @@ "size": 14, "ligatures": true }, - "line_height": 1.2 -} \ No newline at end of file + "line_height": 1.2, + "copy": false +} diff --git a/test/golden/svg/bubbletea-copy.svg b/test/golden/svg/bubbletea-copy.svg new file mode 100644 index 0000000..304e551 --- /dev/null +++ b/test/golden/svg/bubbletea-copy.svg @@ -0,0 +1,49 @@ + + + + + + 1 func (m model) Init() tea.Cmd { + 2     return nil + 3 } + 4 + 5 func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { + 6     switch msg := msg.(type) { + 7 + 8     case tea.KeyMsg: + 9         switch msg.String() { + 10         case "ctrl+c", "q": + 11             return m, tea.Quit + 12         case "up", "k": + 13             if m.cursor > 0 { + 14                 m.cursor-- + 15             } + 16         case "down", "j": + 17             if m.cursor < len(m.choices)-1 { + 18                 m.cursor++ + 19             } + 20         case "enter", " ": + 21             _, ok := m.selected[m.cursor] + 22             if ok { + 23                 delete(m.selected, m.cursor) + 24             } else { + 25                 m.selected[m.cursor] = struct{}{} + 26             } + 27         } + 28     } + 29     return m, nil + 30 } + 31 + 32 func (m model) View() string { + 33     return // ... + 34 } + + +