[{"data":1,"prerenderedAt":3718},["ShallowReactive",2],{"navigation_docs":3,"-tooling-studio":205,"-tooling-studio-surround":3713},[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":144,"body":207,"description":3706,"extension":3707,"links":3708,"meta":3709,"navigation":3710,"path":145,"seo":3711,"stem":146,"__hash__":3712},"docs\u002F5.tooling\u002F2.studio.md",{"type":208,"value":209,"toc":3682},"minimark",[210,219,222,225,252,269,274,337,352,632,639,703,736,740,747,848,871,881,884,961,965,1028,1032,1035,1160,1163,1167,1174,1290,1293,1297,1308,1382,1391,1395,1435,1466,1488,1492,1497,1547,1577,1582,1588,1591,1597,1625,1629,1634,1679,1703,1720,1730,1744,1748,1754,1757,1800,1847,1853,1862,1881,1935,1945,1956,1960,1973,2043,2050,2054,2061,2077,2081,2096,2284,2319,2339,2343,2352,2506,2509,2527,2531,2835,3063,3070,3073,3092,3140,3144,3147,3327,3330,3351,3358,3521,3525,3540,3558,3564,3631,3647,3651,3678],[211,212,213,214,218],"p",{},"The studio is the day-to-day way to see a kit's samples while you edit them. It opens with a grid of every sample. Each sample opens in a workbench that shows the email at 600 and 375 px, in light and dark, next to its problems as ",[215,216,217],"code",{},"file:line:col"," lines. A save re-renders only what it changed, and the page updates in place within half a second.",[211,220,221],{},"From the workbench you can also try other data on a sample, review its render against the golden files and accept it, and send it to your own inbox. The components page shows every component of the kit with its schema and a rendered example.",[211,223,224],{},"There are two ways to run it:",[226,227,228,238],"ul",{},[229,230,231,237],"li",{},[232,233,234],"strong",{},[215,235,236],{},"lttr serve"," runs it for the built-in kits and for any kit directory on disk.",[229,239,240,247,248,251],{},[232,241,242,243,246],{},"The ",[215,244,245],{},"studio"," library"," runs it for an app whose templates bind its own Go types, which the ",[215,249,250],{},"lttr"," binary cannot know.",[211,253,254,255,258,259,262,263,268],{},"Either can also run inside your editor's language server, as ",[215,256,257],{},"lttr lsp -studio"," or ",[215,260,261],{},"emaildev lsp -studio",", so the preview follows what you type before you save. See ",[264,265,267],"a",{"href":266},"#follow-your-editors-unsaved-text","Follow your editor's unsaved text",".",[270,271,273],"h2",{"id":272},"run-lttr-serve","Run lttr serve",[275,276,282],"pre",{"className":277,"code":278,"filename":279,"language":280,"meta":281,"style":281},"language-bash shiki shiki-themes github-light-high-contrast github-light-high-contrast github-dark","$ go run .\u002Fcmd\u002Flttr serve -kit .\u002Fkit\nlttr studio: serving kit (2 samples) on http:\u002F\u002Flocalhost:7070\n","Terminal","bash","",[215,283,284,313],{"__ignoreMap":281},[285,286,289,293,297,300,303,306,310],"span",{"class":287,"line":288},"line",1,[285,290,292],{"class":291},"sSlKG","$",[285,294,296],{"class":295},"sRBGO"," go",[285,298,299],{"class":295}," run",[285,301,302],{"class":295}," .\u002Fcmd\u002Flttr",[285,304,305],{"class":295}," serve",[285,307,309],{"class":308},"sTl1q"," -kit",[285,311,312],{"class":295}," .\u002Fkit\n",[285,314,316,318,321,324,327,331,334],{"class":287,"line":315},2,[285,317,250],{"class":291},[285,319,320],{"class":295}," studio:",[285,322,323],{"class":295}," serving",[285,325,326],{"class":295}," kit",[285,328,330],{"class":329},"sihDN"," (2 ",[285,332,333],{"class":295},"samples",[285,335,336],{"class":329},") on http:\u002F\u002Flocalhost:7070\n",[211,338,339,340,343,344,347,348,351],{},"Open the address in a browser. ",[215,341,342],{},"make serve"," runs the same command with the Makefile's ",[215,345,346],{},"KIT"," (default ",[215,349,350],{},"quiet","). Stop it with Ctrl-C.",[275,353,355],{"className":277,"code":354,"filename":279,"language":280,"meta":281,"style":281},"$ go run .\u002Fcmd\u002Flttr serve -h\nusage: lttr serve [-kit kit] [-dir dir] [-addr host:port] [-golden dir] [-editor name] [-send-to addr,…]\n\nRuns the lttr studio, a live preview of the kit's samples, until interrupted:\na grid of every sample and a workbench for one, with its problems as\nfile:line:col lines. A save reloads what it changed: for quiet the example\ntemplates in -dir (default examples\u002Fquiet\u002Ftemplates); for plain, the samples\nin -dir (its embedded samples, which do not change, without it); for a kit\ndirectory, the whole kit (kit.yaml, templates, styles, samples\u002F, or the\nsamples in -dir). A kit that fails to load shows its problems until it loads.\n\nGolden status compares each render with \u003CName>.html and \u003CName>.txt in\n-golden: by default testdata\u002Fgolden for quiet, \u003Cdir>\u002Ftestdata\u002Fgolden for a\nkit directory, when it exists; -golden \"\" turns it off.\n\nTest sends go only to the addresses in -send-to (else LTTR_STUDIO_SEND_TO),\nat most 10 a minute, marked with a \"[test] \" subject prefix and an\nX-Lttr-Test: 1 header, through the SMTP server in LTTR_SMTP_ADDR (host:port),\nwith PLAIN auth when LTTR_SMTP_USER and LTTR_SMTP_PASS are set, and from\nLTTR_SMTP_FROM when set. Without a list or a server, sending is off.\n\nflags:\n  -addr address\n        listen address (default \"localhost:7070\")\n  -dir dir\n        template or sample source dir (see above)\n  -editor editor\n        editor that problem links open: vscode, cursor, zed, idea or none (default \"vscode\")\n  -golden dir\n        golden dir (see above)\n  -kit kit\n        kit: quiet (the examples), plain, or a kit directory (.\u002Fplain for a directory called plain) (default \"quiet\")\n  -send-to addresses\n        addresses test sends may go to, comma-separated (else LTTR_STUDIO_SEND_TO); SMTP from LTTR_SMTP_ADDR, _USER, _PASS and _FROM\n",[215,356,357,372,417,424,455,461,467,473,479,485,491,496,502,508,514,519,525,531,537,543,549,554,560,566,572,578,584,590,596,602,608,614,620,626],{"__ignoreMap":281},[285,358,359,361,363,365,367,369],{"class":287,"line":288},[285,360,292],{"class":291},[285,362,296],{"class":295},[285,364,299],{"class":295},[285,366,302],{"class":295},[285,368,305],{"class":295},[285,370,371],{"class":308}," -h\n",[285,373,374,377,380,382,385,388,391,394,397,400,403,405,408,411,414],{"class":287,"line":315},[285,375,376],{"class":291},"usage:",[285,378,379],{"class":295}," lttr",[285,381,305],{"class":295},[285,383,384],{"class":329}," [-kit ",[285,386,387],{"class":295},"kit]",[285,389,390],{"class":329}," [-dir ",[285,392,393],{"class":295},"dir]",[285,395,396],{"class":329}," [-addr ",[285,398,399],{"class":295},"host:port]",[285,401,402],{"class":329}," [-golden ",[285,404,393],{"class":295},[285,406,407],{"class":329}," [-editor ",[285,409,410],{"class":295},"name]",[285,412,413],{"class":329}," [-send-to ",[285,415,416],{"class":295},"addr,…]\n",[285,418,420],{"class":287,"line":419},3,[285,421,423],{"emptyLinePlaceholder":422},true,"\n",[285,425,427,430,433,435,438,441,444,447,450,452],{"class":287,"line":426},4,[285,428,429],{"class":291},"Runs",[285,431,432],{"class":295}," the",[285,434,379],{"class":295},[285,436,437],{"class":295}," studio,",[285,439,440],{"class":295}," a",[285,442,443],{"class":295}," live",[285,445,446],{"class":295}," preview",[285,448,449],{"class":295}," of",[285,451,432],{"class":295},[285,453,454],{"class":295}," kit's samples, until interrupted:\n",[285,456,458],{"class":287,"line":457},5,[285,459,460],{"class":295},"a grid of every sample and a workbench for one, with its problems as\n",[285,462,464],{"class":287,"line":463},6,[285,465,466],{"class":295},"file:line:col lines. A save reloads what it changed: for quiet the example\n",[285,468,470],{"class":287,"line":469},7,[285,471,472],{"class":295},"templates in -dir (default examples\u002Fquiet\u002Ftemplates); for plain, the samples\n",[285,474,476],{"class":287,"line":475},8,[285,477,478],{"class":295},"in -dir (its embedded samples, which do not change, without it); for a kit\n",[285,480,482],{"class":287,"line":481},9,[285,483,484],{"class":295},"directory, the whole kit (kit.yaml, templates, styles, samples\u002F, or the\n",[285,486,488],{"class":287,"line":487},10,[285,489,490],{"class":295},"samples in -dir). A kit that fails to load shows its problems until it loads.\n",[285,492,494],{"class":287,"line":493},11,[285,495,423],{"emptyLinePlaceholder":422},[285,497,499],{"class":287,"line":498},12,[285,500,501],{"class":295},"Golden status compares each render with \u003CName>.html and \u003CName>.txt in\n",[285,503,505],{"class":287,"line":504},13,[285,506,507],{"class":295},"-golden: by default testdata\u002Fgolden for quiet, \u003Cdir>\u002Ftestdata\u002Fgolden for a\n",[285,509,511],{"class":287,"line":510},14,[285,512,513],{"class":295},"kit directory, when it exists; -golden \"\" turns it off.\n",[285,515,517],{"class":287,"line":516},15,[285,518,423],{"emptyLinePlaceholder":422},[285,520,522],{"class":287,"line":521},16,[285,523,524],{"class":295},"Test sends go only to the addresses in -send-to (else LTTR_STUDIO_SEND_TO),\n",[285,526,528],{"class":287,"line":527},17,[285,529,530],{"class":295},"at most 10 a minute, marked with a \"[test] \" subject prefix and an\n",[285,532,534],{"class":287,"line":533},18,[285,535,536],{"class":295},"X-Lttr-Test: 1 header, through the SMTP server in LTTR_SMTP_ADDR (host:port),\n",[285,538,540],{"class":287,"line":539},19,[285,541,542],{"class":295},"with PLAIN auth when LTTR_SMTP_USER and LTTR_SMTP_PASS are set, and from\n",[285,544,546],{"class":287,"line":545},20,[285,547,548],{"class":295},"LTTR_SMTP_FROM when set. Without a list or a server, sending is off.\n",[285,550,552],{"class":287,"line":551},21,[285,553,423],{"emptyLinePlaceholder":422},[285,555,557],{"class":287,"line":556},22,[285,558,559],{"class":295},"flags:\n",[285,561,563],{"class":287,"line":562},23,[285,564,565],{"class":295},"  -addr address\n",[285,567,569],{"class":287,"line":568},24,[285,570,571],{"class":295},"        listen address (default \"localhost:7070\")\n",[285,573,575],{"class":287,"line":574},25,[285,576,577],{"class":295},"  -dir dir\n",[285,579,581],{"class":287,"line":580},26,[285,582,583],{"class":295},"        template or sample source dir (see above)\n",[285,585,587],{"class":287,"line":586},27,[285,588,589],{"class":295},"  -editor editor\n",[285,591,593],{"class":287,"line":592},28,[285,594,595],{"class":295},"        editor that problem links open: vscode, cursor, zed, idea or none (default \"vscode\")\n",[285,597,599],{"class":287,"line":598},29,[285,600,601],{"class":295},"  -golden dir\n",[285,603,605],{"class":287,"line":604},30,[285,606,607],{"class":295},"        golden dir (see above)\n",[285,609,611],{"class":287,"line":610},31,[285,612,613],{"class":295},"  -kit kit\n",[285,615,617],{"class":287,"line":616},32,[285,618,619],{"class":295},"        kit: quiet (the examples), plain, or a kit directory (.\u002Fplain for a directory called plain) (default \"quiet\")\n",[285,621,623],{"class":287,"line":622},33,[285,624,625],{"class":295},"  -send-to addresses\n",[285,627,629],{"class":287,"line":628},34,[285,630,631],{"class":295},"        addresses test sends may go to, comma-separated (else LTTR_STUDIO_SEND_TO); SMTP from LTTR_SMTP_ADDR, _USER, _PASS and _FROM\n",[211,633,634,635,638],{},"What a save reloads depends on ",[215,636,637],{},"-kit",":",[226,640,641,676,693],{},[229,642,643,646,647,650,651,653,654,657,658,661,662,665,666,669,670,673,674,268],{},[232,644,645],{},"A kit directory"," (",[215,648,649],{},"-kit .\u002Fkit",") reloads the whole kit: ",[215,652,79],{},", the layouts, ",[215,655,656],{},"styles.css",", every component and ",[215,659,660],{},"samples\u002F",". A token, a component's ",[215,663,664],{},"html.tmpl"," or a sample edit all show up, and so does a sample that names a new ",[215,667,668],{},"profile:",", since the studio makes up a profile for every name the samples use. With ",[215,671,672],{},"-dir",", the samples come from that directory instead of ",[215,675,660],{},[229,677,678,682,683,686,687,347,689,692],{},[232,679,680],{},[215,681,350],{}," (the default) reads each example's ",[215,684,685],{},".md"," source from ",[215,688,672],{},[215,690,691],{},"examples\u002Fquiet\u002Ftemplates",", so run it from a checkout). The Go data types and profiles stay the example package's own.",[229,694,695,700,701,268],{},[232,696,697],{},[215,698,699],{},"plain"," serves its two embedded samples, which do not change, or the samples in ",[215,702,672],{},[211,704,705,706,709,710,258,713,716,717,720,721,724,725,728,729,732,733,735],{},"The studio watches the files by polling them every 200 ms and rebuilds 100 ms after the last change, so a burst of saves gives one rebuild. It ignores dot-files and editors' save temporaries: names ending in ",[215,707,708],{},"~",", ",[215,711,712],{},".swp",[215,714,715],{},".tmp",", Emacs's ",[215,718,719],{},"#name#",", JetBrains's ",[215,722,723],{},"___jb_tmp___"," and ",[215,726,727],{},"___jb_old___"," files, and Vim's ",[215,730,731],{},"4913",". A change to Go code needs a restart: ",[215,734,236],{}," is a compiled program.",[270,737,739],{"id":738},"read-the-grid","Read the grid",[211,741,742,743,746],{},"The grid shows one tile per sample: a thumbnail of the render, the sample's number and name, and ",[232,744,745],{},"one status badge",". When a sample has more than one status, the badge shows the first that applies, in this order:",[748,749,750,763],"table",{},[751,752,753],"thead",{},[754,755,756,760],"tr",{},[757,758,759],"th",{},"Badge",[757,761,762],{},"Meaning",[764,765,766,777,787,804,814,824,838],"tbody",{},[754,767,768,774],{},[769,770,771],"td",{},[215,772,773],{},"◌ stale",[769,775,776],{},"The template no longer compiles or renders. The tile keeps the last good render, dimmed.",[754,778,779,784],{},[769,780,781],{},[215,782,783],{},"⚠ N problems",[769,785,786],{},"The render is current, with N errors and warnings.",[754,788,789,794],{},[769,790,791],{},[215,792,793],{},"✕ not rendered",[769,795,796,797,800,801,268],{},"The sample has never rendered, with no problem of its own: the kit broke before it could. A broken render config shows ",[215,798,799],{},"⚠ 1 problem"," instead, with the problem ",[215,802,803],{},"not rendered: the render config is invalid for this kit; see the kit problems",[754,805,806,811],{},[769,807,808],{},[215,809,810],{},"Δ changed",[769,812,813],{},"The render differs from its golden files.",[754,815,816,821],{},[769,817,818],{},[215,819,820],{},"golden ✓",[769,822,823],{},"The HTML and text equal the golden files byte for byte.",[754,825,826,831],{},[769,827,828],{},[215,829,830],{},"○ golden off",[769,832,833,834,837],{},"Golden status is off (",[215,835,836],{},"-golden \"\"",", or no golden directory).",[754,839,840,845],{},[769,841,842],{},[215,843,844],{},"○ no golden",[769,846,847],{},"There is no golden file to compare with yet.",[211,849,850,851,855,856,258,859,862,863,866,867,268],{},"A second badge shows the HTML size when it is over 90 KB (see ",[264,852,854],{"href":853},"#watch-the-size-budget","the size budget","). The summary line above the grid counts the samples by status, for example ",[215,857,858],{},"2 match golden ✓",[215,860,861],{},"1 Δ changed · 1 ◌ stale",", and the filter box narrows the tiles by name. The ",[232,864,865],{},"Samples | Components"," switch next to the kit's name opens ",[264,868,870],{"href":869},"#browse-the-components","the components page",[211,872,873,874,877,878],{},"When a save re-renders a sample, its tile shows ",[215,875,876],{},"● updated"," for a moment and a screen reader hears one short announcement, such as ",[215,879,880],{},"welcome re-rendered, differs from golden.",[211,882,883],{},"The pill at the top right says what the studio is doing:",[748,885,886,895],{},[751,887,888],{},[754,889,890,893],{},[757,891,892],{},"Pill",[757,894,762],{},[764,896,897,907,921,931,941,951],{},[754,898,899,904],{},[769,900,901],{},[215,902,903],{},"Live · watching .\u002Fkit",[769,905,906],{},"Watching that directory; a save reloads.",[754,908,909,914],{},[769,910,911],{},[215,912,913],{},"Live · unsaved buffer",[769,915,916,917,920],{},"The page shows a render of text you haven't saved yet, from the ",[264,918,919],{"href":266},"language server",". On the workbench, it is that sample's text; on the grid, any sample's.",[754,922,923,928],{},[769,924,925],{},[215,926,927],{},"Live · kit has problems",[769,929,930],{},"Watching, and the kit's own files have problems.",[754,932,933,938],{},[769,934,935],{},[215,936,937],{},"Kit failed to load · watching",[769,939,940],{},"The kit has never loaded; the page lists why.",[754,942,943,948],{},[769,944,945],{},[215,946,947],{},"Serving embedded files",[769,949,950],{},"Not live: nothing on disk is watched.",[754,952,953,958],{},[769,954,955],{},[215,956,957],{},"Reconnecting…",[769,959,960],{},"The page lost its connection to the server.",[270,962,964],{"id":963},"know-the-states","Know the states",[226,966,967,977,990,1010,1020],{},[229,968,969,972,973,976],{},[232,970,971],{},"The kit didn't load."," When the kit fails to load at startup, there is nothing to render yet. The page lists every problem with its location, such as ",[215,974,975],{},"kit\u002Fkit.yaml:8",", and a suggestion when there is one. Fix the files and the page switches to the grid by itself, within a second of the save, with every sample's profile in place. There is no need to restart or reload.",[229,978,979,982,983,985,986,989],{},[232,980,981],{},"The kit has problems."," When a loaded kit breaks later, a callout names the first problem and lists the rest. If the kit no longer loads at all, every sample keeps its last good render, marked ",[215,984,773],{},". A problem that leaves the kit loading, such as a typo in ",[215,987,988],{},"samples\u002Fsamples.yaml",", stales only the samples that can no longer render (here, the one whose data the typo lost), and the others keep their badges.",[229,991,992,995,996,999,1000,1002,1003,724,1006,1009],{},[232,993,994],{},"Not live."," When nothing is watched (",[215,997,998],{},"lttr serve -kit plain"," without ",[215,1001,672],{},", or the library without ",[215,1004,1005],{},"KitDir",[215,1007,1008],{},"TemplateDir","), a notice says so, with the way to make it live. You can dismiss the notice for the session.",[229,1011,1012,1015,1016,1019],{},[232,1013,1014],{},"Connection lost."," When the server stops, the page retries after 1, 2, 4 and 8 seconds, then every 8 seconds. ",[232,1017,1018],{},"Retry now"," tries at once. When it reconnects, to the same server or to one restarted meanwhile, the page catches up on every change it missed.",[229,1021,1022,1025,1026,268],{},[232,1023,1024],{},"No samples."," An empty kit shows how to add a sample to ",[215,1027,988],{},[270,1029,1031],{"id":1030},"use-the-workbench","Use the workbench",[211,1033,1034],{},"Open a tile, or press Enter on it, to open its workbench:",[226,1036,1037,1051,1061,1095,1104,1154],{},[229,1038,1039,1042,1043,1046,1047,268],{},[232,1040,1041],{},"The top bar"," has the sample list toggle, previous and next buttons, a switcher listing every sample, and ",[232,1044,1045],{},"Send test",", which opens ",[264,1048,1050],{"href":1049},"#send-a-test","the Send tab",[229,1052,1053,1056,1057,1060],{},[232,1054,1055],{},"The sample list"," on the left shows each sample's status glyph. It has its own filter. Below it, ",[215,1058,1059],{},"\u002F\u002F COMPONENTS"," lists the components the sample uses, each a link to its page on the components page.",[229,1062,1063,1066,1067],{},[232,1064,1065],{},"The toolbar"," above the preview sets:\n",[226,1068,1069,1079,1089],{},[229,1070,1071,1074,1075,1078],{},[232,1072,1073],{},"Width:"," 600, 375, or Both side by side. Frames that do not fit are scaled down, and the zoom note says by how much (",[215,1076,1077],{},"600 + 375 · 73%",").",[229,1080,1081,1084,1085,1088],{},[232,1082,1083],{},"Email:"," Light or Dark. This switches the email's own ",[215,1086,1087],{},"prefers-color-scheme"," rules inside the frame, as a dark-mode mail client would. It is not the studio's theme.",[229,1090,1091,1094],{},[232,1092,1093],{},"View:"," HTML, Text (the plain-text part) or Source (the template source, with line numbers).",[229,1096,1097,1100,1101],{},[232,1098,1099],{},"The stale callout"," appears above the preview when the render is stale: ",[215,1102,1103],{},"Showing the last good render: this sample has problems.",[229,1105,1106,1109,1110],{},[232,1107,1108],{},"The inspector"," on the right has four tabs:\n",[226,1111,1112,1125,1135,1145],{},[229,1113,1114,1117,1118,1121,1122,268],{},[232,1115,1116],{},"Problems"," lists each error and warning: its severity, its location (a link to your editor), the message, and a ",[232,1119,1120],{},"did you mean X? copy"," chip when lttr has a suggestion. The chip copies the suggestion. A problem in a kit file is tagged ",[215,1123,1124],{},"kit file",[229,1126,1127,1130,1131,268],{},[232,1128,1129],{},"Data"," shows the sample's data as JSON, to ",[264,1132,1134],{"href":1133},"#try-other-data","try other values",[229,1136,1137,1140,1141,268],{},[232,1138,1139],{},"Diff"," compares the render with its golden files, to ",[264,1142,1144],{"href":1143},"#review-and-accept-a-golden","review and accept it",[229,1146,1147,1150,1151,268],{},[232,1148,1149],{},"Send"," ",[264,1152,1153],{"href":1049},"sends the render to an allowed inbox",[229,1155,1156,1159],{},[232,1157,1158],{},"The status line"," at the bottom shows the problem count, the golden status and the size, and reminds you that changes to Go data or types need a restart.",[211,1161,1162],{},"The studio opens in its light theme. The moon button switches it to dark, and the choice is remembered. The studio does not follow the system's dark mode. The Light and Dark email toggle is separate.",[270,1164,1166],{"id":1165},"keyboard-shortcuts","Keyboard shortcuts",[211,1168,1169,1170,1173],{},"Press ",[215,1171,1172],{},"?"," for this list in the studio. Shortcuts pause while a text field has focus.",[748,1175,1176,1189],{},[751,1177,1178],{},[754,1179,1180,1183,1186],{},[757,1181,1182],{},"Key",[757,1184,1185],{},"Where",[757,1187,1188],{},"Does",[764,1190,1191,1208,1222,1235,1253,1265,1277],{},[754,1192,1193,1202,1205],{},[769,1194,1195,1198,1199],{},[215,1196,1197],{},"j"," \u002F ",[215,1200,1201],{},"k",[769,1203,1204],{},"Grid",[769,1206,1207],{},"Focus the next or previous tile",[754,1209,1210,1216,1219],{},[769,1211,1212,1198,1214],{},[215,1213,1197],{},[215,1215,1201],{},[769,1217,1218],{},"Workbench",[769,1220,1221],{},"Open the next or previous sample",[754,1223,1224,1229,1232],{},[769,1225,1226],{},[215,1227,1228],{},"g",[769,1230,1231],{},"Workbench, components page",[769,1233,1234],{},"Back to the grid (on the grid: to the top)",[754,1236,1237,1248,1250],{},[769,1238,1239,1198,1242,1198,1245],{},[215,1240,1241],{},"1",[215,1243,1244],{},"2",[215,1246,1247],{},"3",[769,1249,1218],{},[769,1251,1252],{},"Width 600, 375, or both",[754,1254,1255,1260,1262],{},[769,1256,1257],{},[215,1258,1259],{},"d",[769,1261,1218],{},[769,1263,1264],{},"Email dark mode on or off (not the studio theme)",[754,1266,1267,1271,1274],{},[769,1268,1269],{},[215,1270,1172],{},[769,1272,1273],{},"Anywhere",[769,1275,1276],{},"Show the shortcuts",[754,1278,1279,1284,1287],{},[769,1280,1281],{},[215,1282,1283],{},"Esc",[769,1285,1286],{},"Dialog, switcher",[769,1288,1289],{},"Close it",[211,1291,1292],{},"Each toolbar group and the inspector's tab row is one Tab stop. Inside it, the arrow keys move the selection, and Home and End jump to the ends. Every control shows a focus ring.",[270,1294,1296],{"id":1295},"open-problems-in-your-editor","Open problems in your editor",[211,1298,1299,1300,1303,1304,1307],{},"A problem's location links to the file in your editor, at its line and column. ",[215,1301,1302],{},"-editor"," (or ",[215,1305,1306],{},"Options.Editor",") picks the editor. The link is built from the file's absolute path:",[748,1309,1310,1321],{},[751,1311,1312],{},[754,1313,1314,1318],{},[757,1315,1316],{},[215,1317,1302],{},[757,1319,1320],{},"Link",[764,1322,1323,1336,1348,1360,1372],{},[754,1324,1325,1331],{},[769,1326,1327,1330],{},[215,1328,1329],{},"vscode"," (default)",[769,1332,1333],{},[215,1334,1335],{},"vscode:\u002F\u002Ffile\u002F\u003Cpath>:\u003Cline>:\u003Ccol>",[754,1337,1338,1343],{},[769,1339,1340],{},[215,1341,1342],{},"cursor",[769,1344,1345],{},[215,1346,1347],{},"cursor:\u002F\u002Ffile\u002F\u003Cpath>:\u003Cline>:\u003Ccol>",[754,1349,1350,1355],{},[769,1351,1352],{},[215,1353,1354],{},"zed",[769,1356,1357],{},[215,1358,1359],{},"zed:\u002F\u002Ffile\u002F\u003Cpath>:\u003Cline>:\u003Ccol>",[754,1361,1362,1367],{},[769,1363,1364],{},[215,1365,1366],{},"idea",[769,1368,1369],{},[215,1370,1371],{},"idea:\u002F\u002Fopen?file=\u003Cpath>&line=\u003Cline>&column=\u003Ccol>",[754,1373,1374,1379],{},[769,1375,1376],{},[215,1377,1378],{},"none",[769,1380,1381],{},"no link",[211,1383,1384,1385,999,1388,1390],{},"Only files on disk get a link. A location inside an embedded file (a built-in kit, or an app's ",[215,1386,1387],{},"go:embed",[215,1389,1005],{},") shows as plain text.",[270,1392,1394],{"id":1393},"compare-with-goldens","Compare with goldens",[211,1396,1397,1398,724,1401,1404,1405,1408,1409,1414,1415,1417,1418,1421,1422,724,1424,1427,1428,1431,1432,1434],{},"Golden status compares each render with ",[215,1399,1400],{},"\u003CName>.html",[215,1402,1403],{},"\u003CName>.txt"," in the golden directory, byte for byte. ",[215,1406,1407],{},"Name"," is the template's name, which is the convention ",[264,1410,1411],{"href":160},[215,1412,1413],{},"lint.Golden"," uses. By default ",[215,1416,236],{}," reads ",[215,1419,1420],{},"testdata\u002Fgolden"," for ",[215,1423,350],{},[215,1425,1426],{},"\u003Cdir>\u002Ftestdata\u002Fgolden"," for a kit directory, when it exists. ",[215,1429,1430],{},"-golden dir"," picks another, and ",[215,1433,836],{}," turns it off.",[211,1436,1437,1438,709,1441,709,1444,1447,1448,1450,1451,1454,1455,1458,1459,646,1462,1465],{},"The status line says ",[215,1439,1440],{},"golden ✓ match",[215,1442,1443],{},"Δ differs from golden",[215,1445,1446],{},"○ no golden yet"," or, with golden status off, ",[215,1449,830],{},". A stale sample is ",[215,1452,1453],{},"◌ stale · not compared",". To update a golden, accept the render in ",[264,1456,1457],{"href":1143},"the Diff tab",", or run your golden test with ",[215,1460,1461],{},"-update",[215,1463,1464],{},"make golden"," for Quiet), and review the diff.",[211,1467,1468,1469,1472,1473,1475,1476,1479,1480,1483,1484,1487],{},"The studio renders with the sample set's own ",[215,1470,1471],{},"Config",", so it compares exactly what ",[215,1474,1413],{}," sees, with real asset URLs. Only the preview it serves differs. The asset base (",[215,1477,1478],{},"Config.AssetBase",", or the kit's ",[215,1481,1482],{},"asset_base"," var) is rewritten to the studio's ",[215,1485,1486],{},"\u002Fassets\u002F",", so images load from the kit's own files.",[270,1489,1491],{"id":1490},"try-other-data","Try other data",[211,1493,242,1494,1496],{},[232,1495,1129],{}," tab shows the data the sample renders with, as JSON. Edit it to see how the email copes with a long name, an empty list or a missing field:",[226,1498,1499,1513,1532,1537],{},[229,1500,1501,1504,1505,1508,1509,1512],{},[232,1502,1503],{},"The JSON is checked as you type."," An error shows where it is, such as ",[215,1506,1507],{},"✕ Line 4, column 3: expected ',' or '}' after property value",", and ",[232,1510,1511],{},"Apply"," stays off until the JSON parses. The preview keeps the last data you applied.",[229,1514,1515,1517,1518,1521,1522,1525,1526,258,1529,268],{},[232,1516,1511],{}," re-renders the sample with your JSON, in memory. Nothing is written. The data is decoded as the sample's own type, so for Go-typed data an unknown field or a wrong type is refused with its ",[215,1519,1520],{},"line:col",". The tab then says ",[215,1523,1524],{},"● applied in memory at 10:46:46 AM · not saved",". The applied data stays through template and kit edits, until you press ",[232,1527,1528],{},"Reset",[232,1530,1531],{},"Save",[229,1533,1534,1536],{},[232,1535,1528],{}," drops the applied data, and the sample renders with its own data again.",[229,1538,1539,1542,1543,1546],{},[232,1540,1541],{},"Save to samples.yaml"," writes the data into the sample's entry in ",[215,1544,1545],{},"samples.yaml",", then drops the applied data, so the sample renders from the file. It saves what the editor shows, applied or not.",[211,1548,1549,1550,1552,1553,646,1555,1558,1559,1561,1562,1564,1565,999,1567,1569,1570,1573,1574],{},"Save is offered only when the studio reads the sample's data from a ",[215,1551,1545],{}," on disk: a kit directory's ",[215,1554,988],{},[215,1556,1557],{},"lttr serve -kit .\u002Fkit","), or the ",[215,1560,1545],{}," in ",[215,1563,672],{},". It is never offered for an embedded kit (",[215,1566,998],{},[215,1568,672],{},") or in the studio library. There, ",[232,1571,1572],{},"Copy JSON"," copies the data instead. For Go-typed data the tab says: ",[215,1575,1576],{},"This sample's data is a Go value. Copy the JSON into your Go source to keep it.",[1578,1579,1581],"h3",{"id":1580},"what-save-changes","What Save changes",[211,1583,1584,1585,1587],{},"Save rewrites only the sample's own entry. In the usual ",[215,1586,1545],{},", a mapping with each file name at the start of its line, every other entry, and every comment and blank line outside the entry, stay byte for byte. Inside the entry, keys you kept stay in place with their comments, and values you did not change keep how they were written. New keys come after them, in sorted order.",[211,1589,1590],{},"A few files can't be edited that precisely, and Save falls back to writing the whole file again: a flow or indented mapping, a file with unusual line breaks (a lone CR, or U+2028), or an entry whose last line can't be told apart from a comment after it. The data and the comments are kept, but blank lines and layout may change. Comments at the end of a nested block inside the edited entry may be dropped.",[211,1592,1593,1594,1596],{},"Save refuses when the sample's entry in ",[215,1595,1545],{}," changed on disk since the studio loaded it (even while applied data is in use), or when the file changes during the save. Edits to other entries are kept.",[211,1598,1599,1600,1603,1604,1606,1607,1609,1610,1613,1614,1617,1618,1621,1622,268],{},"That refusal reads ",[215,1601,1602],{},"samples.yaml changed on disk; reload",". Nothing is written, and your edit stays in the editor. Under the ",[264,1605,919],{"href":266},", Save also refuses while ",[215,1608,1545],{}," is open in your editor with unsaved changes, since writing would put that unsaved text on disk: ",[215,1611,1612],{},"samples.yaml has unsaved changes in your editor; save it first",". It refuses too, writing nothing, when ",[232,1615,1616],{},"the edit would change another entry",", for example an alias of this entry's anchor, or a keep-chomped block such as ",[215,1619,1620],{},">+"," whose value ends in a blank line: ",[215,1623,1624],{},"samples.yaml: the edit would change other entries (an alias of this entry's anchor?); edit the file by hand",[270,1626,1628],{"id":1627},"review-and-accept-a-golden","Review and accept a golden",[211,1630,242,1631,1633],{},[232,1632,1139],{}," tab compares the current render with the golden files, and writes them when the change is what you meant.",[226,1635,1636,1656,1662],{},[229,1637,1638,1641,1642,1645,1646,258,1649,1652,1653],{},[232,1639,1640],{},"The tab's name"," says the state: ",[215,1643,1644],{},"Diff, 2 changes"," (the hunks in the HTML and the text together), ",[215,1647,1648],{},"Diff, matches golden",[215,1650,1651],{},"Diff, no golden",". With golden status off, the tab is disabled, and the reason shows beside it: ",[215,1654,1655],{},"Golden files are off: no golden directory is set.",[229,1657,1658,1661],{},[232,1659,1660],{},"Golden and current"," renders sit side by side. The captions say when each was made: the golden file's modification time, and when the studio rendered the current one.",[229,1663,1664,1667,1668,1671,1672,1675,1676,268],{},[232,1665,1666],{},"The HTML | Text toggle"," shows a unified diff of either part, with ",[215,1669,1670],{},"@@ -60,7 +60,7 @@"," hunk headers and a stat line such as ",[215,1673,1674],{},"1 hunk · +1 −1",". A line whose only change is its line ending is tagged ",[215,1677,1678],{},"line endings differ",[211,1680,1681,1684,1685,724,1688,1691,1692,1695,1696,1699,1700,268],{},[232,1682,1683],{},"Accept as golden"," asks before it writes anything. The confirm reads ",[215,1686,1687],{},"Accept this render as golden?",[215,1689,1690],{},"This overwrites 2 files. Commit them to make the change stick.",", and lists the two files. ",[232,1693,1694],{},"Accept and write files"," writes them, and ",[232,1697,1698],{},"Cancel"," or Esc closes it. With no golden yet, the button is ",[232,1701,1702],{},"Accept as first golden",[211,1704,1705,1706,724,1709,1711,1712,1716,1717,1719],{},"Accept writes ",[215,1707,1708],{},"\u003Cgolden dir>\u002F\u003CName>.html",[215,1710,1403],{},", the files ",[264,1713,1714],{"href":160},[215,1715,1413],{}," compares, with the render as ",[215,1718,1413],{}," sees it: real asset URLs, not the preview's. It creates the golden directory when it is missing. Commit the files, and your golden test checks against them from then on.",[211,1721,1722,1723,1726,1727],{},"Accept writes the render you reviewed, not a newer one. The page sends the hash of the render the diff showed. If a save re-rendered the sample since, the studio answers ",[215,1724,1725],{},"render changed; review the diff again",", writes nothing, and shows the new diff. A render that is stale, has errors or doesn't exist can't be accepted either, and the tab says why: ",[215,1728,1729],{},"Fix the errors first: a render with errors can’t be golden.",[211,1731,1732,1733,1736,1737,1740,1741],{},"Accept is off while applied data is in use, since a golden is of the data on disk: the tab says ",[215,1734,1735],{},"This render uses applied data; save or reset it first."," Save or reset the data first. For the same reason, Accept is off while the render uses ",[264,1738,1739],{"href":266},"unsaved editor text",": ",[215,1742,1743],{},"This render uses unsaved editor text; save it first.",[270,1745,1747],{"id":1746},"send-a-test","Send a test",[211,1749,1750,1751,1753],{},"Previews are close to what a mail client shows, but not the same. ",[232,1752,1045],{}," sends the current render to a real inbox, so you can check it in Gmail, Outlook or Apple Mail.",[211,1755,1756],{},"Sending is off until you give the studio two things, then restart it:",[226,1758,1759,1772],{},[229,1760,1761,1150,1764,1767,1768,1771],{},[232,1762,1763],{},"An allow-list.",[215,1765,1766],{},"-send-to qa@example.com,dev@example.com",", or ",[215,1769,1770],{},"LTTR_STUDIO_SEND_TO"," with the same form. The flag wins over the variable. Write bare addresses, separated by commas. A display name is not needed, and a quoted one containing a comma doesn't parse.",[229,1773,1774,1150,1777,1780,1781,1784,1785,1788,1789,724,1792,1795,1796,1799],{},[232,1775,1776],{},"An SMTP server.",[215,1778,1779],{},"LTTR_SMTP_ADDR"," is its ",[215,1782,1783],{},"host:port",", for example ",[215,1786,1787],{},"localhost:1025"," for a local catcher such as Mailpit. ",[215,1790,1791],{},"LTTR_SMTP_USER",[215,1793,1794],{},"LTTR_SMTP_PASS"," turn on PLAIN auth. ",[215,1797,1798],{},"LTTR_SMTP_FROM"," replaces the From of every test; without it, each test is from its template's profile.",[275,1801,1803],{"className":277,"code":1802,"filename":279,"language":280,"meta":281,"style":281},"$ LTTR_SMTP_ADDR=localhost:1025 go run .\u002Fcmd\u002Flttr serve -kit .\u002Fkit -send-to qa@example.com,dev@example.com\nlttr studio: serving kit (2 samples) on http:\u002F\u002Flocalhost:7070\n",[215,1804,1805,1831],{"__ignoreMap":281},[285,1806,1807,1809,1812,1814,1816,1818,1820,1822,1825,1828],{"class":287,"line":288},[285,1808,292],{"class":291},[285,1810,1811],{"class":295}," LTTR_SMTP_ADDR=localhost:1025",[285,1813,296],{"class":295},[285,1815,299],{"class":295},[285,1817,302],{"class":295},[285,1819,305],{"class":295},[285,1821,309],{"class":308},[285,1823,1824],{"class":295}," .\u002Fkit",[285,1826,1827],{"class":308}," -send-to",[285,1829,1830],{"class":295}," qa@example.com,dev@example.com\n",[285,1832,1833,1835,1837,1839,1841,1843,1845],{"class":287,"line":315},[285,1834,250],{"class":291},[285,1836,320],{"class":295},[285,1838,323],{"class":295},[285,1840,326],{"class":295},[285,1842,330],{"class":329},[285,1844,333],{"class":295},[285,1846,336],{"class":329},[211,1848,1849,1850,1852],{},"A bad address or SMTP setting stops ",[215,1851,236],{}," before it listens: it prints the problem, then the usage, and exits 2. The problem reads like one of these:",[275,1854,1860],{"className":1855,"code":1857,"filename":1858,"language":1859,"meta":281},[1856],"language-text","lttr serve: -send-to: bad address \"nope\": mail: missing '@' or angle-addr\nlttr serve: LTTR_SMTP_ADDR: want host:port, such as localhost:1025\nlttr serve: LTTR_SMTP_PASS is set but LTTR_SMTP_USER is not\n","Output","text",[215,1861,1857],{"__ignoreMap":281},[211,1863,1864,1865,1868,1869,1872,1873,1876,1877,1880],{},"The Send tab picks the recipient from the allow-list; there is no free-text address. Above the button, the envelope shows the From, the subject with its ",[215,1866,1867],{},"[test]"," tag, the ",[215,1870,1871],{},"X-Lttr-Test: 1"," header and the server, as ",[215,1874,1875],{},"smtp:\u002F\u002Flocalhost:1025",". After a send, the tab says ",[215,1878,1879],{},"✓ Sent to qa@example.com at 10:46:51 AM"," and gives the Message-ID.",[226,1882,1883,1896,1910,1920,1926],{},[229,1884,1885,1888,1889,1892,1893,1895],{},[232,1886,1887],{},"Every test is marked."," The subject starts with ",[215,1890,1891],{},"[test] "," and the message carries the header ",[215,1894,1871],{},". The marking lets a mail filter, or the person who gets it, tell a test from a real message, and lets you route tests to their own folder.",[229,1897,1898,1901,1902,1905,1906,268],{},[232,1899,1900],{},"Only the allow-list."," The studio refuses any other recipient with ",[215,1903,1904],{},"not on the allow-list",", even from a request that passes ",[264,1907,1909],{"href":1908},"#keep-it-local","the write checks",[229,1911,1912,1915,1916,1919],{},[232,1913,1914],{},"At most 10 a minute."," Each studio process sends at most 10 tests in any 60 seconds, failed deliveries included. The 11th shows ",[215,1917,1918],{},"Rate limit reached: 10 per minute. You can send again in 59 s.",", and the button counts down.",[229,1921,1922,1925],{},[232,1923,1924],{},"Only a good render."," A sample that is stale, has errors or has no render is not sent, and neither is any sample while the kit has problems.",[229,1927,1928,1931,1932,268],{},[232,1929,1930],{},"Credentials stay out."," The user and password never appear in the page, the studio's answers or its log. When the server refuses the login, the studio shows only its reply code, such as ",[215,1933,1934],{},"authentication failed (535)",[211,1936,1937,1938,1941,1942],{},"When sending is off, Send test is disabled with the reason beside it, such as ",[215,1939,1940],{},"Sending is off: no allow-list",", and the Send tab says how to turn it on: ",[215,1943,1944],{},"Pass -send-to, or set LTTR_STUDIO_SEND_TO, then restart.",[211,1946,1947,1948,1953,1954,268],{},"The studio delivers through ",[264,1949,1950],{"href":129},[215,1951,1952],{},"lttr.SMTP",": STARTTLS when the server offers it, verified against the host of ",[215,1955,1779],{},[270,1957,1959],{"id":1958},"browse-the-components","Browse the components",[211,1961,242,1962,1964,1965,1968,1969,1972],{},[232,1963,865],{}," switch on the grid opens ",[215,1966,1967],{},"\u002Fcomponents",", a reference of every component in the kit. ",[215,1970,1971],{},"\u002Fcomponents\u002F\u003Cname>"," opens one by its name or an alias.",[226,1974,1975,1985,2005,2033],{},[229,1976,1977,1980,1981,1984],{},[232,1978,1979],{},"The list"," on the left shows each component with its class and how many samples use it, or ",[215,1982,1983],{},"○ unused",". Its filter matches names, aliases and attribute names.",[229,1986,1987,1990,1991,1994,1995,1998,1999,258,2002,268],{},[232,1988,1989],{},"The component"," shows its class, its aliases and a ",[215,1992,1993],{},"components\u002F\u003Cname>\u002F"," link, which opens its ",[215,1996,1997],{},"component.yaml"," in your editor when the kit is on disk. A badge says ",[215,2000,2001],{},"used in 2 samples",[215,2003,2004],{},"○ not used in any sample",[229,2006,2007,2010,2011,2014,2015,709,2018,2021,2022,2025,2026,2029,2030,268],{},[232,2008,2009],{},"Tables"," give its schema: ",[232,2012,2013],{},"Attributes"," (Name, Type, Default, Required, Values), ",[232,2016,2017],{},"Bindings · Go",[232,2019,2020],{},"Children"," (Component, Min, Max), ",[232,2023,2024],{},"Content"," (the rules in words, such as ",[215,2027,2028],{},"blocks: paragraph · list",") and ",[232,2031,2032],{},"Must follow",[229,2034,2035,2038,2039,2042],{},[232,2036,2037],{},"The example"," is the component rendered from the first sample that uses it, in a sandboxed frame, with its source and a link to that sample's workbench. It re-renders when the sample does. A component no sample uses shows ",[215,2040,2041],{},"No rendered example: add a sample that uses it to see one here."," A component that must follow another has no standalone example, and says why.",[211,2044,2045,2046,2049],{},"The usage counts count the samples that name the component, and for the kit's default component, such as Plain's ",[215,2047,2048],{},"section",", the samples with loose Markdown it wraps. A default component used only that way has no block of its own to cut an example from, so it has no example. The counts refresh when the kit changes.",[270,2051,2053],{"id":2052},"watch-the-size-budget","Watch the size budget",[211,2055,2056,2057,2060],{},"The status line shows the HTML size against Gmail's clip point, for example ",[215,2058,2059],{},"18 KB of 102 KB",", with a small meter. Gmail clips a message whose HTML is over 102 KB, which hides the end of the email behind a link.",[226,2062,2063,2070],{},[229,2064,2065,2066,2069],{},"Over 90 KB, the size turns amber (",[215,2067,2068],{},"⚠ 94 KB of 102 KB","), and the tile gets a size badge.",[229,2071,2072,2073,2076],{},"At 100 KB, lttr refuses to render (the same limit as ",[215,2074,2075],{},"lttr lint","). The sample shows the error and keeps its last good render as stale.",[270,2078,2080],{"id":2079},"run-it-for-your-own-go-types","Run it for your own Go types",[211,2082,2083,2084,2086,2087,2089,2090,2092,2093,2095],{},"An app that binds its own Go types in its templates cannot use ",[215,2085,236],{},", because the ",[215,2088,250],{}," binary does not have those types. It runs the studio as a small dev-only program instead, with the ",[215,2091,245],{}," package. ",[264,2094,170],{"href":171},"'s tutorial is the worked example:",[275,2097,2102],{"className":2098,"code":2099,"filename":2100,"language":2101,"meta":281,"style":281},"language-go shiki shiki-themes github-light-high-contrast github-light-high-contrast github-dark","\u002F\u002F Command emaildev runs the lttr studio on the tutorial's samples, reloading\n\u002F\u002F the kit and templates from disk. Run it from the repository root:\n\u002F\u002F\n\u002F\u002F  go run .\u002Fexamples\u002Ftutorial\u002Fcmd\u002Femaildev\npackage main\n\nimport (\n    \"os\"\n\n    \"github.com\u002Fsulv-io\u002Flttr\u002Fexamples\u002Ftutorial\"\n    \"github.com\u002Fsulv-io\u002Flttr\u002Fstudio\"\n)\n\nfunc main() {\n    os.Exit(studio.Options{\n        KitDir:      \"examples\u002Ftutorial\u002Fkit\",\n        LoadKit:     tutorial.LoadKit,\n        TemplateDir: \"examples\u002Ftutorial\u002Ftemplates\",\n        GoldenDir:   \"examples\u002Ftutorial\u002Ftestdata\",\n    }.Main(tutorial.Set(), os.Args[1:]))\n}\n","tutorial\u002Fcmd\u002Femaildev\u002Fmain.go","go",[215,2103,2104,2110,2115,2120,2125,2134,2138,2146,2157,2161,2170,2179,2184,2188,2200,2221,2232,2237,2247,2257,2279],{"__ignoreMap":281},[285,2105,2106],{"class":287,"line":288},[285,2107,2109],{"class":2108},"sBq4M","\u002F\u002F Command emaildev runs the lttr studio on the tutorial's samples, reloading\n",[285,2111,2112],{"class":287,"line":315},[285,2113,2114],{"class":2108},"\u002F\u002F the kit and templates from disk. Run it from the repository root:\n",[285,2116,2117],{"class":287,"line":419},[285,2118,2119],{"class":2108},"\u002F\u002F\n",[285,2121,2122],{"class":287,"line":426},[285,2123,2124],{"class":2108},"\u002F\u002F  go run .\u002Fexamples\u002Ftutorial\u002Fcmd\u002Femaildev\n",[285,2126,2127,2131],{"class":287,"line":457},[285,2128,2130],{"class":2129},"s1Q0q","package",[285,2132,2133],{"class":291}," main\n",[285,2135,2136],{"class":287,"line":463},[285,2137,423],{"emptyLinePlaceholder":422},[285,2139,2140,2143],{"class":287,"line":469},[285,2141,2142],{"class":2129},"import",[285,2144,2145],{"class":329}," (\n",[285,2147,2148,2151,2154],{"class":287,"line":475},[285,2149,2150],{"class":295},"    \"",[285,2152,2153],{"class":291},"os",[285,2155,2156],{"class":295},"\"\n",[285,2158,2159],{"class":287,"line":481},[285,2160,423],{"emptyLinePlaceholder":422},[285,2162,2163,2165,2168],{"class":287,"line":487},[285,2164,2150],{"class":295},[285,2166,2167],{"class":291},"github.com\u002Fsulv-io\u002Flttr\u002Fexamples\u002Ftutorial",[285,2169,2156],{"class":295},[285,2171,2172,2174,2177],{"class":287,"line":493},[285,2173,2150],{"class":295},[285,2175,2176],{"class":291},"github.com\u002Fsulv-io\u002Flttr\u002Fstudio",[285,2178,2156],{"class":295},[285,2180,2181],{"class":287,"line":498},[285,2182,2183],{"class":329},")\n",[285,2185,2186],{"class":287,"line":504},[285,2187,423],{"emptyLinePlaceholder":422},[285,2189,2190,2193,2197],{"class":287,"line":510},[285,2191,2192],{"class":2129},"func",[285,2194,2196],{"class":2195},"sPmw6"," main",[285,2198,2199],{"class":329},"() {\n",[285,2201,2202,2205,2208,2211,2213,2215,2218],{"class":287,"line":516},[285,2203,2204],{"class":329},"    os.",[285,2206,2207],{"class":2195},"Exit",[285,2209,2210],{"class":329},"(",[285,2212,245],{"class":291},[285,2214,268],{"class":329},[285,2216,2217],{"class":291},"Options",[285,2219,2220],{"class":329},"{\n",[285,2222,2223,2226,2229],{"class":287,"line":521},[285,2224,2225],{"class":329},"        KitDir:      ",[285,2227,2228],{"class":295},"\"examples\u002Ftutorial\u002Fkit\"",[285,2230,2231],{"class":329},",\n",[285,2233,2234],{"class":287,"line":527},[285,2235,2236],{"class":329},"        LoadKit:     tutorial.LoadKit,\n",[285,2238,2239,2242,2245],{"class":287,"line":533},[285,2240,2241],{"class":329},"        TemplateDir: ",[285,2243,2244],{"class":295},"\"examples\u002Ftutorial\u002Ftemplates\"",[285,2246,2231],{"class":329},[285,2248,2249,2252,2255],{"class":287,"line":539},[285,2250,2251],{"class":329},"        GoldenDir:   ",[285,2253,2254],{"class":295},"\"examples\u002Ftutorial\u002Ftestdata\"",[285,2256,2231],{"class":329},[285,2258,2259,2262,2265,2268,2271,2274,2276],{"class":287,"line":545},[285,2260,2261],{"class":329},"    }.",[285,2263,2264],{"class":2195},"Main",[285,2266,2267],{"class":329},"(tutorial.",[285,2269,2270],{"class":2195},"Set",[285,2272,2273],{"class":329},"(), os.Args[",[285,2275,1241],{"class":308},[285,2277,2278],{"class":329},":]))\n",[285,2280,2281],{"class":287,"line":551},[285,2282,2283],{"class":329},"}\n",[275,2285,2287],{"className":277,"code":2286,"filename":279,"language":280,"meta":281,"style":281},"$ go run .\u002Fexamples\u002Ftutorial\u002Fcmd\u002Femaildev\nlttr studio: serving tutorial (1 sample) on http:\u002F\u002Flocalhost:7070\n",[215,2288,2289,2300],{"__ignoreMap":281},[285,2290,2291,2293,2295,2297],{"class":287,"line":288},[285,2292,292],{"class":291},[285,2294,296],{"class":295},[285,2296,299],{"class":295},[285,2298,2299],{"class":295}," .\u002Fexamples\u002Ftutorial\u002Fcmd\u002Femaildev\n",[285,2301,2302,2304,2306,2308,2311,2314,2317],{"class":287,"line":315},[285,2303,250],{"class":291},[285,2305,320],{"class":295},[285,2307,323],{"class":295},[285,2309,2310],{"class":295}," tutorial",[285,2312,2313],{"class":329}," (1 ",[285,2315,2316],{"class":295},"sample",[285,2318,336],{"class":329},[211,2320,2321,2322,2325,2326,2328,2329,724,2332,2334,2335,268],{},"The program serves the app's ",[215,2323,2324],{},"lttr.SampleSet",": the kit, the ",[215,2327,1471],{},", and each template with typed sample data. The same set feeds ",[215,2330,2331],{},"lint.Check",[215,2333,1413],{},", so write it once. See ",[264,2336,2338],{"href":2337},"\u002Ftooling\u002Fgoldens-and-testing#describe-samples-once","Describe samples once",[1578,2340,2342],{"id":2341},"make-it-live","Make it live",[211,2344,2345,2346,2348,2349,2351],{},"An app usually embeds its kit and templates with ",[215,2347,1387],{},". The binary then holds a copy that the studio cannot watch. ",[215,2350,2217],{}," says where the files live on disk:",[748,2353,2354,2364],{},[751,2355,2356],{},[754,2357,2358,2361],{},[757,2359,2360],{},"Field",[757,2362,2363],{},"What it does",[764,2365,2366,2378,2407,2419,2432,2446,2466,2487],{},[754,2367,2368,2372],{},[769,2369,2370],{},[215,2371,1005],{},[769,2373,2374,2375,268],{},"The kit's directory. A change there loads the kit again with ",[215,2376,2377],{},"LoadKit",[754,2379,2380,2384],{},[769,2381,2382],{},[215,2383,2377],{},[769,2385,2386,2389,2390,2393,2394,724,2397,2400,2401,2403,2404,268],{},[215,2387,2388],{},"func(fs.FS) (*kit.Kit, error)",": loads the kit from ",[215,2391,2392],{},"os.DirFS(KitDir)"," with the app's ",[215,2395,2396],{},"kit.Types",[215,2398,2399],{},"kit.Funcs",". Required with ",[215,2402,1005],{},"; without it, serving fails with ",[215,2405,2406],{},"studio: KitDir needs LoadKit",[754,2408,2409,2413],{},[769,2410,2411],{},[215,2412,1008],{},[769,2414,2415,2416,268],{},"Each sample's source is read again from ",[215,2417,2418],{},"\u003CTemplateDir>\u002F\u003Csample.File()>",[754,2420,2421,2426],{},[769,2422,2423],{},[215,2424,2425],{},"GoldenDir",[769,2427,2428,2429,1434],{},"The golden directory for golden status; ",[215,2430,2431],{},"\"\"",[754,2433,2434,2439],{},[769,2435,2436],{},[215,2437,2438],{},"Addr",[769,2440,2441,2442,2445],{},"The listen address, ",[215,2443,2444],{},"localhost:7070"," by default.",[754,2447,2448,2453],{},[769,2449,2450],{},[215,2451,2452],{},"Editor",[769,2454,2455,2457,2458,709,2460,709,2462,258,2464,268],{},[215,2456,1329],{}," (default), ",[215,2459,1342],{},[215,2461,1354],{},[215,2463,1366],{},[215,2465,1378],{},[754,2467,2468,2473],{},[769,2469,2470],{},[215,2471,2472],{},"SendTo",[769,2474,2475,2476,2479,2480,2482,2483,2486],{},"The allow-list for ",[264,2477,2478],{"href":1049},"test sends","; empty reads ",[215,2481,1770],{},". SMTP comes from the ",[215,2484,2485],{},"LTTR_SMTP_*"," variables.",[754,2488,2489,2497],{},[769,2490,2491,709,2494],{},[215,2492,2493],{},"Stdout",[215,2495,2496],{},"Stderr",[769,2498,2499,2500,724,2503,268],{},"The serving line, and warnings and errors. Default ",[215,2501,2502],{},"os.Stdout",[215,2504,2505],{},"os.Stderr",[211,2507,2508],{},"Relative directories are relative to the working directory, which is also the root of the paths the studio shows. Run the program from the module root.",[211,2510,2511,2512,724,2514,2516,2517,2520,2521,2523,2524],{},"With ",[215,2513,1005],{},[215,2515,1008],{}," set, kit and template edits reload live. ",[232,2518,2519],{},"A change to Go code needs a restart",": the data types, the sample data, ",[215,2522,2377],{},", or anything else compiled into the program. The workbench's status line says so. Without them, the studio serves the embedded files and shows the not-live notice, with the hint ",[215,2525,2526],{},"Set KitDir and TemplateDir (studio.Options) to reload edits live.",[1578,2528,2530],{"id":2529},"main-optionsmain-and-serve","Main, Options.Main and Serve",[226,2532,2533,2547,2766,2823],{},[229,2534,2535,2540,2541,2544,2545,268],{},[232,2536,2537],{},[215,2538,2539],{},"studio.Main(set, args)"," is ",[215,2542,2543],{},"studio.Options{}.Main(set, args)",": the embedded files, not live, on ",[215,2546,2444],{},[229,2548,2549,2554,2555,709,2558,709,2561,724,2563,2566,2567,2570,2571,2574,2575],{},[232,2550,2551],{},[215,2552,2553],{},"Options.Main(set, args)"," parses ",[215,2556,2557],{},"-addr",[215,2559,2560],{},"-golden",[215,2562,1302],{},[215,2564,2565],{},"-send-to"," from ",[215,2568,2569],{},"args"," over the options, so the fields are the defaults and flags override them. It serves until SIGINT or SIGTERM and returns the exit code: 0, 1 on error, 2 on a usage error. ",[215,2572,2573],{},"-h"," prints the flags and what reloads:",[275,2576,2578],{"className":277,"code":2577,"filename":279,"language":280,"meta":281,"style":281},"$ go run .\u002Fexamples\u002Ftutorial\u002Fcmd\u002Femaildev -h\nusage: emaildev [-addr host:port] [-golden dir] [-editor name] [-send-to addr,…]\n       emaildev schema [-o file]\n       emaildev lsp [-studio host:port] [-golden dir] [-editor name] [-send-to addr,…]\n\nRuns the lttr studio, a live preview of this program's samples, until\ninterrupted. A change to Go data or Go types needs a restart.\n\nReloads on a change to:\n  the kit        examples\u002Ftutorial\u002Fkit\n  the templates  examples\u002Ftutorial\u002Ftemplates\n\nsubcommands:\n  schema    write .lttr\u002Fschema.json, the kit and data description editors read\n  lsp       the language server for editors, on stdin and stdout\n\nflags:\n  -addr address\n        listen address (default \"localhost:7070\")\n  -editor editor\n        editor that problem links open: vscode, cursor, zed, idea or none (default \"vscode\")\n  -golden dir\n        golden dir (\u003CName>.html and \u003CName>.txt) for golden status; empty for none (default \"examples\u002Ftutorial\u002Ftestdata\")\n  -send-to addresses\n        addresses test sends may go to, comma-separated (else LTTR_STUDIO_SEND_TO); SMTP from LTTR_SMTP_ADDR, _USER, _PASS and _FROM\n",[215,2579,2580,2593,2616,2630,2654,2658,2682,2687,2691,2696,2701,2706,2710,2715,2720,2725,2729,2733,2737,2741,2745,2749,2753,2758,2762],{"__ignoreMap":281},[285,2581,2582,2584,2586,2588,2591],{"class":287,"line":288},[285,2583,292],{"class":291},[285,2585,296],{"class":295},[285,2587,299],{"class":295},[285,2589,2590],{"class":295}," .\u002Fexamples\u002Ftutorial\u002Fcmd\u002Femaildev",[285,2592,371],{"class":308},[285,2594,2595,2597,2600,2602,2604,2606,2608,2610,2612,2614],{"class":287,"line":315},[285,2596,376],{"class":291},[285,2598,2599],{"class":295}," emaildev",[285,2601,396],{"class":329},[285,2603,399],{"class":295},[285,2605,402],{"class":329},[285,2607,393],{"class":295},[285,2609,407],{"class":329},[285,2611,410],{"class":295},[285,2613,413],{"class":329},[285,2615,416],{"class":295},[285,2617,2618,2621,2624,2627],{"class":287,"line":419},[285,2619,2620],{"class":291},"       emaildev",[285,2622,2623],{"class":295}," schema",[285,2625,2626],{"class":329}," [-o ",[285,2628,2629],{"class":295},"file]\n",[285,2631,2632,2634,2637,2640,2642,2644,2646,2648,2650,2652],{"class":287,"line":426},[285,2633,2620],{"class":291},[285,2635,2636],{"class":295}," lsp",[285,2638,2639],{"class":329}," [-studio ",[285,2641,399],{"class":295},[285,2643,402],{"class":329},[285,2645,393],{"class":295},[285,2647,407],{"class":329},[285,2649,410],{"class":295},[285,2651,413],{"class":329},[285,2653,416],{"class":295},[285,2655,2656],{"class":287,"line":457},[285,2657,423],{"emptyLinePlaceholder":422},[285,2659,2660,2662,2664,2666,2668,2670,2672,2674,2676,2679],{"class":287,"line":463},[285,2661,429],{"class":291},[285,2663,432],{"class":295},[285,2665,379],{"class":295},[285,2667,437],{"class":295},[285,2669,440],{"class":295},[285,2671,443],{"class":295},[285,2673,446],{"class":295},[285,2675,449],{"class":295},[285,2677,2678],{"class":295}," this",[285,2680,2681],{"class":295}," program's samples, until\n",[285,2683,2684],{"class":287,"line":469},[285,2685,2686],{"class":295},"interrupted. A change to Go data or Go types needs a restart.\n",[285,2688,2689],{"class":287,"line":475},[285,2690,423],{"emptyLinePlaceholder":422},[285,2692,2693],{"class":287,"line":481},[285,2694,2695],{"class":295},"Reloads on a change to:\n",[285,2697,2698],{"class":287,"line":487},[285,2699,2700],{"class":295},"  the kit        examples\u002Ftutorial\u002Fkit\n",[285,2702,2703],{"class":287,"line":493},[285,2704,2705],{"class":295},"  the templates  examples\u002Ftutorial\u002Ftemplates\n",[285,2707,2708],{"class":287,"line":498},[285,2709,423],{"emptyLinePlaceholder":422},[285,2711,2712],{"class":287,"line":504},[285,2713,2714],{"class":295},"subcommands:\n",[285,2716,2717],{"class":287,"line":510},[285,2718,2719],{"class":295},"  schema    write .lttr\u002Fschema.json, the kit and data description editors read\n",[285,2721,2722],{"class":287,"line":516},[285,2723,2724],{"class":295},"  lsp       the language server for editors, on stdin and stdout\n",[285,2726,2727],{"class":287,"line":521},[285,2728,423],{"emptyLinePlaceholder":422},[285,2730,2731],{"class":287,"line":527},[285,2732,559],{"class":295},[285,2734,2735],{"class":287,"line":533},[285,2736,565],{"class":295},[285,2738,2739],{"class":287,"line":539},[285,2740,571],{"class":295},[285,2742,2743],{"class":287,"line":545},[285,2744,589],{"class":295},[285,2746,2747],{"class":287,"line":551},[285,2748,595],{"class":295},[285,2750,2751],{"class":287,"line":556},[285,2752,601],{"class":295},[285,2754,2755],{"class":287,"line":562},[285,2756,2757],{"class":295},"        golden dir (\u003CName>.html and \u003CName>.txt) for golden status; empty for none (default \"examples\u002Ftutorial\u002Ftestdata\")\n",[285,2759,2760],{"class":287,"line":568},[285,2761,625],{"class":295},[285,2763,2764],{"class":287,"line":574},[285,2765,631],{"class":295},[229,2767,2768,2771,2772,724,2774,2777,2778,2816,2819,2820,2822],{},[232,2769,2770],{},"Two subcommands"," come with ",[215,2773,2264],{},[215,2775,2776],{},"Options.Main",", so the same program serves your editor too:",[226,2779,2780,2804],{},[229,2781,2782,2787,2788,2791,2792,2795,2796,2799,2800,2803],{},[232,2783,2784],{},[215,2785,2786],{},"schema [-o file]"," writes ",[215,2789,2790],{},".lttr\u002Fschema.json"," at the module root (the nearest directory up holding ",[215,2793,2794],{},"go.mod","), or to ",[215,2797,2798],{},"-o","'s file. It describes the kit and each template's data paths, so ",[215,2801,2802],{},"lttr lsp"," can offer completion, hover and definition for your templates. Commit it, and run it again after changing the kit or the Go data types.",[229,2805,2806,2811,2812,2815],{},[232,2807,2808],{},[215,2809,2810],{},"lsp [-studio host:port] [-golden dir] [-editor name] [-send-to addr,…]"," runs the language server on stdin and stdout, with the program's own kit loader, Go types and samples, so its problems are exact. ",[215,2813,2814],{},"-studio"," also serves the studio, following your unsaved buffers.",[2817,2818],"br",{},"See ",[264,2821,149],{"href":150}," for both.",[229,2824,2825,2830,2831,2834],{},[232,2826,2827],{},[215,2828,2829],{},"studio.Serve(ctx, set, opts)"," is the embeddable form. It serves until ",[215,2832,2833],{},"ctx"," is done, then shuts down and returns nil. It parses no flags and handles no signals:",[275,2836,2839],{"className":2098,"code":2837,"filename":2838,"language":2101,"meta":281,"style":281},"package main\n\nimport (\n    \"context\"\n    \"log\"\n    \"os\"\n    \"os\u002Fsignal\"\n\n    \"github.com\u002Fsulv-io\u002Flttr\u002Fexamples\u002Ftutorial\"\n    \"github.com\u002Fsulv-io\u002Flttr\u002Fstudio\"\n)\n\nfunc main() {\n    ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)\n    defer stop()\n    err := studio.Serve(ctx, tutorial.Set(), studio.Options{\n        Addr:        \"localhost:7071\",\n        KitDir:      \"examples\u002Ftutorial\u002Fkit\",\n        LoadKit:     tutorial.LoadKit,\n        TemplateDir: \"examples\u002Ftutorial\u002Ftemplates\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n}\n","cmd\u002Femailstudio\u002Fmain.go",[215,2840,2841,2847,2851,2857,2866,2875,2883,2892,2896,2904,2912,2916,2920,2928,2951,2962,2991,3001,3009,3013,3021,3026,3043,3054,3059],{"__ignoreMap":281},[285,2842,2843,2845],{"class":287,"line":288},[285,2844,2130],{"class":2129},[285,2846,2133],{"class":291},[285,2848,2849],{"class":287,"line":315},[285,2850,423],{"emptyLinePlaceholder":422},[285,2852,2853,2855],{"class":287,"line":419},[285,2854,2142],{"class":2129},[285,2856,2145],{"class":329},[285,2858,2859,2861,2864],{"class":287,"line":426},[285,2860,2150],{"class":295},[285,2862,2863],{"class":291},"context",[285,2865,2156],{"class":295},[285,2867,2868,2870,2873],{"class":287,"line":457},[285,2869,2150],{"class":295},[285,2871,2872],{"class":291},"log",[285,2874,2156],{"class":295},[285,2876,2877,2879,2881],{"class":287,"line":463},[285,2878,2150],{"class":295},[285,2880,2153],{"class":291},[285,2882,2156],{"class":295},[285,2884,2885,2887,2890],{"class":287,"line":469},[285,2886,2150],{"class":295},[285,2888,2889],{"class":291},"os\u002Fsignal",[285,2891,2156],{"class":295},[285,2893,2894],{"class":287,"line":475},[285,2895,423],{"emptyLinePlaceholder":422},[285,2897,2898,2900,2902],{"class":287,"line":481},[285,2899,2150],{"class":295},[285,2901,2167],{"class":291},[285,2903,2156],{"class":295},[285,2905,2906,2908,2910],{"class":287,"line":487},[285,2907,2150],{"class":295},[285,2909,2176],{"class":291},[285,2911,2156],{"class":295},[285,2913,2914],{"class":287,"line":493},[285,2915,2183],{"class":329},[285,2917,2918],{"class":287,"line":498},[285,2919,423],{"emptyLinePlaceholder":422},[285,2921,2922,2924,2926],{"class":287,"line":504},[285,2923,2192],{"class":2129},[285,2925,2196],{"class":2195},[285,2927,2199],{"class":329},[285,2929,2930,2933,2936,2939,2942,2945,2948],{"class":287,"line":510},[285,2931,2932],{"class":329},"    ctx, stop ",[285,2934,2935],{"class":2129},":=",[285,2937,2938],{"class":329}," signal.",[285,2940,2941],{"class":2195},"NotifyContext",[285,2943,2944],{"class":329},"(context.",[285,2946,2947],{"class":2195},"Background",[285,2949,2950],{"class":329},"(), os.Interrupt)\n",[285,2952,2953,2956,2959],{"class":287,"line":516},[285,2954,2955],{"class":2129},"    defer",[285,2957,2958],{"class":2195}," stop",[285,2960,2961],{"class":329},"()\n",[285,2963,2964,2967,2969,2972,2975,2978,2980,2983,2985,2987,2989],{"class":287,"line":521},[285,2965,2966],{"class":329},"    err ",[285,2968,2935],{"class":2129},[285,2970,2971],{"class":329}," studio.",[285,2973,2974],{"class":2195},"Serve",[285,2976,2977],{"class":329},"(ctx, tutorial.",[285,2979,2270],{"class":2195},[285,2981,2982],{"class":329},"(), ",[285,2984,245],{"class":291},[285,2986,268],{"class":329},[285,2988,2217],{"class":291},[285,2990,2220],{"class":329},[285,2992,2993,2996,2999],{"class":287,"line":527},[285,2994,2995],{"class":329},"        Addr:        ",[285,2997,2998],{"class":295},"\"localhost:7071\"",[285,3000,2231],{"class":329},[285,3002,3003,3005,3007],{"class":287,"line":533},[285,3004,2225],{"class":329},[285,3006,2228],{"class":295},[285,3008,2231],{"class":329},[285,3010,3011],{"class":287,"line":539},[285,3012,2236],{"class":329},[285,3014,3015,3017,3019],{"class":287,"line":545},[285,3016,2241],{"class":329},[285,3018,2244],{"class":295},[285,3020,2231],{"class":329},[285,3022,3023],{"class":287,"line":551},[285,3024,3025],{"class":329},"    })\n",[285,3027,3028,3031,3034,3037,3040],{"class":287,"line":556},[285,3029,3030],{"class":2129},"    if",[285,3032,3033],{"class":329}," err ",[285,3035,3036],{"class":2129},"!=",[285,3038,3039],{"class":308}," nil",[285,3041,3042],{"class":329}," {\n",[285,3044,3045,3048,3051],{"class":287,"line":562},[285,3046,3047],{"class":329},"        log.",[285,3049,3050],{"class":2195},"Fatal",[285,3052,3053],{"class":329},"(err)\n",[285,3055,3056],{"class":287,"line":568},[285,3057,3058],{"class":329},"    }\n",[285,3060,3061],{"class":287,"line":574},[285,3062,2283],{"class":329},[211,3064,3065,3066,3069],{},"Keep the program out of production builds: put it in its own ",[215,3067,3068],{},"cmd\u002F"," directory that nothing else imports.",[270,3071,267],{"id":3072},"follow-your-editors-unsaved-text",[211,3074,3075,3076,3079,3080,3083,3084,3086,3087,3091],{},"The language server can serve the studio too: ",[215,3077,3078],{},"lttr lsp -studio localhost:7070",", or your own program's ",[215,3081,3082],{},"emaildev lsp -studio localhost:7070",". Its preview then follows the text in your editor as you type, before you save, on the same engine that checks it. See ",[264,3085,149],{"href":150}," for the editors, and ",[264,3088,3090],{"href":3089},"\u002Ftooling\u002Feditor-setup#preview-as-you-type","Preview as you type"," for which kit it serves.",[226,3093,3094,3106,3116,3122,3131],{},[229,3095,3096,3099,3100,3102,3103,268],{},[232,3097,3098],{},"The pill says so."," While the page shows a render of unsaved text, the pill reads ",[215,3101,913],{},", and a render that differs from its golden says ",[215,3104,3105],{},"Δ differs from golden · unsaved",[229,3107,3108,3111,3112,3115],{},[232,3109,3110],{},"Save or close."," Save the file, and the pill returns to ",[215,3113,3114],{},"Live · watching …",". Close it without saving, and the preview returns to the text on disk.",[229,3117,3118,3121],{},[232,3119,3120],{},"New files wait for a save."," A file that exists only in your editor can be read by the kit, but it isn't listed as a new sample until you save it.",[229,3123,3124,3127,3128,3130],{},[232,3125,3126],{},"Writes use the files on disk."," Accept refuses a render built from unsaved text, and Save to samples.yaml refuses while ",[215,3129,1545],{}," has unsaved changes in your editor. A golden never holds text you haven't saved.",[229,3132,3133,3136,3137,3139],{},[232,3134,3135],{},"No \"Rendering…\" cue."," The buffer rebuilds 150 ms after you stop typing, and a build takes about 40 ms, so a cue would flicker on every keystroke. The pill and the ",[215,3138,876],{}," cue already say that the preview follows your typing.",[270,3141,3143],{"id":3142},"keep-it-local","Keep it local",[211,3145,3146],{},"The studio serves your templates and sample data, so by default only your own machine can reach it.",[226,3148,3149,3157,3177,3192,3206,3313],{},[229,3150,3151,3154,3155,268],{},[232,3152,3153],{},"It listens on localhost."," The default address is ",[215,3156,2444],{},[229,3158,3159,3162,3163,709,3166,258,3169,3172,3173,3176],{},[232,3160,3161],{},"It checks the Host header."," Every request, reads included, must name ",[215,3164,3165],{},"localhost",[215,3167,3168],{},"127.0.0.1",[215,3170,3171],{},"[::1]"," with the studio's port. Any other Host gets ",[215,3174,3175],{},"421 Misdirected Request",". A web page that rebinds its own domain to your machine cannot read the studio through the browser.",[229,3178,3179,3182,3183,709,3186,724,3189,268],{},[232,3180,3181],{},"It serves no remote resources."," The studio's pages load no fonts or scripts from elsewhere. Their Content-Security-Policy allows only the studio's own files, and every response carries ",[215,3184,3185],{},"Cross-Origin-Resource-Policy: same-origin",[215,3187,3188],{},"X-Content-Type-Options: nosniff",[215,3190,3191],{},"Cache-Control: no-store",[229,3193,3194,3197,3198,3201,3202,3205],{},[232,3195,3196],{},"Previews are sandboxed."," Each email renders in an ",[215,3199,3200],{},"\u003Ciframe sandbox=\"allow-same-origin\">"," with scripts off, and the rendered HTML is served with ",[215,3203,3204],{},"Content-Security-Policy: script-src 'none'",". Nothing in an email runs. Same-origin access lets the studio measure the frame and switch its colour scheme.",[229,3207,3208,3211,3212,709,3215,258,3218,3221,3222,3225,3226,3229,3230,3233,3234,3237,3238,3306,3308,3309,3312],{},[232,3209,3210],{},"Writes come only from the studio's own page."," Apply, Reset, Save, Accept and Send are ",[215,3213,3214],{},"POST",[215,3216,3217],{},"PUT",[215,3219,3220],{},"DELETE"," requests, and each must carry two things a page on another site can't supply: the ",[215,3223,3224],{},"X-Lttr-Token"," header, holding a random token the studio makes at each start (32 bytes from ",[215,3227,3228],{},"crypto\u002Frand",") and puts in its own pages, and an ",[215,3231,3232],{},"Origin"," header equal to the studio's own address. The body must be JSON (",[215,3235,3236],{},"Content-Type: application\u002Fjson",") of at most 1 MiB. The studio checks, in order, and answers:",[748,3239,3240,3250],{},[751,3241,3242],{},[754,3243,3244,3247],{},[757,3245,3246],{},"Check",[757,3248,3249],{},"Answer",[764,3251,3252,3269,3286,3296],{},[754,3253,3254,3264],{},[769,3255,3256,3257,3260,3261],{},"The request's ",[215,3258,3259],{},"Content-Type"," isn't ",[215,3262,3263],{},"application\u002Fjson",[769,3265,3266],{},[215,3267,3268],{},"415",[754,3270,3271,3277],{},[769,3272,3273,3274],{},"The token or the Origin is missing or wrong, or Origin is ",[215,3275,3276],{},"null",[769,3278,3279,3282,3283],{},[215,3280,3281],{},"403"," with ",[215,3284,3285],{},"{\"error\":\"forbidden\"}",[754,3287,3288,3291],{},[769,3289,3290],{},"The body is over 1 MiB",[769,3292,3293],{},[215,3294,3295],{},"413",[754,3297,3298,3301],{},[769,3299,3300],{},"The body takes over 10 seconds to arrive",[769,3302,3303],{},[215,3304,3305],{},"408",[2817,3307],{},"Nothing is written or sent before these pass. A form on another site can't send JSON, and a ",[215,3310,3311],{},"fetch"," from another site that sends JSON or the token must ask the studio first, which it never allows. The Host check keeps other sites from reading the token.",[229,3314,3315,3318,3319,3321,3322,724,3324,3326],{},[232,3316,3317],{},"It writes two kinds of file."," Save writes the sample set's ",[215,3320,1545],{}," and Accept writes ",[215,3323,1400],{},[215,3325,1403],{}," in the golden directory. The paths come from the sample and its template name, never from the request. A file that is a symbolic link is refused, and every write goes to a temporary file in the same directory first, then replaces the file in one step.",[211,3328,3329],{},"To open the studio from another device on your network, such as a phone, listen on your machine's LAN address. The Host check then allows that address too:",[275,3331,3333],{"className":277,"code":3332,"filename":279,"language":280,"meta":281,"style":281},"go run .\u002Fcmd\u002Flttr serve -addr 192.168.1.20:7070\n",[215,3334,3335],{"__ignoreMap":281},[285,3336,3337,3339,3341,3343,3345,3348],{"class":287,"line":288},[285,3338,2101],{"class":291},[285,3340,299],{"class":295},[285,3342,302],{"class":295},[285,3344,305],{"class":295},[285,3346,3347],{"class":308}," -addr",[285,3349,3350],{"class":295}," 192.168.1.20:7070\n",[211,3352,3353,3354,3357],{},"Anyone who can reach that address can read your templates and data, save sample data, accept goldens and send test emails to the allow-list, and the studio warns you. ",[215,3355,3356],{},"0.0.0.0"," listens everywhere but still accepts only localhost Host headers:",[275,3359,3361],{"className":277,"code":3360,"filename":279,"language":280,"meta":281,"style":281},"$ go run .\u002Fcmd\u002Flttr serve -addr 0.0.0.0:7070\nlttr serve: listening on a non-loopback address; anyone who can reach it can read your templates and data, save sample data, accept goldens and send test emails to the allow-list\nlttr serve: -addr 0.0.0.0:7070 and [::]:7070 still accept only localhost Host headers; for LAN access use -addr \u003Clan-ip>:7070\nlttr studio: serving quiet (9 samples) on http:\u002F\u002Flocalhost:7070\n",[215,3362,3363,3380,3469,3503],{"__ignoreMap":281},[285,3364,3365,3367,3369,3371,3373,3375,3377],{"class":287,"line":288},[285,3366,292],{"class":291},[285,3368,296],{"class":295},[285,3370,299],{"class":295},[285,3372,302],{"class":295},[285,3374,305],{"class":295},[285,3376,3347],{"class":308},[285,3378,3379],{"class":295}," 0.0.0.0:7070\n",[285,3381,3382,3384,3387,3390,3393,3395,3398,3401,3404,3407,3410,3413,3416,3419,3421,3424,3427,3430,3433,3436,3439,3442,3444,3447,3450,3452,3455,3458,3461,3464,3466],{"class":287,"line":315},[285,3383,250],{"class":291},[285,3385,3386],{"class":295}," serve:",[285,3388,3389],{"class":295}," listening",[285,3391,3392],{"class":295}," on",[285,3394,440],{"class":295},[285,3396,3397],{"class":295}," non-loopback",[285,3399,3400],{"class":295}," address",[285,3402,3403],{"class":329},"; ",[285,3405,3406],{"class":291},"anyone",[285,3408,3409],{"class":295}," who",[285,3411,3412],{"class":295}," can",[285,3414,3415],{"class":295}," reach",[285,3417,3418],{"class":295}," it",[285,3420,3412],{"class":295},[285,3422,3423],{"class":295}," read",[285,3425,3426],{"class":295}," your",[285,3428,3429],{"class":295}," templates",[285,3431,3432],{"class":295}," and",[285,3434,3435],{"class":295}," data,",[285,3437,3438],{"class":295}," save",[285,3440,3441],{"class":295}," sample",[285,3443,3435],{"class":295},[285,3445,3446],{"class":295}," accept",[285,3448,3449],{"class":295}," goldens",[285,3451,3432],{"class":295},[285,3453,3454],{"class":295}," send",[285,3456,3457],{"class":295}," test",[285,3459,3460],{"class":295}," emails",[285,3462,3463],{"class":295}," to",[285,3465,432],{"class":295},[285,3467,3468],{"class":295}," allow-list\n",[285,3470,3471,3473,3475,3477,3480,3482,3485,3488,3491,3494,3497,3500],{"class":287,"line":419},[285,3472,250],{"class":291},[285,3474,3386],{"class":295},[285,3476,3347],{"class":308},[285,3478,3479],{"class":295}," 0.0.0.0:7070",[285,3481,3432],{"class":295},[285,3483,3484],{"class":329}," [::]:7070 still accept only localhost Host headers; ",[285,3486,3487],{"class":2129},"for",[285,3489,3490],{"class":329}," LAN access use -addr ",[285,3492,3493],{"class":2129},"\u003C",[285,3495,3496],{"class":329},"lan-ip",[285,3498,3499],{"class":2129},">",[285,3501,3502],{"class":329},":7070\n",[285,3504,3505,3507,3509,3511,3514,3517,3519],{"class":287,"line":426},[285,3506,250],{"class":291},[285,3508,320],{"class":295},[285,3510,323],{"class":295},[285,3512,3513],{"class":295}," quiet",[285,3515,3516],{"class":329}," (9 ",[285,3518,333],{"class":295},[285,3520,336],{"class":329},[270,3522,3524],{"id":3523},"share-a-one-shot-preview","Share a one-shot preview",[211,3526,3527,3530,3531,3534,3535,638],{},[215,3528,3529],{},"lttr preview"," writes every sample to a directory, with an ",[215,3532,3533],{},"index.html"," to open in a browser. There is no server and no reload, so it is the form to hand someone for a review, or to feed to ",[264,3536,3537],{"href":155},[215,3538,3539],{},"make shoot",[275,3541,3543],{"className":277,"code":3542,"filename":279,"language":280,"meta":281,"style":281},"make preview\n# KIT=plain make preview\n",[215,3544,3545,3553],{"__ignoreMap":281},[285,3546,3547,3550],{"class":287,"line":288},[285,3548,3549],{"class":291},"make",[285,3551,3552],{"class":295}," preview\n",[285,3554,3555],{"class":287,"line":315},[285,3556,3557],{"class":2108},"# KIT=plain make preview\n",[211,3559,2819,3560,3563],{},[264,3561,139],{"href":3562},"\u002Ftooling\u002Fcli#preview-every-sample"," for everything it writes. Its index lists the samples and shows the selected one:",[748,3565,3566,3578],{},[751,3567,3568],{},[754,3569,3570,3573,3576],{},[757,3571,3572],{},"Control",[757,3574,3575],{},"Keyboard",[757,3577,1188],{},[764,3579,3580,3595,3608,3621],{},[754,3581,3582,3585,3589],{},[769,3583,3584],{},"Email colour scheme: Light, Dark",[769,3586,3587],{},[215,3588,1259],{},[769,3590,3591,3592,3594],{},"Switches the email's ",[215,3593,1087],{}," rules inside each frame",[754,3596,3597,3600,3605],{},[769,3598,3599],{},"Preview width: Both, 600, 375",[769,3601,3602],{},[215,3603,3604],{},"w",[769,3606,3607],{},"Shows one or both frames",[754,3609,3610,3613,3618],{},[769,3611,3612],{},"Part: HTML, Plain text",[769,3614,3615],{},[215,3616,3617],{},"t",[769,3619,3620],{},"The HTML frames or the text part",[754,3622,3623,3626,3628],{},[769,3624,3625],{},"Page theme",[769,3627],{},[769,3629,3630],{},"The page's own light or dark chrome",[211,3632,3633,3635,3636,3638,3639,3642,3643,3646],{},[215,3634,1197],{},"\u002F",[215,3637,1201],{}," (or the arrow keys) move between samples, and every choice is remembered. The frames embed each email with ",[215,3640,3641],{},"srcdoc",", so the page works when opened as a ",[215,3644,3645],{},"file:\u002F\u002F"," document.",[270,3648,3650],{"id":3649},"next-steps","Next steps",[226,3652,3653,3658,3663,3670],{},[229,3654,3655,3657],{},[264,3656,139],{"href":140}," for every command's flags.",[229,3659,3660,3662],{},[264,3661,149],{"href":150}," for the language server, and the studio that follows your editor.",[229,3664,3665,1421,3667,3669],{},[264,3666,159],{"href":160},[215,3668,1413],{}," and the sample set the studio shows.",[229,3671,3672,3674,3675,268],{},[264,3673,170],{"href":171},", which ends with a kit that binds a Go type, previewed with ",[215,3676,3677],{},"emaildev",[3679,3680,3681],"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 .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}",{"title":281,"searchDepth":315,"depth":315,"links":3683},[3684,3685,3686,3687,3688,3689,3690,3691,3694,3695,3696,3697,3698,3702,3703,3704,3705],{"id":272,"depth":315,"text":273},{"id":738,"depth":315,"text":739},{"id":963,"depth":315,"text":964},{"id":1030,"depth":315,"text":1031},{"id":1165,"depth":315,"text":1166},{"id":1295,"depth":315,"text":1296},{"id":1393,"depth":315,"text":1394},{"id":1490,"depth":315,"text":1491,"children":3692},[3693],{"id":1580,"depth":419,"text":1581},{"id":1627,"depth":315,"text":1628},{"id":1746,"depth":315,"text":1747},{"id":1958,"depth":315,"text":1959},{"id":2052,"depth":315,"text":2053},{"id":2079,"depth":315,"text":2080,"children":3699},[3700,3701],{"id":2341,"depth":419,"text":2342},{"id":2529,"depth":419,"text":2530},{"id":3072,"depth":315,"text":267},{"id":3142,"depth":315,"text":3143},{"id":3523,"depth":315,"text":3524},{"id":3649,"depth":315,"text":3650},"lttr serve and the studio library. A live grid of every sample, a workbench with its problems, data, golden diff and test sends, the components page, the size budget, keyboard shortcuts, editor links, unsaved editor buffers and the security model.","md",null,{},{"icon":147},{"title":144,"description":3706},"VeZ5gCXMWX82GwvVEecwQj4evFmLY94_izAzpo1lrlE",[3714,3716],{"title":139,"path":140,"stem":141,"description":3715,"icon":142,"children":-1},"Every lttr subcommand, its flags straight from -h, and its exit codes.",{"title":149,"path":150,"stem":151,"description":3717,"icon":152,"children":-1},"The lttr language server in VS Code, Neovim and Zed. Problems as you type, quick fixes, completion, hover and go to definition, which server to run for a kit or a typed app, .lttr\u002Fschema.json, and a studio that follows your unsaved buffers.",1790467458233]