1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-10 10:23:19 +08:00

feat: chage template name (due2 #17)

This commit is contained in:
源文雨
2024-03-15 13:07:58 +09:00
parent b3e1a27db9
commit 047c5e5f03
16 changed files with 52 additions and 25 deletions

13
docx.go
View File

@@ -55,10 +55,10 @@ type Docx struct {
io.WriterTo
}
// NewA4 generates a new empty A4 docx file that we can manipulate and
// New generates a new empty docx file that we can manipulate and
// later on, save
func NewA4() *Docx {
return newEmptyA4File()
func New() *Docx {
return newEmptyFile()
}
// Parse generates a new docx file in memory from a reader
@@ -160,10 +160,3 @@ func (f *Docx) WriteTo(writer io.Writer) (_ int64, err error) {
func (f *Docx) Read(_ []byte) (int, error) {
return 0, os.ErrInvalid
}
// UseTemplate will replace template files
func (f *Docx) UseTemplate(template string, tmpfslst []string, tmplfs fs.FS) {
f.template = template
f.tmplfs = tmplfs
f.tmpfslst = tmpfslst
}