Documentation ¶
Index ¶
- func NewHyperlinkNode(text, rID string) (*xmlquery.Node, error)
- func NewHyperlinkRelNode(target, rID string) (*xmlquery.Node, error)
- type Docx
- func (d *Docx) Replace(oldString string, newString string, num int) (err error)
- func (d *Docx) ReplaceFooter(oldString string, newString string) (err error)
- func (d *Docx) ReplaceHeader(oldString string, newString string) (err error)
- func (d *Docx) ReplaceLink(oldString string, newString string, num int) (err error)
- func (d *Docx) ReplaceRaw(oldString string, newString string, num int)
- func (d *Docx) Write(ioWriter io.Writer) (err error)
- func (d *Docx) WriteToFile(path string) (err error)
- type ReplaceDocx
- func (d *ReplaceDocx) AddHyperlinkForLink(link string) (*xmlquery.Node, error)
- func (d *ReplaceDocx) AddInternetLinkStyleIfMissing() error
- func (r *ReplaceDocx) Close() error
- func (r *ReplaceDocx) Editable() *Docx
- func (d *ReplaceDocx) GetHyperlinkForLink(link string) (*xmlquery.Node, error)
- func (d *ReplaceDocx) GetOrAddHyperlinkForLink(link string) (*xmlquery.Node, error)
- func (d *ReplaceDocx) GetRelationships() (*xmlquery.Node, error)
- func (d *ReplaceDocx) ReplaceTextWithHyperlink(lookFor, link string) error
- func (d *ReplaceDocx) SubstituteRunWithHyperlinkWrtTarget(chosenOne *xmlquery.Node, target, link string)
- type ZipData
- type ZipFile
- type ZipInMemory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHyperlinkNode ¶
NewHyperlinkNode todo
Types ¶
type Docx ¶
type Docx struct {
// contains filtered or unexported fields
}
Docx Main docx data structure
func (*Docx) ReplaceFooter ¶
ReplaceFooter replaces in Footer
func (*Docx) ReplaceHeader ¶
ReplaceHeader replaces in Header
func (*Docx) ReplaceLink ¶
ReplaceLink replaces a link
func (*Docx) ReplaceRaw ¶
ReplaceRaw replaces a raw string
func (*Docx) WriteToFile ¶
WriteToFile writes the docx to a file given the path
type ReplaceDocx ¶
type ReplaceDocx struct {
// contains filtered or unexported fields
}
ReplaceDocx main data structure
func ReadDocxFile ¶
func ReadDocxFile(path string) (*ReplaceDocx, error)
ReadDocxFile reads the docx from a path
func ReadDocxFromMemory ¶
func ReadDocxFromMemory(data io.ReaderAt, size int64) (*ReplaceDocx, error)
ReadDocxFromMemory reads the docx directly from memory
func (*ReplaceDocx) AddHyperlinkForLink ¶
func (d *ReplaceDocx) AddHyperlinkForLink(link string) (*xmlquery.Node, error)
AddHyperlinkForLink adds a new relationship for the link and returns the it
func (*ReplaceDocx) AddInternetLinkStyleIfMissing ¶
func (d *ReplaceDocx) AddInternetLinkStyleIfMissing() error
AddInternetLinkStyleIfMissing looks into the `word/styles.xml` file for InternetLink style, and creates the entry if it does not exist
func (*ReplaceDocx) Close ¶
func (r *ReplaceDocx) Close() error
Close closes the zip reader instance of RelaceDocx
func (*ReplaceDocx) Editable ¶
func (r *ReplaceDocx) Editable() *Docx
Editable Editable data structure
func (*ReplaceDocx) GetHyperlinkForLink ¶
func (d *ReplaceDocx) GetHyperlinkForLink(link string) (*xmlquery.Node, error)
GetHyperlinkForLink looks in document.rel.xml for a relationship that represents an Hyperlink to the given link. If a matching relationship is found it is returned, otherwise is returned the nil value
func (*ReplaceDocx) GetOrAddHyperlinkForLink ¶
func (d *ReplaceDocx) GetOrAddHyperlinkForLink(link string) (*xmlquery.Node, error)
GetOrAddHyperlinkForLink looks for an existing relationship for the provided link and if the research is unsuccessfull, it creates and returns a new relationship describing the provided link
func (*ReplaceDocx) GetRelationships ¶
func (d *ReplaceDocx) GetRelationships() (*xmlquery.Node, error)
GetRelationships returns the relationships of the docx file
func (*ReplaceDocx) ReplaceTextWithHyperlink ¶
func (d *ReplaceDocx) ReplaceTextWithHyperlink(lookFor, link string) error
ReplaceTextWithHyperlink todo
func (*ReplaceDocx) SubstituteRunWithHyperlinkWrtTarget ¶
func (d *ReplaceDocx) SubstituteRunWithHyperlinkWrtTarget(chosenOne *xmlquery.Node, target, link string)
SubstituteRunWithHyperlinkWrtTarget todo
type ZipData ¶
type ZipData interface {
// contains filtered or unexported methods
}
ZipData Contains functions to work with data from a zip file
type ZipFile ¶
type ZipFile struct {
// contains filtered or unexported fields
}
ZipFile Type for zip files read from disk
type ZipInMemory ¶
type ZipInMemory struct {
// contains filtered or unexported fields
}
ZipInMemory Type for in memory zip files