-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Labels
Description
Objective
Add --format=markdown flag support to enable markdown table output using lipgloss.MarkdownBorder() for better integration with documentation workflows.
Context
From discussion #12479 - Go Fan review of charmbracelet/lipgloss usage.
Markdown table output would enable easy integration with GitHub issues, documentation, and reports. This leverages the new MarkdownBorder() feature in lipgloss v1.1.0.
Approach
- Add
--formatflag to relevant CLI commands (or global flag) - Create
RenderTableAsMarkdown()helper function inpkg/console/console.go - Update table rendering logic to check format flag
- Use
lipgloss.MarkdownBorder()with appropriate options - Add tests for markdown output
Files to Modify
pkg/cli/flags.go- Add--formatflag definitionpkg/console/console.go- Add markdown rendering function- Update relevant CLI commands to support
--format=markdown - Add tests for markdown table output
Example
func RenderTableAsMarkdown(config TableConfig) string {
t := table.New().
Headers(config.Headers...).
Rows(config.Rows...).
Border(lipgloss.MarkdownBorder()).
BorderTop(false).
BorderBottom(false).
Wrap(false)
return t.String()
}Acceptance Criteria
-
--format=markdownflag available on appropriate commands - Markdown tables render correctly with proper formatting
- Tables are compatible with GitHub-flavored markdown
- Default behavior unchanged (no breaking changes)
- Help text documents new flag
- Tests verify markdown output format
AI generated by Plan Command for discussion #12479