Documentation
¶
Index ¶
- Constants
- func SplitLines(s string) []string
- type Caption
- type CaptionContent
- type CaptionLineBreak
- type CaptionReader
- type CaptionSet
- func (c CaptionSet) AddStyle(style StyleProps)
- func (c CaptionSet) GetCaptions(lang string) []*Caption
- func (c CaptionSet) GetStyle(id string) StyleProps
- func (c CaptionSet) GetStyles() []StyleProps
- func (c CaptionSet) IsEmpty() bool
- func (c CaptionSet) Languages() []string
- func (c CaptionSet) SetCaptions(lang string, captions []*Caption)
- type CaptionStyle
- type CaptionText
- type CaptionWriter
- type StyleProps
Constants ¶
View Source
const DefaultLang = "en-US"
Variables ¶
This section is empty.
Functions ¶
func SplitLines ¶
Types ¶
type Caption ¶
type Caption struct {
Start *float64
End *float64
Nodes []CaptionContent
Style StyleProps
}
func NewCaption ¶
func NewCaption(start, end *float64, nodes []CaptionContent, style StyleProps) Caption
func (Caption) FormatEndWithSeparator ¶
func (Caption) FormatStart ¶
func (Caption) FormatStartWithSeparator ¶
type CaptionContent ¶
func NewCaptionStyle ¶
func NewCaptionStyle(start bool, style StyleProps) CaptionContent
func NewCaptionText ¶
func NewCaptionText(text string) CaptionContent
func NewLineBreak ¶
func NewLineBreak() CaptionContent
type CaptionLineBreak ¶
type CaptionLineBreak struct {
// contains filtered or unexported fields
}
func (CaptionLineBreak) Content ¶
func (c CaptionLineBreak) Content() string
func (CaptionLineBreak) LineBreak ¶
func (c CaptionLineBreak) LineBreak() bool
type CaptionReader ¶
type CaptionReader interface {
Read([]byte) (*CaptionSet, error)
Detect([]byte) bool
}
type CaptionSet ¶
type CaptionSet struct {
Styles map[string]StyleProps
Captions map[string][]*Caption
}
func NewCaptionSet ¶
func NewCaptionSet() *CaptionSet
func (CaptionSet) AddStyle ¶
func (c CaptionSet) AddStyle(style StyleProps)
func (CaptionSet) GetCaptions ¶
func (c CaptionSet) GetCaptions(lang string) []*Caption
func (CaptionSet) GetStyle ¶
func (c CaptionSet) GetStyle(id string) StyleProps
func (CaptionSet) GetStyles ¶
func (c CaptionSet) GetStyles() []StyleProps
func (CaptionSet) IsEmpty ¶
func (c CaptionSet) IsEmpty() bool
func (CaptionSet) Languages ¶
func (c CaptionSet) Languages() []string
func (CaptionSet) SetCaptions ¶
func (c CaptionSet) SetCaptions(lang string, captions []*Caption)
type CaptionStyle ¶
type CaptionStyle struct {
Props StyleProps
Start bool
// contains filtered or unexported fields
}
func (CaptionStyle) Content ¶
func (c CaptionStyle) Content() string
func (CaptionStyle) Style ¶
func (c CaptionStyle) Style() bool
type CaptionText ¶
type CaptionText struct {
// contains filtered or unexported fields
}
func (CaptionText) Content ¶
func (c CaptionText) Content() string
func (CaptionText) Text ¶
func (CaptionText) Text() bool
type CaptionWriter ¶
type CaptionWriter interface {
Write(*CaptionSet) ([]byte, error)
}
type StyleProps ¶
type StyleProps struct {
ID string
Class string
TextAlign string
FontFamily string
FontSize string
Color string
Italics bool
Bold bool
Underline bool
}
FIXME This is a simple placeholder for style types, this can be better represented but I need to implement more caption types first(this was written with just dfxp)
func DefaultStyleProps ¶
func DefaultStyleProps() StyleProps
func (StyleProps) String ¶
func (s StyleProps) String() string
Click to show internal directories.
Click to hide internal directories.