Documentation ¶
Index ¶
- Constants
- func IsKnownFormat(f string) bool
- func IsKnownType(d string) bool
- func Render(l *Layout, vars Vars, renderCtx *RenderContext) ([]byte, error)
- func RequiresUpload(varType string) bool
- func Validate(layout *Layout) error
- type Layout
- type NoopStore
- type RenderContext
- type Store
- type Variable
- type Vars
Constants ¶
View Source
const ( TypeString = "string" TypeNumber = "number" TypeBool = "bool" TypeImage = "image" TypeVideo = "video" TypeColor = "color" )
View Source
const ( FormatMarkdown = "markdown" FormatHTML = "html" FormatPlain = "plain" )
Variables ¶
This section is empty.
Functions ¶
func IsKnownFormat ¶
func IsKnownType ¶
func Render ¶
func Render(l *Layout, vars Vars, renderCtx *RenderContext) ([]byte, error)
Render renders the layout l.
func RequiresUpload ¶
Types ¶
type Layout ¶
type Layout struct { Name string `hcl:"name,label" json:"name"` DisplayName string `hcl:"displayName" json:"displayName"` File string `hcl:"file,optional" json:"file,omitempty"` Content string `hcl:"content,optional" json:"content,omitempty"` Description string `hcl:"description,optional" json:"description,omitempty"` Variables []Variable `hcl:"variable,block" json:"variables"` PreviewIcon string `hcl:"previewIcon" json:"previewIcon"` // contains filtered or unexported fields }
Layout defines a new slide layout.
func ParseFile ¶
ParseFile parses a layout from fpath. All files referenced in the layout are relative to the parent directory of fpath.
type RenderContext ¶
type Store ¶
type Variable ¶
type Variable struct { Name string `hcl:"name,label" json:"name"` Type string `hcl:"type" json:"type"` Description string `hcl:"description,optional" json:"description,omitempty"` Required bool `hcl:"required,optional" json:"required,omitempty"` Format string `hcl:"format,optional" json:"format,omitempty"` Multiline bool `hcl:"multiline,optional" json:"multiline,omitempty"` DisplayName string `hcl:"displayName,optional" json:"displayName,omitempty"` Choices []string `hcl:"choices,optional" json:"choices,omitempty"` Multi bool `hcl:"multi,optional" json:"multi,omitempty"` }
Variable defines an input variable for a template layout.
Click to show internal directories.
Click to hide internal directories.