Documentation ¶
Index ¶
- type Contents
- type ListContent
- type ListItem
- type TableContent
- func (tc *TableContent) AddRows(cols ...[]Contents)
- func (tc TableContent) Body() [][]Contents
- func (tc TableContent) ColCount() int
- func (tc TableContent) GetColumn(index int) []Contents
- func (tc TableContent) Headers() []Contents
- func (tc TableContent) Widths(pdf *gofpdf.Fpdf, cellMargin float64) []float64
- func (tc TableContent) WidthsAlt(pdf *gofpdf.Fpdf, cellMargin float64) []float64
- type Text
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contents ¶
type Contents struct {
Content []Text `json:"content"`
}
Contents models the contents of a Paragraph, Blockquote, List Item, or Table Cell.
func (Contents) AllContent ¶
AllContent returns the values of all Text.Text contained in Contents.
func (Contents) JoinContent ¶ added in v0.0.5
JoinContent returns the values of all Text.Text contained in Contents.
type ListContent ¶
ListContent is an array of ListItems.
func (*ListContent) AddItems ¶
func (ls *ListContent) AddItems(listItem ...ListItem)
AddItems appends ListItems to a List's Items.
func (*ListContent) NewItem ¶ added in v0.0.4
func (ls *ListContent) NewItem(texts ...Text)
NewItem creates a new ListItem whose contents are comprised of the given Text arguments and adds that ListItem to a List's Items.
type ListItem ¶
type ListItem struct { Contents `json:"contents"` Children ListContent `json:"children"` }
ListItem is a single list bullet, and may contain a nested list.
func (ListItem) HasChildren ¶
HasChildren returns true if a ListItem contains a nested list.
type TableContent ¶
type TableContent struct { Rows [][]Contents `json:"rows"` Alignments []string `json:"alignments"` // "L", "C", or "R" }
TableContent represents the contents of a table element.
func (*TableContent) AddRows ¶
func (tc *TableContent) AddRows(cols ...[]Contents)
AddRows to TableContent.
func (TableContent) Body ¶
func (tc TableContent) Body() [][]Contents
Body returns all rows after the first.
func (TableContent) ColCount ¶
func (tc TableContent) ColCount() int
ColCount returns the number of header columns.
func (TableContent) GetColumn ¶
func (tc TableContent) GetColumn(index int) []Contents
GetColumn returns one string for every cell in a column at the given index. First column is 0, not 1.
func (TableContent) Headers ¶
func (tc TableContent) Headers() []Contents
Headers returns the first slice of string in Rows.