docb

package
v0.0.0-...-d782889 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

document constructor

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(cfile, ifile, ofile string, tfile string) error

Types

type BorderStyle

type BorderStyle struct {
	Style     wml.ST_Border
	Color     color.Color
	Thickness measurement.Distance
}

type Borders

type Borders struct {
	Bottom           *BorderStyle
	Left             *BorderStyle
	Right            *BorderStyle
	Top              *BorderStyle
	InsideHorizontal *BorderStyle
	InsideVertical   *BorderStyle
}

func (*Borders) SetBorderAll

func (b *Borders) SetBorderAll(t wml.ST_Border, c color.Color, thickness measurement.Distance) *Borders

func (*Borders) SetBorderBottom

func (b *Borders) SetBorderBottom(t wml.ST_Border, c color.Color, thickness measurement.Distance) *Borders

func (*Borders) SetBorderInsideHorizontal

func (b *Borders) SetBorderInsideHorizontal(t wml.ST_Border, c color.Color, thickness measurement.Distance) *Borders

func (*Borders) SetBorderInsideVertical

func (b *Borders) SetBorderInsideVertical(t wml.ST_Border, c color.Color, thickness measurement.Distance) *Borders

func (*Borders) SetBorderLeft

func (b *Borders) SetBorderLeft(t wml.ST_Border, c color.Color, thickness measurement.Distance) *Borders

func (*Borders) SetBorderRight

func (b *Borders) SetBorderRight(t wml.ST_Border, c color.Color, thickness measurement.Distance) *Borders

func (*Borders) SetBorderRightBottom

func (b *Borders) SetBorderRightBottom(t wml.ST_Border, c color.Color, thickness measurement.Distance) *Borders

func (*Borders) SetBorderTop

func (b *Borders) SetBorderTop(t wml.ST_Border, c color.Color, thickness measurement.Distance) *Borders

func (*Borders) SetBorderTopBottom

func (b *Borders) SetBorderTopBottom(t wml.ST_Border, c color.Color, thickness measurement.Distance) *Borders

func (*Borders) SetBorderTopLeft

func (b *Borders) SetBorderTopLeft(t wml.ST_Border, c color.Color, thickness measurement.Distance) *Borders

type Builder

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

type CellBuilder

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

func (*CellBuilder) AddParagraph

func (c *CellBuilder) AddParagraph(nextBuilder ...func(*ParagraphBuilder)) *CellBuilder

func (*CellBuilder) Build

func (c *CellBuilder) Build()

func (*CellBuilder) SetAlignment

func (c *CellBuilder) SetAlignment(align wml.ST_Jc) *CellBuilder

func (*CellBuilder) SetBackgroundColor

func (c *CellBuilder) SetBackgroundColor(color color.Color) *CellBuilder

func (*CellBuilder) SetBold

func (c *CellBuilder) SetBold() *CellBuilder

func (*CellBuilder) SetBorders

func (c *CellBuilder) SetBorders(callback func(*Borders)) *CellBuilder

func (*CellBuilder) SetBullet

func (*CellBuilder) SetColspan

func (c *CellBuilder) SetColspan(cols int) *CellBuilder

func (*CellBuilder) SetFontFamily

func (c *CellBuilder) SetFontFamily(ff string) *CellBuilder

func (*CellBuilder) SetFontSize

func (c *CellBuilder) SetFontSize(fs int) *CellBuilder

func (*CellBuilder) SetText

func (c *CellBuilder) SetText(v interface{}) *CellBuilder

func (*CellBuilder) SetWidthPercent

func (c *CellBuilder) SetWidthPercent(w float64) *CellBuilder

type Configuration

type Configuration struct {
	FontFamily string
	FontSize   int
	ImagePath  string
}

type DocumentBuilder

type DocumentBuilder struct {
	Document *document.Document // allow outsider to custom document
	// contains filtered or unexported fields
}

--------------------------------------------------------------------------

Document

--------------------------------------------------------------------------

func NewDocumentBuilder

func NewDocumentBuilder(file string, cfg ...Configuration) (*DocumentBuilder, error)

func (*DocumentBuilder) AddParagraph

func (d *DocumentBuilder) AddParagraph(nextBuilders ...func(*ParagraphBuilder)) *DocumentBuilder

func (*DocumentBuilder) AddTable

func (d *DocumentBuilder) AddTable(nextBuilder func(*TableBuilder)) *DocumentBuilder

func (*DocumentBuilder) Build

func (d *DocumentBuilder) Build()

type Env

type Env struct {
	Sources   interface{} `yaml:"sources,omitempty"`
	Languages interface{} `yaml:"langs,omitempty"`
}

type Feature

type Feature struct {
	Id         interface{} `yaml:"id,omitempty"`
	Name       interface{} `yaml:"name,omitempty"`
	Mode       interface{} `yaml:"mode,omitempty"`
	Desc       interface{} `yaml:"desc,omitempty"`
	Env        Env         `yaml:"env,omitempty"`
	Amendment  interface{} `yaml:"amendment,omitempty"`
	Resources  []Resource  `yaml:"resources,omitempty"`
	Screens    []Screen    `yaml:"screens,omitempty"`
	Input      []Input     `yaml:"input,omitempty"`
	Parameters []Parameter `yaml:"parameters,omitempty"`
	Scenarios  []Scenario  `yaml:"scenarios,omitempty"`
	Others     Others      `yaml:"others,omitempty"`
	Tests      []Test      `yaml:"tests,omitempty"`
}

type Image

type Image struct {
	File  string `yaml:"file,omitempty"`
	Width int    `yaml:"width,omitempty"`
}

type ImageProperty

type ImageProperty struct {
	FilePath  string
	Width     float64
	Height    float64
	Alignment wml.ST_Jc
}

func (*ImageProperty) SetAlignment

func (p *ImageProperty) SetAlignment(align wml.ST_Jc) *ImageProperty

func (*ImageProperty) SetFile

func (p *ImageProperty) SetFile(path string) *ImageProperty

func (*ImageProperty) SetHeight

func (p *ImageProperty) SetHeight(value float64) *ImageProperty

func (*ImageProperty) SetWidth

func (p *ImageProperty) SetWidth(value float64) *ImageProperty

type Input

type Input struct {
	Name        interface{} `yaml:"name,omitempty"`
	Fields      interface{} `yaml:"fields,omitempty"`
	Constraints interface{} `yaml:"cons,omitempty"`
	Remarks     interface{} `yaml:"remarks,omitempty"`
}

type Module

type Module struct {
	Name     string    `yaml:"name,omitempty"`
	Features []Feature `yaml:"features,omitempty"`
}

type Others

type Others struct {
	Reference interface{} `yaml:"reference,omitempty"`
	Limits    interface{} `yaml:"limits,omitempty"`
	Program   interface{} `yaml:"program,omitempty"`
	Remarks   interface{} `yaml:"remarks,omitempty"`
}

type ParagraphBuilder

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

func (*ParagraphBuilder) AddImage

func (p *ParagraphBuilder) AddImage(set func(*ImageProperty)) *ParagraphBuilder

func (*ParagraphBuilder) Build

func (p *ParagraphBuilder) Build()

func (*ParagraphBuilder) SetAlignment

func (p *ParagraphBuilder) SetAlignment(align wml.ST_Jc) *ParagraphBuilder

func (*ParagraphBuilder) SetLineBreak

func (p *ParagraphBuilder) SetLineBreak() *ParagraphBuilder

func (*ParagraphBuilder) SetPageBreak

func (p *ParagraphBuilder) SetPageBreak() *ParagraphBuilder

func (*ParagraphBuilder) SetStyle

func (p *ParagraphBuilder) SetStyle(s string) *ParagraphBuilder

func (*ParagraphBuilder) SetText

func (p *ParagraphBuilder) SetText(s interface{}) *ParagraphBuilder

type Parameter

type Parameter struct {
	Field   interface{} `yaml:"field,omitempty"`
	Data    interface{} `yaml:"data,omitempty"`
	IO      interface{} `yaml:"io,omitempty"`
	Remarks interface{} `yaml:"remarks,omitempty"`
}

type ProgSpec

type ProgSpec struct {
	Modules []Module `yaml:"modules,omitempty"`
}

type Resource

type Resource struct {
	Name  interface{} `yaml:"name,omitempty"`
	Usage interface{} `yaml:"usage,omitempty"`
}

type RowBuilder

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

func NewRowBuilder

func NewRowBuilder(cfg *Configuration, d *document.Document, r document.Row) *RowBuilder

func (*RowBuilder) AddCell

func (r *RowBuilder) AddCell(nextBuilder func(*CellBuilder)) *RowBuilder

func (*RowBuilder) Build

func (r *RowBuilder) Build()

type Scenario

type Scenario struct {
	Name interface{} `yaml:"name,omitempty"`
	Desc []string    `yaml:"desc,omitempty"`
}

type Screen

type Screen struct {
	Id    interface{} `yaml:"id,omitempty"`
	Name  interface{} `yaml:"name,omitempty"`
	Image Image       `yaml:"image,omitempty"`
}

type TableBuilder

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

func (*TableBuilder) AddRow

func (t *TableBuilder) AddRow(nextBuilder func(*RowBuilder)) *TableBuilder

func (*TableBuilder) Build

func (t *TableBuilder) Build()

func (*TableBuilder) SetBorders

func (t *TableBuilder) SetBorders(callback func(*Borders)) *TableBuilder

func (*TableBuilder) SetCellSpacingAuto

func (t *TableBuilder) SetCellSpacingAuto() *TableBuilder

func (*TableBuilder) SetWidthPercent

func (t *TableBuilder) SetWidthPercent(value float64) *TableBuilder

type Test

type Test struct {
	Desc   interface{} `yaml:"desc,omitempty"`
	Expect interface{} `yaml:"expect,omitempty"`
	Actual interface{} `yaml:"actual,omitempty"`
}

Jump to

Keyboard shortcuts

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