1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-11 02:50:27 +08:00

普适化 template

This commit is contained in:
源文雨
2023-02-21 13:14:21 +08:00
parent 092b86e7f4
commit 585ee6cda8
13 changed files with 51 additions and 28 deletions

View File

@@ -5,6 +5,7 @@ import (
"bytes"
"errors"
"io"
"io/fs"
)
var (
@@ -24,16 +25,21 @@ type Docx struct {
rId uintptr
imageId uintptr
template string
tmplfs fs.FS
tmpfslst []string
buf *bytes.Buffer
isbufempty bool
io.Reader
io.WriterTo
}
// New generates a new empty docx file that we can manipulate and
// NewA4 generates a new empty A4 docx file that we can manipulate and
// later on, save
func New() *Docx {
return newEmptyFile()
func NewA4() *Docx {
return newEmptyA4File()
}
// Parse generates a new docx file in memory from a reader