Documentation
¶
Index ¶
- type Docx
- func (d *Docx) Close()
- func (d *Docx) CreateNewDocx() error
- func (d *Docx) LoadDocx(path string) error
- func (d *Docx) NewDocx() []byte
- func (d *Docx) Replace(replacements map[string]string) (err error)
- func (d *Docx) ReplaceCond(replacements map[string]Replacement) (err error)
- func (d *Docx) SaveDocxToFile(path string) error
- type Replacement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Docx ¶
type Docx struct {
// contains filtered or unexported fields
}
func (*Docx) CreateNewDocx ¶
create the resulting docx and store the byte slice to result
func (*Docx) LoadDocx ¶
load the docx file an extract the document.xml file TODO: replace file by io.reader?
func (*Docx) Replace ¶
replace placeholders using the text/template package this function does the escaping for you using html/template
func (*Docx) ReplaceCond ¶
func (d *Docx) ReplaceCond(replacements map[string]Replacement) (err error)
ReplaceCond replaces replaces the placeholders like the other two replacement functions but provides the possibility to choose (with the escaped field) whether the string should be escaped
func (*Docx) SaveDocxToFile ¶
Save the resulting docx to a file
type Replacement ¶
Click to show internal directories.
Click to hide internal directories.