Documentation
¶
Index ¶
- Variables
- func DrawPresenter(img draw.Image, bounds image.Rectangle, pres *Presentation, index int)
- type Alignment
- type FontCollection
- type ImageSlide
- type Margins
- type Markup
- type MarkupAttribute
- type MarkupBuilder
- type MarkupText
- type PresConfig
- type Presentation
- type Slide
- type SlideContent
- type VerticalAlignment
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidHexColor = errors.New("invalid hex color") ErrUnknownColor = errors.New("unknown color name") )
Functions ¶
func DrawPresenter ¶
Types ¶
type FontCollection ¶
type ImageSlide ¶
type ImageSlide struct {
// contains filtered or unexported fields
}
func NewImageSlide ¶
func NewImageSlide(pat string) (*ImageSlide, error)
func (*ImageSlide) Draw ¶
func (s *ImageSlide) Draw(img draw.Image, bounds image.Rectangle, attr PresConfig)
type Markup ¶
type Markup struct {
Attr MarkupAttribute /* attributes of following text */
Text string /* actual content */
}
type MarkupAttribute ¶
type MarkupAttribute int
const ( Bold MarkupAttribute = 1 << iota Italic Underline Strikethrough Code BigText NoWrap )
type MarkupBuilder ¶
type MarkupBuilder struct {
// contains filtered or unexported fields
}
ParseMarkup parses a limited subset of Markdown into MarkupText.
Supported:
- Big: ==text==
- Code: `code`
- Bold: **text**
- Italic: *text* or _text_
- Underline: __text__
- Strikethrough: ~~text~~
- No Wrap: @text@
func (*MarkupBuilder) Dirty ¶
func (b *MarkupBuilder) Dirty() bool
func (*MarkupBuilder) Feed ¶
func (b *MarkupBuilder) Feed(content string)
func (*MarkupBuilder) Reset ¶
func (b *MarkupBuilder) Reset()
func (*MarkupBuilder) Text ¶
func (b *MarkupBuilder) Text() MarkupText
type MarkupText ¶
type MarkupText []Markup
func (MarkupText) Draw ¶
func (m MarkupText) Draw(img draw.Image, bounds image.Rectangle, cfg PresConfig)
func (MarkupText) String ¶
func (m MarkupText) String() string
type PresConfig ¶
type PresConfig struct {
Foreground image.Image /* uniform */
Background image.Image /* uniform */
Fonts FontCollection
MonoFonts FontCollection
Margin Margins
Align Alignment
VAlign VerticalAlignment
TabSize int
NewlineSpacing float64
BigText float64
FontSize float64 /* percent of diagonal px */
}
func (*PresConfig) AddAttribute ¶
func (c *PresConfig) AddAttribute(str string) error
type Presentation ¶
type Presentation struct {
Conf PresConfig
Slides []Slide
}
func ParsePresentation ¶
func ParsePresentation(r io.Reader) (*Presentation, error)
type Slide ¶
type Slide struct {
Conf PresConfig
Notes string
Content []SlideContent
}
func FinalSlide ¶
func FinalSlide(cfg PresConfig) Slide
type SlideContent ¶
type SlideContent interface {
Draw(img draw.Image, bounds image.Rectangle, attr PresConfig)
}
type VerticalAlignment ¶
type VerticalAlignment int
const ( Top VerticalAlignment = iota Middle Bottom )
Click to show internal directories.
Click to hide internal directories.