Documentation
¶
Overview ¶
Package convert wraps the conductor-oss/markitdown pure-Go library to turn rich document formats (docx, pdf, xlsx, …) into Markdown. It is the single integration point for document conversion across Pando: the `pando convert` CLI command and the on-the-fly Knowledge Base indexing both go through it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertibleDocumentExtensions ¶
func ConvertibleDocumentExtensions() []string
ConvertibleDocumentExtensions returns the sorted list of extensions in the curated KB ingestion set.
func IsSupported ¶
IsSupported reports whether path's extension is convertible by the library.
func SupportedExtensions ¶
func SupportedExtensions() []string
SupportedExtensions returns the sorted list of all supported input extensions (including the leading dot), suitable for display.
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
Converter wraps a markitdown engine. The engine is created lazily on first use because initializing the PDFium WASM runtime has a non-trivial cost; a process that never converts a PDF should not pay for it. All conversions are serialized with a mutex: the underlying PDF backend is not guaranteed to be safe for concurrent use, and KB conversion is not a hot path.
func New ¶
func New() *Converter
New returns a ready-to-use Converter using the default curated document set for KB ingestion. The heavy engine is initialized lazily.
func NewWithConvertibleExtensions ¶
NewWithConvertibleExtensions returns a Converter whose curated KB set is overridden by exts (each entry with or without a leading dot, case insensitive). An empty list falls back to the built-in default set.
func (*Converter) Convert ¶
Convert auto-detects whether source is a local file path or a URL and converts it to Markdown.
func (*Converter) ConvertFile ¶
ConvertFile converts a local file at path to Markdown and returns the resulting text. The path's extension must be supported.
func (*Converter) ConvertReader ¶
ConvertReader converts the contents of r to Markdown. name is used to detect the format via its extension (e.g. "report.docx").
func (*Converter) IsConvertibleDocument ¶
IsConvertibleDocument reports whether path belongs to the curated set of document formats that should be auto-converted during KB ingestion.