Documentation
¶
Index ¶
- Constants
- Variables
- type BlockQuote
- type Body
- type Bullet
- type Fragment
- type Image
- func (i *Image) Bytes() []byte
- func (i *Image) Checksum() uint32
- func (i *Image) Dimensions() (w, h int, err error)
- func (i *Image) Image() (image.Image, error)
- func (i *Image) IsSVG() bool
- func (i *Image) MarshalJSON() (_ []byte, err error)
- func (i *Image) PHash() (_ *goimagehash.ImageHash, err error)
- func (i *Image) RasterPNG(scale float64) ([]byte, error)
- func (i *Image) SetLink(link string)
- func (i *Image) String() string
- func (i *Image) UnmarshalJSON(data []byte) (err error)
- type MIMEType
- type Paragraph
- type Slide
- type Slides
- type Table
- type TableCell
- type TableRow
Constants ¶
const ( Name = "slidown" Version = "0.0.8" )
const ( // StyleDel is the style name applied to GFM strikethrough (`~~`) and the // HTML <del> element. StyleDel = "del" )
StyleName constants for inline-syntax styles shared with the markdown parser.
Variables ¶
var Revision = "HEAD"
Functions ¶
This section is empty.
Types ¶
type BlockQuote ¶
type BlockQuote struct {
Paragraphs []*Paragraph `json:"paragraphs,omitempty"`
Nesting int `json:"nesting,omitempty"`
}
func (*BlockQuote) String ¶
func (b *BlockQuote) String() string
type Body ¶
type Body struct {
Paragraphs []*Paragraph `json:"paragraphs,omitempty"`
}
Body represents the content body of a slide.
type Fragment ¶
type Fragment struct {
Value string `json:"value"`
Bold bool `json:"bold,omitempty"`
Italic bool `json:"italic,omitempty"`
Link string `json:"link,omitempty"`
Code bool `json:"code,omitempty"`
StyleName string `json:"style_name,omitempty"`
}
Fragment represents a text fragment within a paragraph.
func (*Fragment) StylesEqual ¶
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
func NewImageFromMarkdown ¶
func (*Image) Dimensions ¶ added in v0.0.8
func (*Image) MarshalJSON ¶
MarshalJSON and UnmarshalJSON are defined for cloning data and for similarity comparisons of `slide` structures.
func (*Image) RasterPNG ¶ added in v0.0.8
RasterPNG renders the image to PNG bytes. The scale factor applies only to SVGs (rendered at scale × their intrinsic size); for raster inputs (PNG/JPEG/ GIF) scale is ignored and the source is re-encoded as PNG at its native size. For SVGs it is a best-effort raster produced by the pure-Go oksvg rasterizer, which does not support every SVG feature (notably filter, clipPath, mask, embedded <image>, foreignObject and <text>); such parts may be omitted. It is intended only as a compatibility fallback for viewers that can't render the embedded native SVG (which PowerPoint 2016+ uses as the primary rendering).
func (*Image) UnmarshalJSON ¶
type Paragraph ¶
type Paragraph struct {
Fragments []*Fragment `json:"fragments,omitempty"`
Bullet Bullet `json:"bullet,omitempty"`
Nesting int `json:"nesting,omitempty"`
}
Paragraph represents a paragraph within a slide body.
type Slide ¶
type Slide struct {
Layout string `json:"layout"`
Freeze bool `json:"freeze,omitempty"`
Skip bool `json:"skip,omitempty"`
// Key is an opaque, stable per-page identifier (from the markdown page
// config) used to match a slide to its existing counterpart across inserts,
// deletions and reordering during an incremental rebuild. It is identity,
// not content, so it is excluded from the content fingerprint.
Key string `json:"-"`
// TitleSlot reports that the slide occupies the deck's title-layout slot
// (the first rendered slide) under the built-in first-slide layout default.
// It only matters when Layout is empty: it is folded into the content
// fingerprint so a slide that moves into or out of the first position — and
// therefore switches between the title and content default layout — is
// re-rendered instead of being reused verbatim with a stale layout. It is
// identity-adjacent, not authored content, so it is excluded from JSON.
TitleSlot bool `json:"-"`
Titles []string `json:"titles,omitempty"`
TitleBodies []*Body `json:"title_bodies,omitempty"`
Subtitles []string `json:"subtitles,omitempty"`
SubtitleBodies []*Body `json:"subtitle_bodies,omitempty"`
Bodies []*Body `json:"bodies,omitempty"`
Images []*Image `json:"images,omitempty"`
BlockQuotes []*BlockQuote `json:"block_quotes,omitempty"`
Tables []*Table `json:"tables,omitempty"`
SpeakerNote string `json:"speaker_note,omitempty"`
}
func (*Slide) Fingerprint ¶
Fingerprint returns the serialized slide signature embedded into the generated .pptx so an incremental rebuild can detect whether the source for a slide changed, without reverse-parsing the output.
Non-image content is captured by an exact hash, while images are recorded by their perceptual hash (falling back to a content checksum when a perceptual hash cannot be computed). Image comparison is order-independent and tolerant of recompression, so reordering or recompressing images on a slide does not force a regenerate.
func (*Slide) MatchesFingerprint ¶
MatchesFingerprint reports whether this slide's source is equivalent to the one captured by a previously embedded fingerprint: non-image content must match exactly and the images must match as an order-independent, perceptually compared set.
Directories
¶
| Path | Synopsis |
|---|---|
|
slidown
command
|
|
|
Package md provides functionality for parsing markdown into slides.
|
Package md provides functionality for parsing markdown into slides. |
|
Package pptx provides a pure-Go writer for PowerPoint (.pptx / OOXML) presentations.
|
Package pptx provides a pure-Go writer for PowerPoint (.pptx / OOXML) presentations. |
|
Package render maps slidown's internal slide model (the slidown package types produced by the md parser) onto the pptx package's serializable model.
|
Package render maps slidown's internal slide model (the slidown package types produced by the md parser) onto the pptx package's serializable model. |