Documentation
¶
Overview ¶
Package export turns a built deck into images and documents without a browser: go-webengine lays each slide out and paints it, go-pdfkit writes the PDF. Marp CLI drives a headless Chrome for the same outputs.
The slides are rendered in the box frame (deck.FrameBox), which needs neither <foreignObject> nor generated content from the layout engine.
Index ¶
- func JPEG(w io.Writer, img image.Image, opts Options) error
- func PDF(w io.Writer, b *slides.Build, images []*image.RGBA) error
- func PNG(w io.Writer, img image.Image) error
- func PPTX(w io.Writer, b *slides.Build, images []*image.RGBA) error
- func Rasterize(ctx context.Context, b *slides.Build, opts Options) ([]*image.RGBA, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PDF ¶
PDF writes one page per slide. A page is the slide's size, a CSS pixel being 3/4 of a point, as Chrome prints Marp's @page size. The outline lists each slide and, under it, its headings (marp --pdf-outlines).
Types ¶
type Options ¶
type Options struct {
// BaseURL resolves the deck's relative URLs (images, backgrounds):
// typically "file:///path/to/deck/dir/".
BaseURL string
// NoFonts leaves out the fonts bundled for the built-in themes.
NoFonts bool
// JPEGQuality is the JPEG quality, 1 to 100; 0 means 85, marp-cli's.
JPEGQuality int
// Scale is the number of device pixels per CSS pixel: 2 renders a
// 1280×720 slide as 2560×1440, text and vectors drawn at that density
// rather than enlarged. 0 means 1 (marp-cli's --image-scale).
Scale float64
// FileRoot, when set, lets the slides load file: URLs from under this
// directory and nowhere else; empty refuses every local file, as
// marp-cli does without --allow-local-files.
FileRoot string
}
Options configures the export.
Click to show internal directories.
Click to hide internal directories.