Versions in this module Expand all Collapse all v1 v1.6.1 Aug 2, 2026 v1.6.0 Aug 2, 2026 Changes in this version + var ErrConversionFailed = errors.New("conversion failed") + var ErrExportFailed = errors.New("export failed") + var ErrFileNotFound = errors.New("file not found") + var ErrInvalidDocument = errors.New("invalid word document") + var ErrInvalidImagePath = errors.New("invalid image path") + var ErrInvalidMarkdown = errors.New("invalid markdown content") + var ErrUnsupportedMarkdown = errors.New("unsupported markdown syntax") + var ErrUnsupportedWordElement = errors.New("unsupported word element") + func LaTeXToOMMLString(latex string, isBlock bool) (string, error) + type BidirectionalConverter struct + func NewBidirectionalConverter(mdOpts *ConvertOptions, exportOpts *ExportOptions) *BidirectionalConverter + func (bc *BidirectionalConverter) AutoConvert(inputPath, outputPath string) error + type ConversionError struct + Cause error + Column int + Line int + Message string + Type string + func NewConversionError(errorType, message string, line, column int, cause error) *ConversionError + func (e *ConversionError) Error() string + func (e *ConversionError) Unwrap() error + type ConvertOptions struct + ConvertToBookmarks bool + DefaultFontFamily string + DefaultFontSize float64 + EmbedImages bool + EnableFootnotes bool + EnableGFM bool + EnableMath bool + EnableTables bool + EnableTaskList bool + ErrorCallback func(error) + GenerateTOC bool + IgnoreErrors bool + ImageBasePath string + MaxImageWidth float64 + PageSettings *document.PageSettings + PreserveLinkStyle bool + ProgressCallback func(int, int) + StrictMode bool + StyleMapping map[string]string + TOCMaxLevel int + func DefaultOptions() *ConvertOptions + func HighQualityOptions() *ConvertOptions + type Converter struct + func NewConverter(opts *ConvertOptions) *Converter + func (c *Converter) BatchConvert(inputs []string, outputDir string, options *ConvertOptions) error + func (c *Converter) ConvertBytes(content []byte, opts *ConvertOptions) (*document.Document, error) + func (c *Converter) ConvertFile(mdPath, docxPath string, options *ConvertOptions) error + func (c *Converter) ConvertString(content string, opts *ConvertOptions) (*document.Document, error) + type ExportError struct + Cause error + Message string + Type string + func NewExportError(errorType, message string, cause error) *ExportError + func (e *ExportError) Error() string + func (e *ExportError) Unwrap() error + type ExportOptions struct + BulletListMarker string + ConvertHyperlinks bool + CustomStyleMap map[string]string + DefaultCodeLang string + EmphasisMarker string + ErrorCallback func(error) + ExtractImages bool + IgnoreErrors bool + IgnoreUnknownStyles bool + ImageNamePattern string + ImageOutputDir string + ImageRelativePath bool + IncludeMetadata bool + MaxLineLength int + PreserveBookmarks bool + PreserveCodeStyle bool + PreserveFootnotes bool + PreserveLineBreaks bool + PreserveTOC bool + ProgressCallback func(int, int) + StrictMode bool + StripComments bool + UseGFMTables bool + UseSetext bool + WrapLongLines bool + func DefaultExportOptions() *ExportOptions + func HighQualityExportOptions() *ExportOptions + type Exporter struct + func NewExporter(opts *ExportOptions) *Exporter + func (e *Exporter) BatchExport(inputs []string, outputDir string, options *ExportOptions) error + func (e *Exporter) ExportToBytes(doc *document.Document, options *ExportOptions) ([]byte, error) + func (e *Exporter) ExportToFile(docxPath, mdPath string, options *ExportOptions) error + func (e *Exporter) ExportToString(doc *document.Document, options *ExportOptions) (string, error) + type MarkdownConverter interface + BatchConvert func(inputs []string, outputDir string, options *ConvertOptions) error + ConvertBytes func(mdContent []byte, options *ConvertOptions) (*document.Document, error) + ConvertFile func(mdPath, docxPath string, options *ConvertOptions) error + ConvertString func(mdContent string, options *ConvertOptions) (*document.Document, error) + type MarkdownWriter struct + func (w *MarkdownWriter) Write() ([]byte, error) + type MathDeg struct + Content []interface{} + XMLName xml.Name + func (d *MathDeg) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type MathDegHide struct + Val string + XMLName xml.Name + type MathDelim struct + DPr *MathDelimPr + E *MathE + XMLName xml.Name + type MathDelimChar struct + Val string + XMLName xml.Name + type MathDelimPr struct + BegChr *MathDelimChar + EndChr *MathDelimChar + XMLName xml.Name + type MathDen struct + Content []interface{} + XMLName xml.Name + func (d *MathDen) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type MathE struct + Content []interface{} + XMLName xml.Name + func (m *MathE) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type MathFrac struct + Den *MathDen + FracPr *MathFracPr + Num *MathNum + XMLName xml.Name + type MathFracPr struct + Type *MathFracType + XMLName xml.Name + type MathFracType struct + Val string + XMLName xml.Name + type MathNum struct + Content []interface{} + XMLName xml.Name + func (n *MathNum) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type MathRad struct + Deg *MathDeg + E *MathE + RadPr *MathRadPr + XMLName xml.Name + type MathRadPr struct + DegHide *MathDegHide + XMLName xml.Name + type MathRun struct + RunPr *MathRunProp + Text *MathText + XMLName xml.Name + type MathRunProp struct + Sty *MathSty + XMLName xml.Name + type MathSty struct + Val string + XMLName xml.Name + type MathSub struct + E *MathE + Sub *MathSubElement + XMLName xml.Name + type MathSubElement struct + Content []interface{} + XMLName xml.Name + func (s *MathSubElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type MathSubSup struct + E *MathE + Sub *MathSubElement + Sup *MathSupElement + XMLName xml.Name + type MathSup struct + E *MathE + Sup *MathSupElement + XMLName xml.Name + type MathSupElement struct + Content []interface{} + XMLName xml.Name + func (s *MathSupElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type MathText struct + Content string + XMLName xml.Name + type OfficeMath struct + Content []interface{} + XMLName xml.Name + func LaTeXToOMML(latex string) *OfficeMath + func (o *OfficeMath) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type OfficeMathPara struct + Math *OfficeMath + XMLName xml.Name + type WordRenderer struct + func (r *WordRenderer) Render(doc ast.Node) error + type WordToMarkdownExporter interface + BatchExport func(inputs []string, outputDir string, options *ExportOptions) error + ExportToBytes func(doc *document.Document, options *ExportOptions) ([]byte, error) + ExportToFile func(docxPath, mdPath string, options *ExportOptions) error + ExportToString func(doc *document.Document, options *ExportOptions) (string, error)