odt

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertHTMLToText

func ConvertHTMLToText(html string) string

ConvertHTMLToText converts basic HTML to plain text for ODT Strips HTML tags and preserves content

Types

type Template

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

Template represents an ODT document template

func Open

func Open(path string) (*Template, error)

Open reads an ODT file and prepares it for manipulation

func (*Template) Apply

func (t *Template) Apply(data map[string]any) error

Apply replaces multiple placeholders

func (*Template) Close

func (t *Template) Close() error

Close releases resources

func (*Template) ProcessLoops

func (t *Template) ProcessLoops(data map[string]any) error

ProcessLoops handles {#arrayName}...{/arrayName} in content

func (*Template) Save

func (t *Template) Save(path string) error

Save writes the modified ODT file

func (*Template) SetTextValue

func (t *Template) SetTextValue(placeholder, value string) error

SetTextValue replaces a placeholder in text with a value

func (*Template) SetTextValueHTML

func (t *Template) SetTextValueHTML(placeholder, htmlValue string) error

SetTextValueHTML replaces a placeholder with HTML content (basic support)

Jump to

Keyboard shortcuts

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