Documentation
¶
Index ¶
- type Body
- type BodyParams
- type BoolValue
- type DocItem
- type DocItemType
- type Document
- type EmptyValue
- type FloatValue
- type Header
- type HeightValue
- type IntValue
- type MarginValue
- type Margins
- type ParagraphItem
- type ParagraphParams
- type RecordFonts
- type RecordItem
- type RecordParams
- type ReferenceValue
- type ShadowValue
- type SimpleDocxFile
- type SizeValue
- type SpacingValue
- type StringValue
- type TableBorder
- type TableBorders
- type TableCell
- type TableCellParams
- type TableGrid
- type TableItem
- type TableLayout
- type TableParams
- type TableParamsEx
- type TableRow
- type TableRowParams
- type WidthValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body struct {
Items []DocItem
Params BodyParams `xml:"sectPr"`
}
Body - тело документа
type BodyParams ¶
type BodyParams struct {
HeaderReference *ReferenceValue `xml:"headerReference,omitempty"`
PageSize SizeValue `xml:"pgSz"`
PageMargin MarginValue `xml:"pgMar"`
Bidi IntValue `xml:"bidi"`
}
BodyParams - параметры тела документа
type BoolValue ¶
type BoolValue struct {
Value bool `xml:"val,attr"`
}
BoolValue - одиночное bool значение
type DocItem ¶
type DocItem interface {
Tag() string
Type() DocItemType
PlainText() string
Clone() DocItem
// contains filtered or unexported methods
}
DocItem - интерфейс элемента документа
type DocItemType ¶
type DocItemType int
DocItemType - тип элемента
const ( Paragraph DocItemType = iota Record Table )
Paragraph - параграф
type Document ¶
Document - документ разметки DOCX
type FloatValue ¶
type FloatValue struct {
Value float64 `xml:"val,attr"`
}
FloatValue - одиночное float значение
type Header ¶
Header - разметка заголовка DOCX
type HeightValue ¶
type HeightValue struct {
Value int64 `xml:"val,attr"`
HeightRule string `xml:"hRule,attr,omitempty"`
}
HeightValue - значение высоты
type IntValue ¶
type IntValue struct {
Value int64 `xml:"val,attr"`
}
IntValue - одиночное int значение
type MarginValue ¶
type MarginValue struct {
Top int64 `xml:"top,attr"`
Left int64 `xml:"left,attr"`
Bottom int64 `xml:"bottom,attr"`
Right int64 `xml:"right,attr"`
Header int64 `xml:"header,attr,omitempty"`
}
MarginValue - margin значение
type Margins ¶
type Margins struct {
Top WidthValue `xml:"top"`
Left WidthValue `xml:"left"`
Bottom WidthValue `xml:"bottom"`
Right WidthValue `xml:"right"`
}
Margins - margins значение
type ParagraphItem ¶
type ParagraphItem struct {
Params ParagraphParams `xml:"pPr"`
Items []DocItem
}
ParagraphItem - параграф
type ParagraphParams ¶
type ParagraphParams struct {
Style *StringValue `xml:"pStyle,omitempty"`
Spacing *SpacingValue `xml:"spacing,omitempty"`
Jc *StringValue `xml:"jc,omitempty"`
Bidi *IntValue `xml:"bidi,omitempty"`
}
ParagraphParams - параметры параграфа
type RecordFonts ¶
type RecordFonts struct {
ASCII string `xml:"ascii,attr"`
CS string `xml:"cs,attr"`
HandleANSI string `xml:"hAnsi,attr"`
EastAsia string `xml:"eastAsia,attr"`
HandleInt string `xml:"hint,attr,omitempty"`
}
RecordFonts - fonts in record
type RecordItem ¶
type RecordItem struct {
Params RecordParams `xml:"rPr,omitempty"`
Text string `xml:"t,omitempty"`
Tab bool `xml:"tab,omitempty"`
Break bool `xml:"br,omitempty"`
}
RecordItem - record item
type RecordParams ¶
type RecordParams struct {
Fonts *RecordFonts `xml:"rFonts,omitempty"`
Rtl *IntValue `xml:"rtl,omitempty"`
Size *IntValue `xml:"sz,omitempty"`
SizeCs *IntValue `xml:"szCs,omitempty"`
Lang *StringValue `xml:"lang,omitempty"`
Underline *StringValue `xml:"u,omitempty"`
Italic *EmptyValue `xml:"i,omitempty"`
Bold *EmptyValue `xml:"b,omitempty"`
BoldCS *EmptyValue `xml:"bCs,omitempty"`
Color *StringValue `xml:"color,omitempty"`
}
RecordParams - params record
type ReferenceValue ¶
ReferenceValue - reference value
type ShadowValue ¶
type ShadowValue struct {
Value string `xml:"val,attr"`
Color string `xml:"color,attr"`
Fill string `xml:"fill,attr"`
}
ShadowValue - значение тени
type SimpleDocxFile ¶
type SimpleDocxFile struct {
// contains filtered or unexported fields
}
SimpleDocxFile - файл docx
func OpenFile ¶
func OpenFile(fileName string) (*SimpleDocxFile, error)
OpenFile - Открытие файла DOCX
func (*SimpleDocxFile) Render ¶
func (f *SimpleDocxFile) Render(v interface{}) error
Render (SimpleDocxFile) - рендер шаблона
func (*SimpleDocxFile) RenderHeader ¶
func (f *SimpleDocxFile) RenderHeader(index int, v interface{}) error
RenderHeader (SimpleDocxFile) - рендер заголовка шаблона
func (*SimpleDocxFile) Save ¶
func (f *SimpleDocxFile) Save(fileName string) error
Save (SimpleDocxFile) - сохранить
type SizeValue ¶
type SizeValue struct {
Width int64 `xml:"w,attr"`
Height int64 `xml:"h,attr"`
Orientation string `xml:"orient,attr,omitempty"`
}
SizeValue - значение размера
type SpacingValue ¶
type SpacingValue struct {
After int64 `xml:"after,attr"`
Before int64 `xml:"before,attr"`
Line int64 `xml:"line,attr"`
LineRule string `xml:"lineRule,attr"`
}
SpacingValue - spacing value
type StringValue ¶
type StringValue struct {
Value string `xml:"val,attr,omitempty"`
}
StringValue - одиночное string значение
type TableBorder ¶
type TableBorder struct {
Value string `xml:"val,attr"`
Color string `xml:"color,attr"`
Size int64 `xml:"sz,attr"`
Space int64 `xml:"space,attr"`
Shadow int64 `xml:"shadow,attr"`
Frame int64 `xml:"frame,attr"`
}
TableBorder in borders
type TableBorders ¶
type TableBorders struct {
Top TableBorder `xml:"top"`
Left TableBorder `xml:"left"`
Bottom TableBorder `xml:"bottom"`
Right TableBorder `xml:"right"`
InsideH *TableBorder `xml:"insideH,omitempty"`
InsideV *TableBorder `xml:"insideV,omitempty"`
}
TableBorders in table
type TableCell ¶
type TableCell struct {
Params TableCellParams `xml:"tcPr"`
Items []DocItem
}
TableCell - table cell
type TableCellParams ¶
type TableCellParams struct {
Width *WidthValue `xml:"tcW,omitempty"`
Borders *TableBorders `xml:"tcBorders,omitempty"`
Shadow *ShadowValue `xml:"shd,omitempty"`
Margins *Margins `xml:"tcMar,omitempty"`
VerticalAlign *StringValue `xml:"vAlign,omitempty"`
VerticalMerge *StringValue `xml:"vMerge,omitempty"`
GridSpan *IntValue `xml:"gridSpan,omitempty"`
HideMark *EmptyValue `xml:"hideMark,omitempty"`
NoWrap *EmptyValue `xml:"noWrap,omitempty"`
}
TableCellParams - cell params
type TableGrid ¶
type TableGrid struct {
Cols []*WidthValue `xml:"gridCol,omitempty"`
}
TableGrid - Grid table
type TableItem ¶
type TableItem struct {
Params TableParams `xml:"tblPr"`
Grid TableGrid `xml:"tblGrid"`
Rows []*TableRow `xml:"tr,omitempty"`
}
TableItem - элемент таблици
type TableLayout ¶
type TableLayout struct {
Type string `xml:"type,attr"`
}
TableLayout - layout params
type TableParams ¶
type TableParams struct {
Width *WidthValue `xml:"tblW,omitempty"`
Jc *StringValue `xml:"jc,omitempty"`
Ind *WidthValue `xml:"tblInd,omitempty"`
Borders *TableBorders `xml:"tblBorders,omitempty"`
Shadow *ShadowValue `xml:"shd,omitempty"`
Layout *TableLayout `xml:"tblLayout,omitempty"`
DocGrid *IntValue `xml:"docGrid,omitempty"`
}
TableParams - Params table
type TableParamsEx ¶
type TableParamsEx struct {
Shadow ShadowValue `xml:"shd"`
}
TableParamsEx - Other params table
type TableRow ¶
type TableRow struct {
OtherParams *TableParamsEx `xml:"tblPrEx,omitempty"`
Params TableRowParams `xml:"trPr"`
Cells []*TableCell `xml:"tc,omitempty"`
}
TableRow - row in table
type TableRowParams ¶
type TableRowParams struct {
Height HeightValue `xml:"trHeight"`
IsHeader bool
}
TableRowParams - row params
type WidthValue ¶
WidthValue - значение длины