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

deck

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

Package deck is the slide deck deliverable: decks a buyer presents from PowerPoint, Keynote or Google Slides, such as a yearly safety briefing, a workshop or a quiz night, sold for what they say as much as how they look. One Markdown file per deck and language and a theme from the concept compile to .pptx files whose look lives in a slide master and its layouts, with speaker notes, a notes PDF on paper and a quiz sheet; every compile measures each slide's text with the fonts, and a release prints the slides in Chrome as PowerPoint lays them out.

Index

Constants

View Source
const (
	Dir         = "deliverables/deck"
	ConceptFile = Dir + "/concept.md"
	FontsDir    = Dir + "/fonts"
	ImagesDir   = Dir + "/images"
	ListingFile = Dir + "/listing.md"
)

The layout under deliverables/deck.

View Source
const (
	RuleConfig   = "deck.config"
	RuleConcept  = "deck.concept"
	RuleFonts    = "deck.fonts"
	RuleSource   = "deck.source"
	RuleDesign   = "deck.design"
	RuleContent  = "deck.content"
	RuleLayout   = "deck.layout"
	RuleDelivery = "deck.delivery"
	RuleListing  = "deck.listing"
	RuleChannels = "deck.channels"
)

Rule IDs.

View Source
const (
	LayoutCover     = "cover"     // the first slide: title and subtitle on the accent
	LayoutSection   = "section"   // a # heading: a chapter divider
	LayoutContent   = "content"   // title and one body
	LayoutTwo       = "two"       // title and two columns
	LayoutPicture   = "picture"   // title and one picture
	LayoutStatement = "statement" // title and one quote or key message
)

Slide layouts: what a slide's content asks for, named as PowerPoint lists them, so a buyer finds the same layout for a new slide.

View Source
const (
	Para      = markup.Para
	Heading   = markup.Heading
	Title     = markup.Title
	Subtitle  = markup.Subtitle
	List      = markup.List
	TableKind = markup.TableKind
	ImageKind = markup.ImageKind
	PageBreak = markup.PageBreak
	Ornament  = markup.Ornament
	Box       = markup.Box
	Columns   = markup.Columns
	Form      = markup.Form
	Signature = markup.Signature
	Notes     = markup.Notes
)

Block kinds.

Variables

View Source
var DeckColumns = []string{"Deck", "Job"}

DeckColumns are the columns of the Decks table.

View Source
var Papers = paper.Office

Papers are the sizes speaker notes print on.

View Source
var Sections = []concept.SectionSpec{
	{Name: "Buyer"}, {Name: "Promise"}, {Name: "Decks"}, {Name: "Look"}, {Name: "Changelog", Optional: true},
}

Sections of the deck concept, in order.

Functions

func CopyLink(url string) string

CopyLink turns a Google Slides master's address into the link that makes the buyer's own copy.

func Distribution

func Distribution(r Report, files []deliver.File, data map[string][]byte, images []Image, pending bool, day string) (map[string][]byte, []string, []diagnostic.Diagnostic)

Distribution assembles the shop packages: every edition's ZIP once, the images, a guide per shop and the README.

func DownloadPage

func DownloadPage(r Report, files []deliver.File) []byte

DownloadPage renders the unlisted download page: the Google Slides copy links first, then the files.

func Facts

func Facts(b Built) string

Facts is a built deck in a line, in its language: slides, minutes, notes, quiz.

func PaperPixels

func PaperPixels(paper string) (int64, int64)

PaperPixels is a paper in CSS pixels.

func Present

func Present(p project.Project) bool

Present reports whether the project has deliverables/deck.

func Rules

func Rules() []diagnostic.RuleInfo

Rules describes every deck rule for the catalog.

func ShotPixels

func ShotPixels() (int64, int64)

ShotPixels is a slide in CSS pixels: 960 pt at 96 dpi.

Types

type Block

type Block = markup.Block

The Markdown model decks share with every editable deliverable.

type Built

type Built struct {
	Edition Edition
	Deck    *Deck
	Name    string // the file name buyers see: the deck's title
	Key     string // the input key it is stamped with
	Data    []byte
}

Built is one .pptx of one edition.

func (Built) PrintKey

func (b Built) PrintKey(p Print) string

PrintKey is the key of one print of a built deck.

func (Built) Prints

func (b Built) Prints() []Print

Prints are the PDFs a built deck ships: the slides, the notes on each paper, and a quiz sheet on each paper when the deck asks questions.

type Config

type Config struct {
	Path, Offer, Language, Sell, Version string
	Papers                               []string          // the notes' paper sizes; by language when empty
	Slides                               map[string]string // "lang/key" -> Google Slides master, for copy links
	Seller                               string
}

Config is deliverables.deck in lfm.json.

type Deck

type Deck struct {
	Key, Lang string
	File      string // path below the project
	Title     string
	Planned   int // the slides it must have; 0 when not planned
	Minutes   int // the speaking time; 0 when not planned
	Blocks    []Block
	Slides    []Slide
}

Deck is one deck of one language, as its Markdown file describes it.

type Edition

type Edition struct {
	Key, Lang string
	Papers    []string
}

Edition is one language: the unit buyers download. Its notes print on every paper the language uses.

type Figure

type Figure = markup.Figure

The Markdown model decks share with every editable deliverable.

type Finding

type Finding struct{ File, Message string }

Finding is a release finding about one source file.

type Image

type Image = deliver.Image

Image is a rendered listing image.

type ImagePlan

type ImagePlan struct {
	Name string
	Doc  []byte
}

ImagePlan is one listing image to render: 3000×2250 at twice the density.

type Inline

type Inline = markup.Inline

The Markdown model decks share with every editable deliverable.

type Paper

type Paper = paper.Size

Paper is a page size in millimetres.

type Plan

type Plan struct {
	Name, Buyer, Promise string
	Decks                []Planned
	Look                 theme.Look
	Lines                map[string]int
}

Plan is the parsed concept.

type Planned

type Planned struct {
	Key, Job string
	Line     int
}

Planned is one deck of the set, by its file name.

type Print

type Print struct {
	Kind  string // slides, notes, quiz
	Paper string // for notes and quiz
}

Print names one PDF of a built deck: its slides, or its notes or quiz sheet on a paper.

type Report

type Report struct {
	Config      Config
	Summary     Summary
	Plan        Plan
	Theme       theme.Theme
	Diagnostics []diagnostic.Diagnostic
	Buildable   bool
	Editions    []Edition
	Decks       map[string][]*Deck // by language, in the concept's order
	Listing     deliver.ShopListing
	// contains filtered or unexported fields
}

Report is the checked deck set.

func Check

func Check(p project.Project, cfg Config, configured bool, offers map[string]*deliver.Price, site string) Report

Check reads and checks the decks: concept, fonts, every deck of every language, every slide, and the listing.

func (Report) Build

func (r Report) Build(previous func(key string) []byte) ([]Built, error)

Build writes every deck of every edition. previous returns a file built from the same inputs before, which is used as is; the rest build side by side.

func (Report) Digest

func (r Report) Digest() []byte

Digest is the hash of what every file of the set shares.

func (Report) Facts

func (r Report) Facts() []string

Facts are the set's numbers for the shop descriptions, from the build.

func (Report) FileNote

func (r Report) FileNote(e Edition) string

FileNote is the line under a file on the download page.

func (Report) Guide

func (r Report) Guide(e Edition) []byte

Guide is an edition's start-here PDF as HTML to print: the decks, how to open them in every app, how to present and adapt them, the licence.

func (Report) GuideAssets

func (r Report) GuideAssets() map[string][]byte

GuideAssets are the font files a guide, print or listing image loads, by bare file name as the print server serves them.

func (Report) GuideName

func (r Report) GuideName(e Edition) string

GuideName is an edition's start guide as a separate file.

func (Report) Images

func (r Report) Images(shots []Shot) []ImagePlan

Images plans the listing images from the first edition's decks: the first cover alone, every deck, each deck's slides, what the presenter gets on paper, then what the set works with.

func (Report) Inspect

func (r Report) Inspect(b Built, p Print, pdf []byte) []Finding

Inspect holds Chrome's print of a deck to its plan.

func (Report) Jobs

func (r Report) Jobs() []Built

Jobs are every deck of every edition with the key of its inputs, not yet built.

func (Report) NotesShot

func (r Report) NotesShot(b Built, n int) []byte

NotesShot is the notes page of slide n of a built deck on its first paper, for a listing image.

func (Report) PowerPoint

func (r Report) PowerPoint(built []Built) ([]Finding, error)

PowerPoint opens every built deck in Microsoft PowerPoint for Mac and holds its PDF to the plan: a deck PowerPoint has to repair, other slides, other fonts.

func (Report) Preview

func (r Report) Preview(e Edition) []byte

Preview is an edition's decks as one HTML page for lfm serve: every slide with its notes below.

func (Report) PreviewAssets

func (r Report) PreviewAssets() map[string][]byte

PreviewAssets are the fonts and images a preview loads, by path below its folder.

func (Report) PrintDoc

func (r Report) PrintDoc(b Built, p Print) []byte

PrintDoc is the HTML Chrome prints for one PDF of a built deck.

func (Report) QuizShot

func (r Report) QuizShot(b Built) []byte

QuizShot is the first page of a built deck's quiz sheet; nil without a quiz.

func (Report) Showcase

func (r Report) Showcase() Edition

Showcase is the edition the listing shows: the listing's language, else the first.

func (Report) SlideShot

func (r Report) SlideShot(b Built, n int) []byte

SlideShot is slide n of a built deck alone, for a listing image.

func (Report) Slug

func (r Report) Slug() string

Slug names the product's files.

func (Report) Verify

func (r Report) Verify(ctx context.Context, soffice string, built []Built) ([]Finding, error)

Verify opens every built deck in LibreOffice, one run for all, and holds its print to the plan: another app's view of the real .pptx.

func (Report) Zip

func (r Report) Zip(e Edition, built []Built, pdfs map[string][]byte, guide []byte, key string) ([]byte, error)

Zip packs an edition: its decks, their PDFs when printed, the start guide, and the fonts with their licence, so Keynote users can install them. A key stamps a complete ZIP, so later compiles reuse it as is.

func (Report) ZipName

func (r Report) ZipName(e Edition) string

ZipName is an edition's download.

type Shot

type Shot struct {
	Key, Title  string
	Cover       []byte
	Slides      [][]byte
	Notes, Quiz []byte
	Facts       string
}

Shot is a deck as a release renders it for the listing: the cover, the slides after it, a notes page and the quiz sheet.

type Slide

type Slide struct {
	N      int // 1-based
	Line   int
	Layout string
	Title  []Inline
	Sub    []Inline // the cover's subtitle, a section's line
	Body   []Block
	Notes  []Block
	Quiz   *Block // the list of answers when the slide asks a question
}

Slide is one slide of a deck.

type Summary

type Summary struct {
	Name      string   `json:"name,omitempty"`
	Concept   bool     `json:"concept"`
	Fonts     []string `json:"fonts,omitempty"` // the families the concept names
	Decks     int      `json:"decks"`
	Slides    int      `json:"slides"`  // in the decks of one language
	Quizzes   int      `json:"quizzes"` // questions in them
	Minutes   int      `json:"minutes"`
	Languages []string `json:"languages,omitempty"`
	Editions  []string `json:"editions,omitempty"`
	Sell      string   `json:"sell"`
	URL       string   `json:"url,omitempty"`
	Files     []string `json:"files,omitempty"`
	Listing   bool     `json:"listing"`
	Linked    int      `json:"linked"`
	Channels  []string `json:"channels,omitempty"`
	Images    int      `json:"images"`
	Pending   bool     `json:"pending"`
	Layout    string   `json:"layout,omitempty"`
}

Summary is what the compile report shows.

type Table

type Table = markup.Table

The Markdown model decks share with every editable deliverable.

Jump to

Keyboard shortcuts

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