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
- Variables
- func CopyLink(url string) string
- func Distribution(r Report, files []deliver.File, data map[string][]byte, images []Image, ...) (map[string][]byte, []string, []diagnostic.Diagnostic)
- func DownloadPage(r Report, files []deliver.File) []byte
- func Facts(b Built) string
- func PaperPixels(paper string) (int64, int64)
- func Present(p project.Project) bool
- func Rules() []diagnostic.RuleInfo
- func ShotPixels() (int64, int64)
- type Block
- type Built
- type Config
- type Deck
- type Edition
- type Figure
- type Finding
- type Image
- type ImagePlan
- type Inline
- type Paper
- type Plan
- type Planned
- type Print
- type Report
- func (r Report) Build(previous func(key string) []byte) ([]Built, error)
- func (r Report) Digest() []byte
- func (r Report) Facts() []string
- func (r Report) FileNote(e Edition) string
- func (r Report) Guide(e Edition) []byte
- func (r Report) GuideAssets() map[string][]byte
- func (r Report) GuideName(e Edition) string
- func (r Report) Images(shots []Shot) []ImagePlan
- func (r Report) Inspect(b Built, p Print, pdf []byte) []Finding
- func (r Report) Jobs() []Built
- func (r Report) NotesShot(b Built, n int) []byte
- func (r Report) PowerPoint(built []Built) ([]Finding, error)
- func (r Report) Preview(e Edition) []byte
- func (r Report) PreviewAssets() map[string][]byte
- func (r Report) PrintDoc(b Built, p Print) []byte
- func (r Report) QuizShot(b Built) []byte
- func (r Report) Showcase() Edition
- func (r Report) SlideShot(b Built, n int) []byte
- func (r Report) Slug() string
- func (r Report) Verify(ctx context.Context, soffice string, built []Built) ([]Finding, error)
- func (r Report) Zip(e Edition, built []Built, pdfs map[string][]byte, guide []byte, key string) ([]byte, error)
- func (r Report) ZipName(e Edition) string
- type Shot
- type Slide
- type Summary
- type Table
Constants ¶
const ( Dir = "deliverables/deck" ConceptFile = Dir + "/concept.md" FontsDir = Dir + "/fonts" ImagesDir = Dir + "/images" ListingFile = Dir + "/listing.md" )
The layout under deliverables/deck.
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.
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.
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 ¶
var DeckColumns = []string{"Deck", "Job"}
DeckColumns are the columns of the Decks table.
var Papers = paper.Office
Papers are the sizes speaker notes print on.
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 ¶
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 ¶
DownloadPage renders the unlisted download page: the Google Slides copy links first, then the files.
func PaperPixels ¶
PaperPixels is a paper in CSS pixels.
func ShotPixels ¶
ShotPixels is a slide in CSS pixels: 960 pt at 96 dpi.
Types ¶
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.
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 ¶
Edition is one language: the unit buyers download. Its notes print on every paper the language uses.
type Finding ¶
type Finding struct{ File, Message string }
Finding is a release finding about one source file.
type Plan ¶
type Plan struct {
Name, Buyer, Promise string
Decks []Planned
Look theme.Look
Lines map[string]int
}
Plan is the parsed concept.
type Print ¶
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 ¶
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) Guide ¶
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 ¶
GuideAssets are the font files a guide, print or listing image loads, by bare file name as the print server serves them.
func (Report) Images ¶
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) Jobs ¶
Jobs are every deck of every edition with the key of its inputs, not yet built.
func (Report) NotesShot ¶
NotesShot is the notes page of slide n of a built deck on its first paper, for a listing image.
func (Report) PowerPoint ¶
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 ¶
Preview is an edition's decks as one HTML page for lfm serve: every slide with its notes below.
func (Report) PreviewAssets ¶
PreviewAssets are the fonts and images a preview loads, by path below its folder.
func (Report) QuizShot ¶
QuizShot is the first page of a built deck's quiz sheet; nil without a quiz.
func (Report) Showcase ¶
Showcase is the edition the listing shows: the listing's language, else the first.
func (Report) Verify ¶
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.
type Shot ¶
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.