Documentation ¶
Index ¶
- Constants
- Variables
- func AtomicWPTokensToString(token WPTokens) string
- func ExtractWPToArrayTextString(wp WP) ([]string, error)
- func GetTextFromXML(src string) (string, error)
- func RebuildBlocks(pattern string, source []string) ([]string, int, error)
- func Screening(s string) string
- type Block
- type Document
- func (d *Document) AddNewBlock(s string)
- func (d *Document) AppendWPBlockInToEnd(block WP)
- func (d *Document) BodyToString() string
- func (d *Document) CreateMarkedStringList(mp MarkerParams, letter ...string) []WP
- func (d *Document) EditBlockByID(id int)
- func (d *Document) GetBlockByID(id int) WP
- func (d *Document) GetBlockIDByTag(tag string) (int, error)
- func (d *Document) GetCopyBlockByTag(pattern string) (WP, error)
- func (d *Document) InsertBlockAfterBlockByID(i int, wp WP) error
- func (d *Document) RemoveBlockByID(i int) error
- func (d *Document) ReplaceTextByTag(pattern string, text string) error
- type Docx
- func (d *Docx) AddBlockAfterElement(elemNum int, element string, body []string) []string
- func (d *Docx) AddBlockAtTheBeginning(element string, body []string) []string
- func (d *Docx) AddBlockAtTheEnd(element string, body []string) []string
- func (d *Docx) AddBlockBeforeElement(elemNum int, element string, body []string) []string
- func (d *Docx) BlockToString(block Block) string
- func (d *Docx) BodyGlue(body []string) string
- func (d *Docx) BodyParse(body string) []string
- func (d *Docx) Compile(path string, doc Document) error
- func (d *Docx) CreateNewBlock(simpleword string) string
- func (d *Docx) CreateStructedBlock(simpleword string, arr ...Font) Block
- func (d *Docx) EditStructedBlockParams(block Block) Block
- func (d *Docx) EditTextInStringBlock(block string, newText string) string
- func (d *Docx) GetContent() string
- func (d *Docx) GetFirstElementContain(word string, body []string) (int, error)
- func (d *Docx) GetTextInBlock(s string) string
- func (d *Docx) GlueNodes(header, body, footer string)
- func (d *Docx) ParseBlockToStruct(s string) Block
- func (d *Docx) ParseNode() (string, string, string)
- func (d *Docx) Parser() (Document, error)
- func (d *Docx) Replace(oldString string, newString string, num int) (err error)
- func (d *Docx) ReplaceBlockToBlocks(bodypart []string, id int, blocks []Block) []string
- 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) ReplaceTextInBlock(old, new string, body []string) []string
- func (d *Docx) ReplaceWithTag(oldString string, newString string) (err error)
- func (d *Docx) SetContent(content string)
- func (d *Docx) Write(ioWriter io.Writer) (err error)
- func (d *Docx) WriteToFile(path string) (err error)
- type Font
- type MarkerParams
- type RPr
- type ReplaceDocx
- type SectPr
- type WP
- type WPTokens
- type WR
- type WpPr
- type ZipData
- type ZipFile
- type ZipInMemory
Constants ¶
View Source
const Open = 4
View Source
const Self = 5
Variables ¶
View Source
var ( Black = "000000" White = "FFFFFF" Red = "FF0000" Lime = "00FF00" Blue = "0000FF" Yellow = "FFFF00" Cyan = "00FFFF" Magenta = "FF00FF" Silver = "C0C0C0" Gray = "808080" Maroon = "800000" Olive = "808000" Green = "008000" Purple = "800080" Teal = "008080" )
Functions ¶
func AtomicWPTokensToString ¶
func GetTextFromXML ¶
func RebuildBlocks ¶
RebuildBlocks (pattern string, source []string) (expectedArray []string, blockIDWithTag int, err)
Types ¶
type Document ¶
func (*Document) AddNewBlock ¶
func (*Document) AppendWPBlockInToEnd ¶
func (*Document) BodyToString ¶
func (*Document) CreateMarkedStringList ¶
func (d *Document) CreateMarkedStringList(mp MarkerParams, letter ...string) []WP
func (*Document) EditBlockByID ¶
func (*Document) GetBlockByID ¶
func (*Document) GetCopyBlockByTag ¶
func (*Document) InsertBlockAfterBlockByID ¶ added in v1.1.0
func (*Document) RemoveBlockByID ¶ added in v1.1.0
type Docx ¶
type Docx struct {
// contains filtered or unexported fields
}
func (*Docx) AddBlockAfterElement ¶
func (*Docx) AddBlockAtTheBeginning ¶
func (*Docx) AddBlockAtTheEnd ¶
func (*Docx) AddBlockBeforeElement ¶
func (*Docx) BlockToString ¶
func (d *Docx) BlockToString(block Block) string { return fmt.Sprintf("%s%s%s", block.Head, block.Body, block.Footer) }
func (*Docx) CreateNewBlock ¶
<w:b/>
<w:bCs/> <w:i/> <w:iCs/> <w:color w:val="F10D0C"/> <w:sz w:val="36"/> <w:szCs w:val="36"/> <w:u w:val="single"/>
func (*Docx) CreateStructedBlock ¶
func (*Docx) EditStructedBlockParams ¶
func (*Docx) EditTextInStringBlock ¶
func (*Docx) GetContent ¶
func (*Docx) GetFirstElementContain ¶
func (*Docx) GetTextInBlock ¶
func (*Docx) ParseBlockToStruct ¶
func (*Docx) ReplaceBlockToBlocks ¶
func (*Docx) ReplaceFooter ¶
func (*Docx) ReplaceHeader ¶
func (*Docx) ReplaceLink ¶
func (*Docx) ReplaceTextInBlock ¶
func (*Docx) ReplaceWithTag ¶
func (*Docx) SetContent ¶
func (*Docx) WriteToFile ¶
type MarkerParams ¶
type MarkerParams struct { }
type ReplaceDocx ¶
type ReplaceDocx struct {
// contains filtered or unexported fields
}
func ReadDocx ¶
func ReadDocx(reader ZipData) (*ReplaceDocx, error)
func ReadDocxFile ¶
func ReadDocxFile(path string) (*ReplaceDocx, error)
func ReadDocxFromMemory ¶
func ReadDocxFromMemory(data io.ReaderAt, size int64) (*ReplaceDocx, error)
func (*ReplaceDocx) Close ¶
func (r *ReplaceDocx) Close() error
func (*ReplaceDocx) Editable ¶
func (r *ReplaceDocx) Editable() *Docx
type ZipData ¶
type ZipData interface {
// contains filtered or unexported methods
}
Contains functions to work with data from a zip file
type ZipFile ¶
type ZipFile struct {
// contains filtered or unexported fields
}
Type for zip files read from disk
type ZipInMemory ¶
type ZipInMemory struct {
// contains filtered or unexported fields
}
Type for in memory zip files
Source Files ¶
Click to show internal directories.
Click to hide internal directories.