ods

package
v0.27.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FloatType for numerical data
	FloatType = ValueType('f')
	// DateType for dates
	DateType = ValueType('d')
	// StringType for everything else
	StringType = ValueType('s')
)

Variables

This section is empty.

Functions

func AcquireWriter

func AcquireWriter(w io.Writer) *qt.Writer

AcquireWriter wraps the given io.Writer to be usable with quicktemplates.

func BeginSheets

func BeginSheets() string

func EndSheets

func EndSheets() string

func EndTable

func EndTable() string

func ReleaseWriter

func ReleaseWriter(W *qt.Writer)

ReleaseWriter returns the *quicktemplate.Writer to the pool.

func StreamBeginSheets

func StreamBeginSheets(qw422016 *qt422016.Writer)

func StreamEndSheets

func StreamEndSheets(qw422016 *qt422016.Writer)

func StreamEndTable

func StreamEndTable(qw422016 *qt422016.Writer)

func StreamXML

func StreamXML(qw422016 *qt422016.Writer, s string)

func WriteBeginSheets

func WriteBeginSheets(qq422016 qtio422016.Writer)

func WriteEndSheets

func WriteEndSheets(qq422016 qtio422016.Writer)

func WriteEndTable

func WriteEndTable(qq422016 qtio422016.Writer)

func WriteXML

func WriteXML(qq422016 qtio422016.Writer, s string)

func XML

func XML(s string) string

Types

type Cell

type Cell struct {
	Style string
	Value string
	Type  ValueType
}

Cell with style, type and value.

func (Cell) StreamXML

func (cell Cell) StreamXML(qw422016 *qt422016.Writer)

func (Cell) WriteXML

func (cell Cell) WriteXML(qq422016 qtio422016.Writer)

func (Cell) XML

func (cell Cell) XML() string

type ODSWriter

type ODSWriter struct {
	// contains filtered or unexported fields
}

ODSWriter writes content.xml of ODS zip.

func NewWriter

func NewWriter(w io.Writer) (*ODSWriter, error)

NewWriter returns a content writer and a zip closer for an ods file.

func (*ODSWriter) Close

func (ow *ODSWriter) Close() error

Close the ODSWriter.

func (*ODSWriter) QTWriter

func (ow *ODSWriter) QTWriter() *qt.Writer

type Row

type Row struct {
	Style string
	Cells []Cell
}

Row with style.

func (Row) StreamXML

func (row Row) StreamXML(qw422016 *qt422016.Writer)

func (Row) WriteXML

func (row Row) WriteXML(qq422016 qtio422016.Writer)

func (Row) XML

func (row Row) XML() string

type Style

type Style struct {
	XMLName         xml.Name `xml:"style"`
	Name            string   `xml:"name,attr"`
	Family          string   `xml:"family,attr"`
	MasterPageName  string   `xml:"master-page-name,attr"`
	DataStyleName   string   `xml:"data-style-name,attr"`
	TableProperties struct {
		Display     string `xml:"display,attr"`
		WritingMode string `xml:"writing-mode,attr"`
	} `xml:"table-properties"`
	TextProperties struct {
		FontWeight           string `xml:"font-weight,attr"`
		FontStyle            string `xml:"font-style,attr"`
		TextPosition         string `xml:"text-position,attr"`
		TextLineThroughType  string `xml:"text-line-through-type,attr"`
		TextLineThroughStyle string `xml:"text-line-through-style,attr"`
		TextUnderlineType    string `xml:"text-underline-type,attr"`
		TextUnderlineStyle   string `xml:"text-underline-style,attr"`
		TextUnderlineWidth   string `xml:"text-underline-width,attr"`
		Display              string `xml:"display,attr"`
		TextUnderlineColor   string `xml:"text-underline-color,attr"`
		TextUnderlineMode    string `xml:"text-underline-mode,attr"`
		FontSize             string `xml:"font-size,attr"`
		Color                string `xml:"color,attr"`
		FontFamily           string `xml:"font-family,attr"`
	} `xml:"text-properties"`
	TableRowProperties struct {
		RowHeight           string `xml:"row-height,attr"`
		UseOptimalRowHeight string `xml:"use-optimal-row-height,attr"`
	} `xml:"table-row-properties"`
	TableColumnProperties struct {
		ColumnWidth           string `xml:"column-width,attr"`
		UseOptimalColumnWidth string `xml:"use-optimal-column-width,attr"`
	} `xml:"table-column-properties"`
	TableCellProperties struct {
		BackgroundColor          string `xml:"background-color,attr"`
		BorderTop                string `xml:"border-top,attr"`
		BorderBottom             string `xml:"border-bottom,attr"`
		BorderLeft               string `xml:"border-left,attr"`
		BorderRight              string `xml:"border-right,attr"`
		DiagonalBlTr             string `xml:"diagonal-bl-tr,attr"`
		DiagonalTlBr             string `xml:"diagonal-tl-br,attr"`
		VerticalAlign            string `xml:"vertical-align,attr"`
		WrapOption               string `xml:"wrap-option,attr"`
		ShrinkToFit              string `xml:"shrink-to-fit,attr"`
		WritingMode              string `xml:"writing-mode,attr"`
		GlyphOrientationVertical string `xml:"glyph-orientation-vertical,attr"`
		CellProtect              string `xml:"cell-protect,attr"`
		RotationAlign            string `xml:"rotation-align,attr"`
		RotationAngle            string `xml:"rotation-angle,attr"`
		PrintContent             string `xml:"print-content,attr"`
		DecimalPlaces            string `xml:"decimal-places,attr"`
		TextAlignSource          string `xml:"text-align-source,attr"`
		RepeatContent            string `xml:"repeat-content,attr"`
	} `xml:"table-cell-properties"`
	ParagraphProperties struct {
		WritingModeAutomatic string `xml:"writing-mode-automatic,attr"`
		MarginLeft           string `xml:"margin-left,attr"`
	} `xml:"paragraph-properties"`
}

Style information - generated from content.xml with github.com/miek/zek/cmd/zek.

type Table

type Table struct {
	Name     string
	Style    string
	Heading  Row
	ColCount int
}

Table or sheet.

func (Table) Begin

func (t Table) Begin() string

func (Table) StreamBegin

func (t Table) StreamBegin(qw422016 *qt422016.Writer)

func (Table) WriteBegin

func (t Table) WriteBegin(qq422016 qtio422016.Writer)

type ValueType

type ValueType uint8

ValueType is the cell's value's type.

func (ValueType) String

func (v ValueType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL