1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-26 22:20:24 +08:00

House cleaning

This commit is contained in:
Gonzalo Fernandez-Victorio
2021-04-29 17:38:39 +01:00
parent eae5f90385
commit c821a33692
16 changed files with 159 additions and 144 deletions

34
apirun.go Normal file
View File

@@ -0,0 +1,34 @@
package docxlib
// Color allows to set run color
func (r *Run) Color(color string) *Run {
r.RunProperties.Color = &Color{
Val: color,
}
return r
}
// Size allows to set run size
func (r *Run) Size(size int) *Run {
r.RunProperties.Size = &Size{
Val: size * 2,
}
return r
}
// AddText add text to paragraph
func (p *Paragraph) AddText(text string) *Run {
t := &Text{
Text: text,
}
run := &Run{
Text: t,
RunProperties: &RunProperties{},
}
p.Data = append(p.Data, ParagraphChild{Run: run})
return run
}