Documentation
¶
Overview ¶
Package bundle sells two or more of the project's deliverables together, such as a deck with its handouts or a book with its workbook: one name, one listing, one download page or shop listing with every file of each.
Index ¶
- Constants
- Variables
- func Distribution(r Report, files []deliver.File, data map[string][]byte, ...) (map[string][]byte, []string, []diagnostic.Diagnostic)
- func DownloadPage(r Report, accent string, files []deliver.File) []byte
- func HeroDoc(covers []Cover, accent string) []byte
- func Rules() []diagnostic.RuleInfo
- type Config
- type Cover
- type Image
- type Report
- type Summary
- type Unit
Constants ¶
const ( Dir = "deliverables/bundle" ListingFile = Dir + "/listing.md" )
The bundle's files under deliverables/.
const ( RuleConfig = "bundle.config" RuleDelivery = "bundle.delivery" RuleListing = "bundle.listing" RuleChannels = "bundle.channels" )
Rule IDs.
Variables ¶
var Kinds = []string{"book", "printable", "spreadsheet", "document", "deck"}
Kinds are the deliverables a bundle can hold, in the order it lists them.
Functions ¶
func Distribution ¶
func Distribution(r Report, files []deliver.File, data map[string][]byte, groups map[string][]string, images []Image, facts []string, pending bool, day string) (map[string][]byte, []string, []diagnostic.Diagnostic)
Distribution assembles the bundle's shop packages from the files of every unit: groups names the ZIPs Etsy gets when the files are more than five; facts describe what each deliverable holds.
func DownloadPage ¶
DownloadPage renders the bundle's unlisted download page with every file of every unit, or a note while they are not all built.
Types ¶
type Config ¶
type Config struct {
Name, Path, Offer, Sell, Language string
Units []string // the deliverables it holds; every one when empty
}
Config is deliverables.bundle in lfm.json.
type Cover ¶
Cover is one unit's picture in the bundle's first listing image: a book cover, a printable's first page, another deliverable's first listing image, by the name the hero loads it as.
type Report ¶
type Report struct {
Config Config
Summary Summary
Diagnostics []diagnostic.Diagnostic
Listing deliver.ShopListing
}
Report is the checked bundle.
type Summary ¶
type Summary struct {
Name string `json:"name,omitempty"`
Units []string `json:"units,omitempty"`
Sell string `json:"sell"`
URL string `json:"url,omitempty"`
Files []string `json:"files,omitempty"`
Ready bool `json:"ready"` // every unit has its files
Listing bool `json:"listing"`
Channels []string `json:"channels,omitempty"`
Images int `json:"images"`
Pending bool `json:"pending"`
}
Summary is what the report and --json show about the bundle.