Documentation
¶
Index ¶
- type Markdown
- func (m *Markdown) AddCodeBlock(code string, language string) *Markdown
- func (m *Markdown) AddHeading(text string, level int) *Markdown
- func (m *Markdown) AddHorizontalRule() *Markdown
- func (m *Markdown) AddList(items []string) *Markdown
- func (m *Markdown) AddParagraph(text string) *Markdown
- func (m *Markdown) AddTable(headers []string, data [][]string, skipRepeatColumns ...int) *Markdown
- func (m *Markdown) Print(opts ...PrintOptions) error
- func (m *Markdown) Render() (string, error)
- func (m *Markdown) String() string
- func (m *Markdown) WriteTo(w io.Writer) (int64, error)
- func (m *Markdown) WriteToTerminal() (int64, error)
- func (m *Markdown) WriteToTerminalWithGlamour() (int64, error)
- type PrintOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Markdown ¶
type Markdown struct {
// contains filtered or unexported fields
}
Markdown represents a markdown document that can be built incrementally
func (*Markdown) AddCodeBlock ¶
AddCodeBlock adds a code block with optional language specification
func (*Markdown) AddHeading ¶
AddHeading adds a heading with the specified level (1-6)
func (*Markdown) AddHorizontalRule ¶
AddHorizontalRule adds a horizontal rule
func (*Markdown) AddParagraph ¶
AddParagraph adds a paragraph of text
func (*Markdown) AddTable ¶
AddTable adds a table with the given headers and data skipRepeatColumns is an optional slice of column indices (0-based) that should not repeat values
func (*Markdown) Print ¶
func (m *Markdown) Print(opts ...PrintOptions) error
Print renders the markdown and outputs it according to the provided options
func (*Markdown) WriteToTerminal ¶
WriteToTerminal writes the raw markdown content to stdout without glamour rendering
func (*Markdown) WriteToTerminalWithGlamour ¶
WriteToTerminalWithGlamour writes the rendered markdown content to stdout using glamour
type PrintOptions ¶
type PrintOptions struct {
ToTerminal bool // Print to terminal with glamour rendering
ToFile string // File path to save raw markdown (empty string = don't save to file)
}
PrintOptions configures where and how to print the markdown
func DefaultPrintOptions ¶
func DefaultPrintOptions() PrintOptions
DefaultPrintOptions returns default options (terminal only)