1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-27 06:30: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

26
apipara.go Normal file
View File

@@ -0,0 +1,26 @@
package docxlib
// AddParagraph adds a new paragraph
func (f *DocxLib) AddParagraph() *Paragraph {
p := &Paragraph{
Data: make([]ParagraphChild, 0),
file: f,
}
f.Document.Body.Paragraphs = append(f.Document.Body.Paragraphs, p)
return p
}
func (f *DocxLib) Paragraphs() []*Paragraph {
return f.Document.Body.Paragraphs
}
func (p *Paragraph) Runs() (ret []*Run) {
data := p.Data
for _, d := range data {
if d.Run != nil {
ret = append(ret, d.Run)
}
}
return
}