feat(office): add Workspace TUI with shared bootstrap and test suite
Introduce the office Bubble Tea browser (module tree, multi-select lists, markdown preview) alongside oo, with cmd/internal/bootstrap for shared auth, unit tests across preview/model/ui/fetch, CI build for both binaries, and GoReleaser archives for office. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package preview
|
||||
|
||||
import (
|
||||
"github.com/charmbracelet/glamour"
|
||||
)
|
||||
|
||||
// RenderMarkdown renders GitHub-flavoured markdown for terminal display.
|
||||
func RenderMarkdown(md string, width int) (string, error) {
|
||||
if md == "" {
|
||||
return "", nil
|
||||
}
|
||||
if width < 20 {
|
||||
width = 20
|
||||
}
|
||||
r, err := glamour.NewTermRenderer(
|
||||
glamour.WithAutoStyle(),
|
||||
glamour.WithWordWrap(width),
|
||||
)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return r.Render(md)
|
||||
}
|
||||
Reference in New Issue
Block a user