[{"data":1,"prerenderedAt":1649},["ShallowReactive",2],{"navigation_docs":3,"-kits-what-is-a-kit":205,"-kits-what-is-a-kit-surround":1644},[4,31,67,111,132,163,189],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":30},"Getting started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,15,20,25],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-play",{"title":26,"path":27,"stem":28,"icon":29},"Agent Skill","\u002Fgetting-started\u002Fagent-skill","1.getting-started\u002F4.agent-skill","i-lucide-sparkles",false,{"title":32,"icon":33,"path":34,"stem":35,"children":36,"page":30},"Authoring","i-lucide-pen-line","\u002Fauthoring","2.authoring",[37,42,47,52,57,62],{"title":38,"path":39,"stem":40,"icon":41},"Comark syntax","\u002Fauthoring\u002Fcomark-syntax","2.authoring\u002F1.comark-syntax","i-lucide-file-code",{"title":43,"path":44,"stem":45,"icon":46},"Frontmatter","\u002Fauthoring\u002Ffrontmatter","2.authoring\u002F2.frontmatter","i-lucide-heading",{"title":48,"path":49,"stem":50,"icon":51},"Components","\u002Fauthoring\u002Fcomponents","2.authoring\u002F3.components","i-lucide-blocks",{"title":53,"path":54,"stem":55,"icon":56},"Merge tags and data","\u002Fauthoring\u002Fmerge-tags-and-data","2.authoring\u002F4.merge-tags-and-data","i-lucide-braces",{"title":58,"path":59,"stem":60,"icon":61},"Actions and spans","\u002Fauthoring\u002Factions-and-spans","2.authoring\u002F5.actions-and-spans","i-lucide-mouse-pointer-click",{"title":63,"path":64,"stem":65,"icon":66},"Compile errors","\u002Fauthoring\u002Fcompile-errors","2.authoring\u002F6.compile-errors","i-lucide-circle-alert",{"title":68,"icon":69,"path":70,"stem":71,"children":72,"page":30},"Kits","i-lucide-palette","\u002Fkits","3.kits",[73,78,83,87,91,96,101,106],{"title":74,"path":75,"stem":76,"icon":77},"What is a kit","\u002Fkits\u002Fwhat-is-a-kit","3.kits\u002F1.what-is-a-kit","i-lucide-package",{"title":79,"path":80,"stem":81,"icon":82},"kit.yaml","\u002Fkits\u002Fkit-yaml","3.kits\u002F2.kit-yaml","i-lucide-file-cog",{"title":84,"path":85,"stem":86,"icon":51},"Component schemas","\u002Fkits\u002Fcomponent-schemas","3.kits\u002F3.component-schemas",{"title":88,"path":89,"stem":90,"icon":56},"Templates and views","\u002Fkits\u002Ftemplates-and-views","3.kits\u002F4.templates-and-views",{"title":92,"path":93,"stem":94,"icon":95},"Template checking","\u002Fkits\u002Ftemplate-checking","3.kits\u002F5.template-checking","i-lucide-shield-check",{"title":97,"path":98,"stem":99,"icon":100},"Go types and funcs","\u002Fkits\u002Fgo-types-and-funcs","3.kits\u002F6.go-types-and-funcs","i-lucide-code",{"title":102,"path":103,"stem":104,"icon":105},"Email-safe HTML","\u002Fkits\u002Femail-safe-html","3.kits\u002F7.email-safe-html","i-lucide-mail-check",{"title":107,"path":108,"stem":109,"icon":110},"Plain text","\u002Fkits\u002Fplain-text","3.kits\u002F8.plain-text","i-lucide-file-text",{"title":112,"icon":113,"path":114,"stem":115,"children":116,"page":30},"Sending","i-lucide-send","\u002Fsending","4.sending",[117,122,127],{"title":118,"path":119,"stem":120,"icon":121},"Profiles and config","\u002Fsending\u002Fprofiles-and-config","4.sending\u002F1.profiles-and-config","i-lucide-settings",{"title":123,"path":124,"stem":125,"icon":126},"Message and MIME","\u002Fsending\u002Fmessage-and-mime","4.sending\u002F2.message-and-mime","i-lucide-mail",{"title":128,"path":129,"stem":130,"icon":131},"SMTP","\u002Fsending\u002Fsmtp","4.sending\u002F3.smtp","i-lucide-server",{"title":133,"icon":134,"path":135,"stem":136,"children":137,"page":30},"Tooling","i-lucide-wrench","\u002Ftooling","5.tooling",[138,143,148,153,158],{"title":139,"path":140,"stem":141,"icon":142},"The lttr CLI","\u002Ftooling\u002Fcli","5.tooling\u002F1.cli","i-lucide-terminal",{"title":144,"path":145,"stem":146,"icon":147},"Studio","\u002Ftooling\u002Fstudio","5.tooling\u002F2.studio","i-lucide-eye",{"title":149,"path":150,"stem":151,"icon":152},"Editor setup","\u002Ftooling\u002Feditor-setup","5.tooling\u002F3.editor-setup","i-lucide-plug",{"title":154,"path":155,"stem":156,"icon":157},"Screenshots","\u002Ftooling\u002Fscreenshots","5.tooling\u002F4.screenshots","i-lucide-camera",{"title":159,"path":160,"stem":161,"icon":162},"Goldens and testing","\u002Ftooling\u002Fgoldens-and-testing","5.tooling\u002F5.goldens-and-testing","i-lucide-flask-conical",{"title":164,"icon":165,"path":166,"stem":167,"children":168,"page":30},"Guides","i-lucide-book-open","\u002Fguides","6.guides",[169,174,179,184],{"title":170,"path":171,"stem":172,"icon":173},"Build your own kit","\u002Fguides\u002Fbuild-your-own-kit","6.guides\u002F1.build-your-own-kit","i-lucide-hammer",{"title":175,"path":176,"stem":177,"icon":178},"The Quiet kit","\u002Fguides\u002Fthe-quiet-kit","6.guides\u002F2.the-quiet-kit","i-lucide-mail-open",{"title":180,"path":181,"stem":182,"icon":183},"Migrating from v0.1","\u002Fguides\u002Fmigrating-from-v0-1","6.guides\u002F3.migrating-from-v0-1","i-lucide-arrow-right-left",{"title":185,"path":186,"stem":187,"icon":188},"Releasing","\u002Fguides\u002Freleasing","6.guides\u002F4.releasing","i-lucide-tag",{"title":190,"icon":191,"path":192,"stem":193,"children":194,"page":30},"Reference","i-lucide-library","\u002Freference","7.reference",[195,200],{"title":196,"path":197,"stem":198,"icon":199},"API reference","\u002Freference\u002Fapi-reference","7.reference\u002F1.api-reference","i-lucide-list-tree",{"title":201,"path":202,"stem":203,"icon":204},"Gallery","\u002Freference\u002Fgallery","7.reference\u002F2.gallery","i-lucide-images",{"id":206,"title":74,"body":207,"description":1637,"extension":1638,"links":1639,"meta":1640,"navigation":1641,"path":75,"seo":1642,"stem":76,"__hash__":1643},"docs\u002F3.kits\u002F1.what-is-a-kit.md",{"type":208,"value":209,"toc":1630},"minimark",[210,228,231,236,241,244,255,258,422,447,451,457,564,575,655,658,740,746,823,829,833,836,1355,1425,1465,1469,1595,1605,1609,1626],[211,212,213,214,218,219,223,224,227],"p",{},"lttr's engine has no design of its own. Everything a recipient sees comes from a ",[215,216,217],"strong",{},"kit",": the colours and fonts, the document shell, the components a Markdown template may use, and how each one renders as HTML and as plain text. You own the kit. It is a directory of YAML and Go templates, loaded as an ",[220,221,222],"code",{},"fs.FS",", usually an ",[220,225,226],{},"embed.FS"," in a Go package of yours.",[211,229,230],{},"This is Plain, the starter kit, rendering its welcome sample. Everything in it, from the canvas colour to the footer, is in Plain's files:",[232,233],"email-preview",{"kit":234,"name":235},"plain","02-welcome",[237,238,240],"h2",{"id":239},"lay-out-the-files","Lay out the files",[211,242,243],{},"Every kit has the same layout:",[245,246,253],"pre",{"className":247,"code":249,"filename":250,"language":251,"meta":252},[248],"language-text","kit.yaml                            name, default component, dark, tokens, vars, spans, inline styles, limits, types, frontmatter\nlayout.html, layout.txt             the document shells\nstyles.css                          head CSS: a text\u002Ftemplate over the tokens\nblocks.html, blocks.txt             how Markdown blocks render (blocks.txt is optional)\ncomponents\u002F\u003Cname>\u002Fcomponent.yaml    the component's schema\ncomponents\u002F\u003Cname>\u002Fhtml.tmpl         its HTML\ncomponents\u002F\u003Cname>\u002Ftext.tmpl         its text form (optional: the component has none)\nassets\u002F                             optional: logos and images\nsamples\u002F*.md, samples\u002Fsamples.yaml  optional: sample templates and their data\n","Kit layout","text","",[220,254,249],{"__ignoreMap":252},[211,256,257],{},"Each file has one job, and each template runs with one fixed view:",[259,260,261,277],"table",{},[262,263,264],"thead",{},[265,266,267,271,274],"tr",{},[268,269,270],"th",{},"File",[268,272,273],{},"Written in",[268,275,276],{},"Runs with",[278,279,280,296,314,332,346,372,386,399],"tbody",{},[265,281,282,287,290],{},[283,284,285],"td",{},[220,286,79],{},[283,288,289],{},"YAML",[283,291,292,293],{},"See ",[294,295,79],"a",{"href":80},[265,297,298,303,308],{},[283,299,300],{},[220,301,302],{},"layout.html",[283,304,305],{},[220,306,307],{},"html\u002Ftemplate",[283,309,310,313],{},[220,311,312],{},"kit.LayoutView",": the subject, preheader, styles and the components' HTML",[265,315,316,321,326],{},[283,317,318],{},[220,319,320],{},"layout.txt",[283,322,323],{},[220,324,325],{},"text\u002Ftemplate",[283,327,328,331],{},[220,329,330],{},"kit.TextLayoutView",": the subject, preheader and the components' text",[265,333,334,339,343],{},[283,335,336],{},[220,337,338],{},"styles.css",[283,340,341],{},[220,342,325],{},[283,344,345],{},"No data: it is executed once per renderer, over the tokens and vars",[265,347,348,353,358],{},[283,349,350],{},[220,351,352],{},"blocks.html",[283,354,355,357],{},[220,356,307],{}," defines",[283,359,360,363,364,367,368,371],{},[220,361,362],{},"kit.BlockView",", one per Markdown block (",[220,365,366],{},"action"," gets a ",[220,369,370],{},"kit.ActionView",")",[265,373,374,379,383],{},[283,375,376],{},[220,377,378],{},"blocks.txt",[283,380,381,357],{},[220,382,325],{},[283,384,385],{},"The same views. Defines it leaves out use lttr's core text forms",[265,387,388,393,395],{},[283,389,390],{},[220,391,392],{},"component.yaml",[283,394,289],{},[283,396,292,397],{},[294,398,84],{"href":85},[265,400,401,410,416],{},[283,402,403,406,407],{},[220,404,405],{},"html.tmpl",", ",[220,408,409],{},"text.tmpl",[283,411,412,406,414],{},[220,413,307],{},[220,415,325],{},[283,417,418,421],{},[220,419,420],{},"kit.View",": the component's attributes, bindings, content, children, spacing and the document",[211,423,424,425,428,429,432,433,435,436,439,440,443,444,446],{},"A component's directory name is its name. It must match ",[220,426,427],{},"[a-z][a-z0-9_-]*",", and a ",[220,430,431],{},"name:"," key in ",[220,434,392],{},", when present, must match the directory. A Markdown template uses the component as ",[220,437,438],{},"::name{…}",". Loose Markdown outside any component goes to the kit's ",[220,441,442],{},"default"," component. ",[294,445,88],{"href":89}," covers the views field by field.",[237,448,450],{"id":449},"start-from-plain","Start from Plain",[211,452,453,456],{},[220,454,455],{},"lttr kit init"," copies Plain into a directory and renames it after the directory:",[245,458,463],{"className":459,"code":460,"filename":461,"language":462,"meta":252,"style":252},"language-bash shiki shiki-themes github-light-high-contrast github-light-high-contrast github-dark","$ lttr kit init .\u002Femailkit\nwrote 29 files to .\u002Femailkit; check it with: lttr kit check .\u002Femailkit\n$ lttr kit check .\u002Femailkit\nkit emailkit: 2 samples rendered, no problems\n","Terminal","bash",[220,464,465,487,528,541],{"__ignoreMap":252},[466,467,470,474,478,481,484],"span",{"class":468,"line":469},"line",1,[466,471,473],{"class":472},"sSlKG","$",[466,475,477],{"class":476},"sRBGO"," lttr",[466,479,480],{"class":476}," kit",[466,482,483],{"class":476}," init",[466,485,486],{"class":476}," .\u002Femailkit\n",[466,488,490,493,497,500,503,506,510,513,516,519,521,523,526],{"class":468,"line":489},2,[466,491,492],{"class":472},"wrote",[466,494,496],{"class":495},"sTl1q"," 29",[466,498,499],{"class":476}," files",[466,501,502],{"class":476}," to",[466,504,505],{"class":476}," .\u002Femailkit",[466,507,509],{"class":508},"sihDN","; ",[466,511,512],{"class":472},"check",[466,514,515],{"class":476}," it",[466,517,518],{"class":476}," with:",[466,520,477],{"class":476},[466,522,480],{"class":476},[466,524,525],{"class":476}," check",[466,527,486],{"class":476},[466,529,531,533,535,537,539],{"class":468,"line":530},3,[466,532,473],{"class":472},[466,534,477],{"class":476},[466,536,480],{"class":476},[466,538,525],{"class":476},[466,540,486],{"class":476},[466,542,544,546,549,552,555,558,561],{"class":468,"line":543},4,[466,545,217],{"class":472},[466,547,548],{"class":476}," emailkit:",[466,550,551],{"class":495}," 2",[466,553,554],{"class":476}," samples",[466,556,557],{"class":476}," rendered,",[466,559,560],{"class":476}," no",[466,562,563],{"class":476}," problems\n",[211,565,566,567,570,571,574],{},"Without an installed ",[220,568,569],{},"lttr",", run it as ",[220,572,573],{},"go run github.com\u002Fsulv-io\u002Flttr\u002Fcmd\u002Flttr@latest kit init .\u002Femailkit",".",[576,577,578,596,612,637],"ul",{},[579,580,581,584,585,588,589,592,593,574],"li",{},[215,582,583],{},"The name"," is the directory's base name. It must be lower-case letters, digits and ",[220,586,587],{},"-",". Otherwise pass ",[220,590,591],{},"-name",", before the directory: ",[220,594,595],{},"lttr kit init -name tutorial examples\u002Ftutorial\u002Fkit",[579,597,598,601,602,604,605,607,608,611],{},[215,599,600],{},"What changes",": ",[220,603,431],{}," in ",[220,606,79],{},", and its first comment line, which becomes ",[220,609,610],{},"# emailkit: an lttr kit, started from the Plain kit by `lttr kit init`."," Every other file is Plain's, byte for byte.",[579,613,614,621,622,625,626,629,630,632,633,636],{},[215,615,616,617,620],{},"What ",[220,618,619],{},"kit check"," does",": it loads the kit, renders every ",[220,623,624],{},"samples\u002F*.md"," with its data from ",[220,627,628],{},"samples\u002Fsamples.yaml",", lints the HTML and exits 1 on any problem. See ",[294,631,102],{"href":103}," for the lint and ",[294,634,635],{"href":140},"CLI"," for the flags.",[579,638,639,642,643,645,646,648,649,651,652,654],{},[215,640,641],{},"Samples are your test cases."," ",[220,644,628],{}," maps each sample file name to its literal merge data: strings, numbers, booleans, lists and maps, with no Go types. ",[220,647,619],{}," renders only what the samples use, so a new component must appear in some ",[220,650,624],{}," before ",[220,653,619],{}," renders and lints it.",[211,656,657],{},"Plain's data for its welcome sample:",[245,659,664],{"className":660,"code":661,"filename":662,"language":663,"meta":252,"style":252},"language-yaml shiki shiki-themes github-light-high-contrast github-light-high-contrast github-dark","# Literal merge data for each sample, keyed by file name. `lttr kit check`\n# renders every sample with these values.\nwelcome.md:\n  first_name: Ada\n  workspace: Northwind Studio\n  trial_ends: 9 October\n  setup_url: https:\u002F\u002Fexample.com\u002Fsetup\n  cover_url: https:\u002F\u002Fexample.com\u002Fassets\u002Fcover.png\n","plain\u002Fsamples\u002Fsamples.yaml#L1-L8","yaml",[220,665,666,672,677,686,696,707,718,729],{"__ignoreMap":252},[466,667,668],{"class":468,"line":469},[466,669,671],{"class":670},"sBq4M","# Literal merge data for each sample, keyed by file name. `lttr kit check`\n",[466,673,674],{"class":468,"line":489},[466,675,676],{"class":670},"# renders every sample with these values.\n",[466,678,679,683],{"class":468,"line":530},[466,680,682],{"class":681},"s71pN","welcome.md",[466,684,685],{"class":508},":\n",[466,687,688,691,693],{"class":468,"line":543},[466,689,690],{"class":681},"  first_name",[466,692,601],{"class":508},[466,694,695],{"class":476},"Ada\n",[466,697,699,702,704],{"class":468,"line":698},5,[466,700,701],{"class":681},"  workspace",[466,703,601],{"class":508},[466,705,706],{"class":476},"Northwind Studio\n",[466,708,710,713,715],{"class":468,"line":709},6,[466,711,712],{"class":681},"  trial_ends",[466,714,601],{"class":508},[466,716,717],{"class":476},"9 October\n",[466,719,721,724,726],{"class":468,"line":720},7,[466,722,723],{"class":681},"  setup_url",[466,725,601],{"class":508},[466,727,728],{"class":476},"https:\u002F\u002Fexample.com\u002Fsetup\n",[466,730,732,735,737],{"class":468,"line":731},8,[466,733,734],{"class":681},"  cover_url",[466,736,601],{"class":508},[466,738,739],{"class":476},"https:\u002F\u002Fexample.com\u002Fassets\u002Fcover.png\n",[211,741,742,743,745],{},"From here, change anything. Plain's ",[220,744,79],{}," header says where to start:",[245,747,750],{"className":660,"code":748,"filename":749,"language":663,"meta":252,"style":252},"# Plain: a small, neutral starter kit for lttr.\n#\n# One left-aligned column on a light canvas, a system sans-serif stack,\n# square buttons and light\u002Fdark colours. Copy it with `lttr kit init` and\n# change anything: tokens here, markup in layout.html, blocks.html and\n# components\u002F*\u002Fhtml.tmpl.\nname: plain\nversion: 1\ndefault: section\ndark: true\n","plain\u002Fkit.yaml#L1-L10",[220,751,752,757,762,767,772,777,782,792,802,812],{"__ignoreMap":252},[466,753,754],{"class":468,"line":469},[466,755,756],{"class":670},"# Plain: a small, neutral starter kit for lttr.\n",[466,758,759],{"class":468,"line":489},[466,760,761],{"class":670},"#\n",[466,763,764],{"class":468,"line":530},[466,765,766],{"class":670},"# One left-aligned column on a light canvas, a system sans-serif stack,\n",[466,768,769],{"class":468,"line":543},[466,770,771],{"class":670},"# square buttons and light\u002Fdark colours. Copy it with `lttr kit init` and\n",[466,773,774],{"class":468,"line":698},[466,775,776],{"class":670},"# change anything: tokens here, markup in layout.html, blocks.html and\n",[466,778,779],{"class":468,"line":709},[466,780,781],{"class":670},"# components\u002F*\u002Fhtml.tmpl.\n",[466,783,784,787,789],{"class":468,"line":720},[466,785,786],{"class":681},"name",[466,788,601],{"class":508},[466,790,791],{"class":476},"plain\n",[466,793,794,797,799],{"class":468,"line":731},[466,795,796],{"class":681},"version",[466,798,601],{"class":508},[466,800,801],{"class":495},"1\n",[466,803,805,807,809],{"class":468,"line":804},9,[466,806,442],{"class":681},[466,808,601],{"class":508},[466,810,811],{"class":476},"section\n",[466,813,815,818,820],{"class":468,"line":814},10,[466,816,817],{"class":681},"dark",[466,819,601],{"class":508},[466,821,822],{"class":495},"true\n",[211,824,825,826,828],{},"The ",[294,827,170],{"href":171}," guide takes this copy to a kit with its own colours, font and an invoice component that binds a Go type.",[237,830,832],{"id":831},"load-a-kit-from-go","Load a kit from Go",[211,834,835],{},"Embed the kit directory in a Go package and load it once. This is the tutorial kit's package, from the guide:",[245,837,842],{"className":838,"code":839,"filename":840,"language":841,"meta":252,"style":252},"language-go shiki shiki-themes github-light-high-contrast github-light-high-contrast github-dark","\u002F\u002F files holds the kit directory, kit\u002F.\n\u002F\u002F\n\u002F\u002Fgo:embed kit\nvar files embed.FS\n\n\u002F\u002F Files returns the kit's files, rooted at kit\u002F.\nfunc Files() fs.FS {\n    sub, err := fs.Sub(files, \"kit\")\n    if err != nil {\n        panic(err) \u002F\u002F \"kit\" is a valid path, so Sub cannot fail\n    }\n    return sub\n}\n\n\u002F\u002F LoadKit loads the tutorial kit from fsys (a copy of kit\u002F on disk, say)\n\u002F\u002F with the Go types its components bind. A kit with `types` in kit.yaml\n\u002F\u002F loads only with every listed type registered. Kit() is\n\u002F\u002F LoadKit(Files()) cached.\nfunc LoadKit(fsys fs.FS) (*kit.Kit, error) {\n    return kit.Load(fsys, kit.Types(kit.TypeOf[Invoice](\"Invoice\")))\n}\n\n\u002F\u002F load is LoadKit, kept for callers within the package.\nfunc load(fsys fs.FS) (*kit.Kit, error) { return LoadKit(fsys) }\n\n\u002F\u002F loadOnce loads the kit once, so every template and renderer shares the\n\u002F\u002F same immutable *kit.Kit.\nvar loadOnce = sync.OnceValues(func() (*kit.Kit, error) { return LoadKit(Files()) })\n\n\u002F\u002F Kit returns the loaded tutorial kit. It is safe for concurrent use and\n\u002F\u002F returns the same *kit.Kit on every call.\nfunc Kit() (*kit.Kit, error) { return loadOnce() }\n\n\u002F\u002F MustKit is Kit that panics on error; the embedded kit is tested, so an\n\u002F\u002F error means a broken build.\nfunc MustKit() *kit.Kit {\n    k, err := Kit()\n    if err != nil {\n        panic(err)\n    }\n    return k\n}\n","tutorial\u002Ftutorial.go#L50-L91","go",[220,843,844,849,854,859,876,882,887,910,933,949,960,966,975,981,986,992,998,1004,1010,1053,1091,1096,1101,1107,1150,1155,1161,1167,1217,1222,1228,1234,1266,1271,1277,1283,1303,1316,1329,1337,1342,1350],{"__ignoreMap":252},[466,845,846],{"class":468,"line":469},[466,847,848],{"class":670},"\u002F\u002F files holds the kit directory, kit\u002F.\n",[466,850,851],{"class":468,"line":489},[466,852,853],{"class":670},"\u002F\u002F\n",[466,855,856],{"class":468,"line":530},[466,857,858],{"class":670},"\u002F\u002Fgo:embed kit\n",[466,860,861,865,868,871,873],{"class":468,"line":543},[466,862,864],{"class":863},"s1Q0q","var",[466,866,867],{"class":508}," files ",[466,869,870],{"class":472},"embed",[466,872,574],{"class":508},[466,874,875],{"class":472},"FS\n",[466,877,878],{"class":468,"line":698},[466,879,881],{"emptyLinePlaceholder":880},true,"\n",[466,883,884],{"class":468,"line":709},[466,885,886],{"class":670},"\u002F\u002F Files returns the kit's files, rooted at kit\u002F.\n",[466,888,889,892,896,899,902,904,907],{"class":468,"line":720},[466,890,891],{"class":863},"func",[466,893,895],{"class":894},"sPmw6"," Files",[466,897,898],{"class":508},"() ",[466,900,901],{"class":472},"fs",[466,903,574],{"class":508},[466,905,906],{"class":472},"FS",[466,908,909],{"class":508}," {\n",[466,911,912,915,918,921,924,927,930],{"class":468,"line":731},[466,913,914],{"class":508},"    sub, err ",[466,916,917],{"class":863},":=",[466,919,920],{"class":508}," fs.",[466,922,923],{"class":894},"Sub",[466,925,926],{"class":508},"(files, ",[466,928,929],{"class":476},"\"kit\"",[466,931,932],{"class":508},")\n",[466,934,935,938,941,944,947],{"class":468,"line":804},[466,936,937],{"class":863},"    if",[466,939,940],{"class":508}," err ",[466,942,943],{"class":863},"!=",[466,945,946],{"class":495}," nil",[466,948,909],{"class":508},[466,950,951,954,957],{"class":468,"line":814},[466,952,953],{"class":894},"        panic",[466,955,956],{"class":508},"(err) ",[466,958,959],{"class":670},"\u002F\u002F \"kit\" is a valid path, so Sub cannot fail\n",[466,961,963],{"class":468,"line":962},11,[466,964,965],{"class":508},"    }\n",[466,967,969,972],{"class":468,"line":968},12,[466,970,971],{"class":863},"    return",[466,973,974],{"class":508}," sub\n",[466,976,978],{"class":468,"line":977},13,[466,979,980],{"class":508},"}\n",[466,982,984],{"class":468,"line":983},14,[466,985,881],{"emptyLinePlaceholder":880},[466,987,989],{"class":468,"line":988},15,[466,990,991],{"class":670},"\u002F\u002F LoadKit loads the tutorial kit from fsys (a copy of kit\u002F on disk, say)\n",[466,993,995],{"class":468,"line":994},16,[466,996,997],{"class":670},"\u002F\u002F with the Go types its components bind. A kit with `types` in kit.yaml\n",[466,999,1001],{"class":468,"line":1000},17,[466,1002,1003],{"class":670},"\u002F\u002F loads only with every listed type registered. Kit() is\n",[466,1005,1007],{"class":468,"line":1006},18,[466,1008,1009],{"class":670},"\u002F\u002F LoadKit(Files()) cached.\n",[466,1011,1013,1015,1018,1021,1025,1028,1030,1032,1035,1038,1040,1042,1045,1047,1050],{"class":468,"line":1012},19,[466,1014,891],{"class":863},[466,1016,1017],{"class":894}," LoadKit",[466,1019,1020],{"class":508},"(",[466,1022,1024],{"class":1023},"s-BBy","fsys",[466,1026,1027],{"class":472}," fs",[466,1029,574],{"class":508},[466,1031,906],{"class":472},[466,1033,1034],{"class":508},") (",[466,1036,1037],{"class":863},"*",[466,1039,217],{"class":472},[466,1041,574],{"class":508},[466,1043,1044],{"class":472},"Kit",[466,1046,406],{"class":508},[466,1048,1049],{"class":863},"error",[466,1051,1052],{"class":508},") {\n",[466,1054,1056,1058,1061,1064,1067,1070,1073,1076,1079,1082,1085,1088],{"class":468,"line":1055},20,[466,1057,971],{"class":863},[466,1059,1060],{"class":508}," kit.",[466,1062,1063],{"class":894},"Load",[466,1065,1066],{"class":508},"(fsys, kit.",[466,1068,1069],{"class":894},"Types",[466,1071,1072],{"class":508},"(kit.",[466,1074,1075],{"class":894},"TypeOf",[466,1077,1078],{"class":508},"[",[466,1080,1081],{"class":472},"Invoice",[466,1083,1084],{"class":508},"](",[466,1086,1087],{"class":476},"\"Invoice\"",[466,1089,1090],{"class":508},")))\n",[466,1092,1094],{"class":468,"line":1093},21,[466,1095,980],{"class":508},[466,1097,1099],{"class":468,"line":1098},22,[466,1100,881],{"emptyLinePlaceholder":880},[466,1102,1104],{"class":468,"line":1103},23,[466,1105,1106],{"class":670},"\u002F\u002F load is LoadKit, kept for callers within the package.\n",[466,1108,1110,1112,1115,1117,1119,1121,1123,1125,1127,1129,1131,1133,1135,1137,1139,1142,1145,1147],{"class":468,"line":1109},24,[466,1111,891],{"class":863},[466,1113,1114],{"class":894}," load",[466,1116,1020],{"class":508},[466,1118,1024],{"class":1023},[466,1120,1027],{"class":472},[466,1122,574],{"class":508},[466,1124,906],{"class":472},[466,1126,1034],{"class":508},[466,1128,1037],{"class":863},[466,1130,217],{"class":472},[466,1132,574],{"class":508},[466,1134,1044],{"class":472},[466,1136,406],{"class":508},[466,1138,1049],{"class":863},[466,1140,1141],{"class":508},") { ",[466,1143,1144],{"class":863},"return",[466,1146,1017],{"class":894},[466,1148,1149],{"class":508},"(fsys) }\n",[466,1151,1153],{"class":468,"line":1152},25,[466,1154,881],{"emptyLinePlaceholder":880},[466,1156,1158],{"class":468,"line":1157},26,[466,1159,1160],{"class":670},"\u002F\u002F loadOnce loads the kit once, so every template and renderer shares the\n",[466,1162,1164],{"class":468,"line":1163},27,[466,1165,1166],{"class":670},"\u002F\u002F same immutable *kit.Kit.\n",[466,1168,1170,1172,1175,1178,1181,1184,1186,1188,1191,1193,1195,1197,1199,1201,1203,1205,1207,1209,1211,1214],{"class":468,"line":1169},28,[466,1171,864],{"class":863},[466,1173,1174],{"class":508}," loadOnce ",[466,1176,1177],{"class":863},"=",[466,1179,1180],{"class":508}," sync.",[466,1182,1183],{"class":894},"OnceValues",[466,1185,1020],{"class":508},[466,1187,891],{"class":863},[466,1189,1190],{"class":508},"() (",[466,1192,1037],{"class":863},[466,1194,217],{"class":472},[466,1196,574],{"class":508},[466,1198,1044],{"class":472},[466,1200,406],{"class":508},[466,1202,1049],{"class":863},[466,1204,1141],{"class":508},[466,1206,1144],{"class":863},[466,1208,1017],{"class":894},[466,1210,1020],{"class":508},[466,1212,1213],{"class":894},"Files",[466,1215,1216],{"class":508},"()) })\n",[466,1218,1220],{"class":468,"line":1219},29,[466,1221,881],{"emptyLinePlaceholder":880},[466,1223,1225],{"class":468,"line":1224},30,[466,1226,1227],{"class":670},"\u002F\u002F Kit returns the loaded tutorial kit. It is safe for concurrent use and\n",[466,1229,1231],{"class":468,"line":1230},31,[466,1232,1233],{"class":670},"\u002F\u002F returns the same *kit.Kit on every call.\n",[466,1235,1237,1239,1242,1244,1246,1248,1250,1252,1254,1256,1258,1260,1263],{"class":468,"line":1236},32,[466,1238,891],{"class":863},[466,1240,1241],{"class":894}," Kit",[466,1243,1190],{"class":508},[466,1245,1037],{"class":863},[466,1247,217],{"class":472},[466,1249,574],{"class":508},[466,1251,1044],{"class":472},[466,1253,406],{"class":508},[466,1255,1049],{"class":863},[466,1257,1141],{"class":508},[466,1259,1144],{"class":863},[466,1261,1262],{"class":894}," loadOnce",[466,1264,1265],{"class":508},"() }\n",[466,1267,1269],{"class":468,"line":1268},33,[466,1270,881],{"emptyLinePlaceholder":880},[466,1272,1274],{"class":468,"line":1273},34,[466,1275,1276],{"class":670},"\u002F\u002F MustKit is Kit that panics on error; the embedded kit is tested, so an\n",[466,1278,1280],{"class":468,"line":1279},35,[466,1281,1282],{"class":670},"\u002F\u002F error means a broken build.\n",[466,1284,1286,1288,1291,1293,1295,1297,1299,1301],{"class":468,"line":1285},36,[466,1287,891],{"class":863},[466,1289,1290],{"class":894}," MustKit",[466,1292,898],{"class":508},[466,1294,1037],{"class":863},[466,1296,217],{"class":472},[466,1298,574],{"class":508},[466,1300,1044],{"class":472},[466,1302,909],{"class":508},[466,1304,1306,1309,1311,1313],{"class":468,"line":1305},37,[466,1307,1308],{"class":508},"    k, err ",[466,1310,917],{"class":863},[466,1312,1241],{"class":894},[466,1314,1315],{"class":508},"()\n",[466,1317,1319,1321,1323,1325,1327],{"class":468,"line":1318},38,[466,1320,937],{"class":863},[466,1322,940],{"class":508},[466,1324,943],{"class":863},[466,1326,946],{"class":495},[466,1328,909],{"class":508},[466,1330,1332,1334],{"class":468,"line":1331},39,[466,1333,953],{"class":894},[466,1335,1336],{"class":508},"(err)\n",[466,1338,1340],{"class":468,"line":1339},40,[466,1341,965],{"class":508},[466,1343,1345,1347],{"class":468,"line":1344},41,[466,1346,971],{"class":863},[466,1348,1349],{"class":508}," k\n",[466,1351,1353],{"class":468,"line":1352},42,[466,1354,980],{"class":508},[576,1356,1357,1374,1386,1402],{},[579,1358,1359,1364,1365,1368,1369,1371,1372,574],{},[215,1360,1361],{},[220,1362,1363],{},"fs.Sub"," matters: ",[220,1366,1367],{},"kit.Load"," expects ",[220,1370,79],{}," at the root of the ",[220,1373,222],{},[579,1375,1376,1380,1381,1383,1384,574],{},[215,1377,1378],{},[220,1379,1367],{}," decodes every file, checks every reference between them, runs ",[220,1382,307],{},"'s escaper over the HTML templates and type-checks every template against its view. It returns the kit, or every problem it found, joined, each at its position in a kit file. See ",[294,1385,92],{"href":93},[579,1387,1388,1391,1392,1395,1396,1399,1400,574],{},[215,1389,1390],{},"Options"," pass what only Go can supply: ",[220,1393,1394],{},"kit.Types"," registers the Go types components bind, and ",[220,1397,1398],{},"kit.Funcs"," adds template functions. See ",[294,1401,97],{"href":98},[579,1403,1404,1410,1411,1414,1415,1418,1419,1421,1422,1424],{},[215,1405,1406,1407],{},"A loaded ",[220,1408,1409],{},"*kit.Kit"," is immutable and safe for concurrent use. Compile every template against it (",[220,1412,1413],{},"lttr.Compile[T](k, name, src)",") and build every renderer on it (",[220,1416,1417],{},"lttr.Config{Kit: k}","). A template renders only with a renderer built on the same ",[220,1420,1409],{}," it was compiled against. A second ",[220,1423,1367],{}," of the same files is a different kit, so load once and share it.",[211,1426,1427,1428,406,1431,1434,1435,604,1438,1441,1442,1445,1446,1449,1450,1453,1454,1457,1458,1461,1462,574],{},"The shipped kits follow the same pattern: ",[220,1429,1430],{},"plain.Kit()",[220,1432,1433],{},"plain.MustKit()"," and ",[220,1436,1437],{},"plain.Files()",[220,1439,1440],{},"github.com\u002Fsulv-io\u002Flttr\u002Fkits\u002Fplain",". ",[220,1443,1444],{},"plain.Set(cfg)"," returns Plain's samples as an ",[220,1447,1448],{},"lttr.SampleSet",", built from ",[220,1451,1452],{},"samples\u002F"," by ",[220,1455,1456],{},"lttr.KitSamples",", the same set ",[220,1459,1460],{},"lttr kit check"," renders. See ",[294,1463,159],{"href":1464},"\u002Ftooling\u002Fgoldens-and-testing#describe-samples-once",[237,1466,1468],{"id":1467},"meet-the-two-shipped-kits","Meet the two shipped kits",[259,1470,1471,1483],{},[262,1472,1473],{},[265,1474,1475,1477,1480],{},[268,1476],{},[268,1478,1479],{},"Plain",[268,1481,1482],{},"Quiet",[278,1484,1485,1499,1510,1557,1578],{},[265,1486,1487,1490,1494],{},[283,1488,1489],{},"Package",[283,1491,1492],{},[220,1493,1440],{},[283,1495,1496],{},[220,1497,1498],{},"github.com\u002Fsulv-io\u002Flttr\u002Fkits\u002Fquiet",[265,1500,1501,1504,1507],{},[283,1502,1503],{},"Design",[283,1505,1506],{},"One left-aligned column, a system sans-serif stack, square buttons, light and dark colours",[283,1508,1509],{},"A calm, centred design with a serif display face",[265,1511,1512,1514,1537],{},[283,1513,48],{},[283,1515,1516,1519,1520,406,1523,406,1526,1529,1530,1533,1534],{},[220,1517,1518],{},"section"," (the default), ",[220,1521,1522],{},"button",[220,1524,1525],{},"image",[220,1527,1528],{},"columns"," (of ",[220,1531,1532],{},"column","), ",[220,1535,1536],{},"footer",[283,1538,1539,1540,1434,1543,1546,1547,1434,1550,509,1553,1556],{},"24, from ",[220,1541,1542],{},"statement",[220,1544,1545],{},"receipt"," to ",[220,1548,1549],{},"stories",[220,1551,1552],{},"signoff",[220,1554,1555],{},"letter"," is the default",[265,1558,1559,1562,1565],{},[283,1560,1561],{},"Go types and functions",[283,1563,1564],{},"None: everything it does is in its files",[283,1566,1567,1568,406,1571,406,1574,1577],{},"Registers Go types (",[220,1569,1570],{},"Money",[220,1572,1573],{},"Receipt",[220,1575,1576],{},"Product",", …) and template functions",[265,1579,1580,1583,1588],{},[283,1581,1582],{},"Use it for",[283,1584,1585,1586],{},"The base of your own kit, via ",[220,1587,455],{},[283,1589,1590,1591,1594],{},"A complete reference: the nine Loam emails in ",[220,1592,1593],{},"examples\u002Fquiet"," are the engine's conformance suite",[211,1596,825,1597,1600,1601,1604],{},[294,1598,1599],{"href":202},"gallery"," renders every sample of both kits. The ",[294,1602,1603],{"href":176},"Quiet kit"," guide walks through Quiet.",[237,1606,1608],{"id":1607},"next-steps","Next steps",[576,1610,1611,1616,1621],{},[579,1612,1613,1615],{},[294,1614,79],{"href":80},": tokens, vars and every other key.",[579,1617,1618,1620],{},[294,1619,84],{"href":85},": what a component accepts.",[579,1622,1623,1625],{},[294,1624,88],{"href":89},": what a template sees, and every core function.",[1627,1628,1629],"style",{},"html pre.shiki code .sSlKG, html code.shiki .sSlKG{--shiki-light:#702C00;--shiki-default:#702C00;--shiki-dark:#B392F0}html pre.shiki code .sRBGO, html code.shiki .sRBGO{--shiki-light:#032563;--shiki-default:#032563;--shiki-dark:#9ECBFF}html pre.shiki code .sTl1q, html code.shiki .sTl1q{--shiki-light:#023B95;--shiki-default:#023B95;--shiki-dark:#79B8FF}html pre.shiki code .sihDN, html code.shiki .sihDN{--shiki-light:#0E1116;--shiki-default:#0E1116;--shiki-dark:#E1E4E8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBq4M, html code.shiki .sBq4M{--shiki-light:#66707B;--shiki-default:#66707B;--shiki-dark:#6A737D}html pre.shiki code .s71pN, html code.shiki .s71pN{--shiki-light:#024C1A;--shiki-default:#024C1A;--shiki-dark:#85E89D}html pre.shiki code .s1Q0q, html code.shiki .s1Q0q{--shiki-light:#A0111F;--shiki-default:#A0111F;--shiki-dark:#F97583}html pre.shiki code .sPmw6, html code.shiki .sPmw6{--shiki-light:#622CBC;--shiki-default:#622CBC;--shiki-dark:#B392F0}html pre.shiki code .s-BBy, html code.shiki .s-BBy{--shiki-light:#702C00;--shiki-default:#702C00;--shiki-dark:#FFAB70}",{"title":252,"searchDepth":489,"depth":489,"links":1631},[1632,1633,1634,1635,1636],{"id":239,"depth":489,"text":240},{"id":449,"depth":489,"text":450},{"id":831,"depth":489,"text":832},{"id":1467,"depth":489,"text":1468},{"id":1607,"depth":489,"text":1608},"A kit is a directory of YAML and Go templates that gives lttr its look and its components. The files, how Go loads them, and the two kits lttr ships.","md",null,{},{"icon":77},{"title":74,"description":1637},"bX4SfZCf2iI31BqhkJNOd6t2eJFi-6jDYQPxyNnyQ_U",[1645,1647],{"title":63,"path":64,"stem":65,"description":1646,"icon":66,"children":-1},"What lttr.Compile reports, how to read it in Go and from the CLI, the warnings, and the common errors with their fixes.",{"title":79,"path":80,"stem":81,"description":1648,"icon":82,"children":-1},"Every key of kit.yaml — name, default component, dark mode, tokens, vars, spans, inline styles, limits, Go types and frontmatter — and how token names resolve.",1790467458233]