docx

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	// Warn logs a warning message with optional fields.
	// Fields should be key-value pairs (e.g., "category", "image", "error", err).
	Warn(msg string, fields ...interface{})
	// Debug logs a debug message with optional fields.
	Debug(msg string, fields ...interface{})
}

Logger defines the interface for structured logging. Implementations can use any logging library (e.g., zerolog, zap, logrus). If nil, no logging is performed.

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser handles DOCX parsing and content extraction.

func NewParser

func NewParser() *Parser

NewParser creates a new DOCX parser instance.

func NewParserWithLogger

func NewParserWithLogger(logger Logger) *Parser

NewParserWithLogger creates a new DOCX parser instance with structured logging.

func (*Parser) Parse

func (p *Parser) Parse(filePath string) (*types.DocumentData, error)

Parse extracts content from a DOCX file and returns structured document data. Warnings are collected for non-fatal issues (e.g., failed image extraction, table extraction issues) and returned in DocumentData.Warnings.

Jump to

Keyboard shortcuts

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