template

package
v0.0.0-...-71c6e05 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chronicle

type Chronicle struct {
	ID            string
	Description   string
	Parent        string
	DisplayParent string
	Aspectratio   string
	Flags         []string
	Parameters    param.Store
	Presets       preset.Store
	Canvas        canvas.Store
	Content       content.ListStore
	// contains filtered or unexported fields
}

Chronicle is the new approach for the Chronicle Template

func NewChronicleTemplate

func NewChronicleTemplate(filename string) (ct Chronicle)

NewChronicleTemplate returns a new ChronicleTemplate object.

func (*Chronicle) Describe

func (ct *Chronicle) Describe(verbose bool) (result string)

Describe returns a short textual description of a single chronicle template. It returns the description as a multi-line string.

func (*Chronicle) DescribeParams

func (ct *Chronicle) DescribeParams(verbose bool) (result string)

DescribeParams returns a textual description of the parameters expected by this chronicle template. It returns the description as a multi-line string.

func (*Chronicle) GenerateCsvFile

func (ct *Chronicle) GenerateCsvFile(filename string, separator rune, argStore *args.Store, cmdFlags [][]string) (err error)

GenerateCsvFile creates a CSV file out of the current chronicle template than can be used as input for the "batch fill" command

func (*Chronicle) GenerateOutput

func (ct *Chronicle) GenerateOutput(stamp *stamp.Stamp, argStore *args.Store) (err error)

GenerateOutput adds the content of this chronicle template to the provided stamp.

func (*Chronicle) GetExampleArguments

func (ct *Chronicle) GetExampleArguments() (result []string)

GetExampleArguments returns an array containing all keys and example values for all parameters. The result can be passed to the ArgStore.

func (*Chronicle) IsValid

func (ct *Chronicle) IsValid() (err error)

IsValid checks whether a given chronicle is valid. This should only be called after resolve() was called on this template.

type Store

type Store map[string]*Chronicle // Store as ptrs so that it is easier to modify them do things like aliasing

Store stores multiple ChronicleTemplates and provides means to retrieve them by name.

func GetStore

func GetStore() (ts *Store, err error)

GetStore returns a template store that is already filled with all templates contained in the main template directory. If some error showed up during reading and parsing files, resolving dependencies etc, then nil is returned together with an error.

func (*Store) Get

func (s *Store) Get(id string) (ct *Chronicle, exists bool)

Get returns the ChronicleTemplate matching the provided id.

func (*Store) ListTemplates

func (s *Store) ListTemplates() (result string)

ListTemplates lists the available templates. Result is returned as multi-line string.

func (*Store) SearchForTemplates

func (s *Store) SearchForTemplates(keywords ...string) (result string, foundMatch bool)

SearchForTemplates takes one or multiple keywords and searches for templates where all these keywords are included in the description or the id. The search is case-insensitive. Result is returned as multi-line string.

Jump to

Keyboard shortcuts

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