Skip to content

[plan] Add markdown table output format option #12623

@github-actions

Description

@github-actions

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

  1. Add --format flag to relevant CLI commands (or global flag)
  2. Create RenderTableAsMarkdown() helper function in pkg/console/console.go
  3. Update table rendering logic to check format flag
  4. Use lipgloss.MarkdownBorder() with appropriate options
  5. Add tests for markdown output

Files to Modify

  • pkg/cli/flags.go - Add --format flag definition
  • pkg/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=markdown flag 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions