formatters

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextItem

type ContextItem struct {
	Label string
	Value string
}

ContextItem represents a key-value pair for message context (e.g., Team, Channel)

type Format

type Format string

Format represents different output formats for message content

const (
	// FormatPlainText converts HTML to plain text
	FormatPlainText Format = "plain"
	// FormatMarkdown converts HTML to Markdown (future)
	FormatMarkdown Format = "markdown"
)

type Formatter

type Formatter interface {
	// Format converts raw (HTML) content into the target format string
	Format(htmlContent string) string
	// WriteMessages formats and writes a collection of messages to the writer
	WriteMessages(w io.Writer, messages []*MessageView) error
}

Formatter provides content formatting and writing capabilities

func NewMarkdownFormatter

func NewMarkdownFormatter() Formatter

NewMarkdownFormatter creates a formatter that converts HTML to plain text

func NewPlainTextFormatter

func NewPlainTextFormatter() Formatter

NewPlainTextFormatter creates a formatter that converts HTML to plain text

type MessageView

type MessageView struct {
	ID        string
	Author    string
	Timestamp time.Time
	Content   string
	Context   []ContextItem
}

MessageView represents the generic data needed to display a message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL