8.2 KiB
8.2 KiB
Changelog
Format: Keep a Changelog. A release's
Breaking section comes first and names each rejected spelling with its
replacement, and each removed path, column or flag.
[Unreleased]
Added
- Step up:
..after a row steps up to the row its link column names, so{/city[Oslo]..country.name}rendersNorway, and.after it steps down again, drawing afresh.Newrefuses a..naming anything but the parent table, and a selector after a... - A path, given to
Fakeor referenced in a template, may not read into a level carrying arepeat, andListadvertises no such path: wherexcarries"repeat": 3,Fake("x.a")fails naming the levelx, andFake("x")renders it whole. - Every
{…}draws afresh, and a name is the one way to keep a pick:{p.a} {p.b},{w} {uppercase(w)}and{/person.first} {/person.last}are two draws each, which{p as q}{q.a} {q.b}and{/person as n}{n.first} {n.last}make one.{/misc.territory as t}binds one row ofmisc.territorytotand prints nothing;{t},{t.capital}and{lowercase(t.name)}read that one row.{x as n}binds a reference, a sibling field or a path into one; a name lives in the category binding it, and picks again on every iteration of arepeatbinding it. A struct's tags share its names,{/sv_SE.person as p}{p.first}beside{p.sex}. A name is a{calc()}operand:{/misc.coordinate.lat as lat}{calc(lat * 60)}. WhatNewrefuses is listed under Names. - First release: the CLI, the library and the shipped data set.
- The CLI renders exactly the template on its stdin,
echo '{/sv_SE.person} hihi' | fejkdata, and adds nothing under--format text:echo's newline ends the render, and--separatordefaults to empty. Whitespace around a JSON template is dropped. A lone reference,{/users}, is the recordusersunder--format. An argument other than a flag, an empty or blank stdin, or nothing piped in, exits 2. - Table categories: a category JSON naming a
rowsTSV beside it, with the optionskey,name,weightandparent; a path selects a row by key or name,misc.territory[SE], and descends to a linked table by name, one path drawing each row inside the row above it.rowsis an option, so no template may carry a field of that name. Anamewithout akeyresolves inside the table'sparent. Refused atNew: anamewithout akeyor aparent, a name repeating inside one parent row, a name spelling another row's key, and a table named like a column of any table above it. Newrefuses a root choice of templates sharing one format and one set of string fields, naming the rows TSV to write instead.misc.territory,misc.currency,misc.language,misc.httpstatusandmisc.mimetypeare tables.misc.territoryis every ISO 3166-1 territory that has a capital, a currency and a TLD, with the columnscalling-code,capital,country,currency,flag,languages,numericandtldadded,countryholding the alpha-2 code of the sovereign state it belongs to and its own where it is one;misc.currencythe current ISO 4217 currencies with a minor unit, withdecimalsandnumericadded, and its symbols from CLDR;misc.languageevery ISO 639-2 entry carrying a 639-1 code, with acode3column holding its 639-2/T code;misc.httpstatuseach code the IANA registry lists with a plain reason phrase; andmisc.mimetypeeach type mime-db records as IANA-registered and gives a filename extension.DATA-LICENSES.mdlists each source.misc.timezone,misc.carandmisc.useragentare tables too.misc.timezoneis every zone tzdbzone.tabgives a shipped territory, withoffsetholding the zone's standard UTC offset andterritorylinking tomisc.territory, somisc.territory[SE].timezonedrawsEurope/Stockholm; zones of a territorymisc.territorydoes not ship, Antarctica's among them, and the constantUTCare gone; spell that one as the text"UTC". Aweightcolumn carries the population GeoNames records in each zone, so a draw favours the zones people live in.misc.useragentis the top-user-agents desktop and mobile lists withbrowser,deviceandoscolumns.misc.carkeeps its makes and models in amakeand amodelcolumn.misc.httpmethod,misc.protocolandmisc.portare IANA's registries as tables.misc.httpmethodis the eight methods RFC 9110 defines and PATCH, carryingsafeandidempotentastrueorfalse;misc.protocolthe keyword, itsnumberand itsname, selectable by either;misc.portrenders a TCP port number, with the IANAservicename beside it, keeping the first service the registry describes for a port so a number selects one row.misc.tldis the IANA root zone as a table: every delegated TLD keyed with its leading dot,.seand.xn--p1ai, the register'stypebeside it, and aunicodecolumn holding the form the register displays, somisc.tld[.рф]selects the row.xn--p1airenders. A delegation the register marks "Not assigned" does not ship.misc.loglevelis the eight syslog severities: thekeyworda configuration writes,errandinfo, keyed by the numericalcodea PRI encodes and selectable by either, with theseverityRFC 5424 spells beside it.geo.SEandgeo.US: five linked tables per country,region,municipality,locality,postal-codeandstreet, weighted by population and address counts and built from SCB, GeoNames, Trafikverket NVDB and the US Census Bureau, and anaddressrecord binding one locality and drawing its street and postal code inside it.sv_SE.addressanden_US.addressbind those records once, soen_US.address.streetno longer carriesnameandsuffix, and a locale folder loads only besidegeo.{date(from,to,'layout')}and{time('layout')}: a second between two days, or within one, in a single-quoted Go layout, drawn in UTC;frommay equalto.sv_SE.date,en_US.date,sv_SE.timeanden_US.timerender through them, sodate.year,date.month,date.day,time.hour,time.minute,time.minute.t,time.secandtime.ampmare no longer paths — a part of a date is now its own{date(…,'2006')}.misc.datetimeis an RFC 3339 instant.sex,first-nameandlast-nametables insv_SEanden_US, weighted by bearers from SCB, the SSA and the Census Bureau;first-namelinks tosex, and a name both sexes carry is a row under each.personbinds one first name and reads its sex through it, and its columns arefirst,last,prefixandsex;person.femalefirstandperson.malefirstare no longer paths — drawsex[f].first-nameandsex[m].first-nameinstead.en_US.titlelinks tosexas well, soen_US.person.prefixdrawsMrorMswithout contradicting the record'ssex;sv_SE.titleis an unsexed table of the same shape.sv_SE.personnummerandsv_SE.samordningsnummer, Skatteverket's test series from asv_SE.birth-numbertable undersex, in place ofsv_SE.ssn, whosessn.mmdd,ssn.mmdd.mandssn.mmdd.dgo with it.en_US.ssnnow draws the ranges the SSA assigns and carries the columnsarea,groupandserial, so--format csv en_US.ssnwrites a header where it used to fail;en_US.itinis new and carries the same three.person.prefixis null where a person has no title, where it used to be an empty string, so--format sqlwritesNULLand astringstruct field reading it becomes*string.en_US.phone-exchangedraws the three digits after a US area code evenly from the codes NANPA may assign:200to999, except211,311…911,555,950,958,959and976.en_US.phonedraws itsexchangefrom it.ErrNoColumnsis exported, so a caller can tell the one record fence a path can answer from the rest.- An error names a spelling that runs: a layout is named single-quoted and free of
its own quotes, a row of a table with no key is named as the path that selects it,
sv_SE.sex[f].first-name[Kim], and a category with no columns names the record that gives it one.