Help us shape the future of Go! Take the 2026 Go Developer Survey

viewer

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package viewer writes a deck as one self-contained HTML page: the slides, their style sheet, and a small script to present them — keyboard and pointer navigation, fragmented lists, a slide per URL hash, and printing every slide on its own page. It plays the part of marp-cli's templates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Document

func Document(o Options) string

Document returns the page.

Types

type Bespoke added in v0.6.0

type Bespoke struct {
	// OSC is the on-screen controller (--bespoke.osc).
	OSC bool
	// Progress is the progress bar (--bespoke.progress).
	Progress bool
	// Transition plays the transitions of the deck with the View Transition
	// API where the browser has it (--bespoke.transition). Set it only for a
	// deck that has some: the page carries the script for it.
	Transition bool
}

Bespoke are marp-cli's --bespoke.* options.

func DefaultBespoke added in v0.6.0

func DefaultBespoke() Bespoke

DefaultBespoke are marp-cli's defaults: the controller, no progress bar, transitions.

type Meta

type Meta struct {
	Title, Description, Author, Keywords, URL, Image, Lang string
}

Meta is the page's metadata (marp-cli's title, description, author, keywords, url and image global directives).

type Options

type Options struct {
	Meta Meta
	// CSS is the packed theme style sheet.
	CSS string
	// Slides are the rendered slides, frames included.
	Slides []string
	// Bare leaves the script out: the slides stack vertically, as in
	// marp-cli's bare template.
	Bare bool
	// WatchWS, when not empty, is the address of the live reload socket the
	// page opens (see serve.Hub): a ws:// URL, or a path on the page's host.
	WatchWS string
	// Bespoke are the options of the presenting page (marp-cli's bespoke
	// template); the zero value is a page with none of them.
	Bespoke Bespoke
	// TransitionCSS is the keyframes of the built-in transitions the deck
	// uses, written after the transition styles (see deck.TransitionCSS).
	TransitionCSS string
}

Options configures Document.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL