Repository navigation
v0.2.0
·
13 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
This release makes 12 mm the default tape, and fixes the defects that eight rounds of review found in v0.1.1. Files the app wrote read and write back as before, and keep keys this package does not know.
Caution
Breaking Changes
- The default tape is 12 mm, not 18 mm. It is the more common width. Pass
--tape 18, ortape_width_mm: 18over MCP, to keep 18 mm. The Go API takes aTapealways, so it does not change. (#60) - The CLI writes only a
.tm2file, in any case, with a name before it, as MCP does.-o out.txtand-o .tm2are refused. (#58) tepra helpis gone. Use-hor--help, which work on every command. (#41, #49)- More inputs are refused when a label is made, where they used to make a broken file or fail only when it was written. See Checks.
Checks
Each of these is refused by NewText, NewPages and NewPour, and by the CLI and MCP through them.
| Input | Error | PR |
|---|---|---|
| NaN or ±Inf for a font size, border width, padding, margin or length | ErrInvalidOptions |
#12 |
| Text, a value, a column title or a name that is not UTF-8 | ErrBadText (new) |
#12, #24 |
| Text, or a pour value, of blanks only | ErrNoText |
#12, #24 |
| A font size larger than fits the tape | ErrNoRoom, with the size that fits |
#57 |
| Padding that leaves no room, with a font size given too | ErrNoRoom |
#47 |
| A fixed length that shrinks the text to size 0 | ErrNoRoom |
#12 |
| A label of automatic length over 3000 mm | ErrOverLimit |
#12 |
| A picture over 8192 by 8192 pixels, by its header | ErrBadImage |
#24 |
A nil drawer, or one with no BaseDrawer |
ErrBadFile (new) |
#16, #24 |
Layout
- Inverted lines turned 180 read in order with the tape turned over: the first line is in the bottom box. (#56)
- In inverted pour, a value of fewer lines follows
--valign, in the first, middle or last boxes. (#56) - A length of 3000 mm is taken with any margin. Rounding refused it with some. (#32)
- A background is stretched to the printer's dots at most. A large one took 4.6 GB before. (#15)
- "No room" names its cause: the padding, too many lines, a line too long to run across the tape, or a font size too large. (#32, #42, #51, #57)
Files
- Keys this package does not know are kept through a read and a write. They are in a new
Unknownfield of the file, a document or a drawer. (#14) - A drawer of an unknown type is kept as
RawDrawer, whatever its keys hold. So is one that is not an object, or has no type. (#36, #43, #48, #51) ParseFilerefuses a file with no documents, or a document with no tape width, asErrBadFile. (#25, #36)- Errors of the JSON are
ErrBadFile. Errors of the file system and of a reader come back as they are, even inside a value. (#13, #25, #33)
CLI and MCP
- A label is encoded before its file is opened, so a file that cannot be encoded writes nothing and leaves an old one as it was. A replaced file is written in place: through a symlink, keeping its mode. (#10, #22)
- The CSV reader says when a file is not UTF-8, takes CR line ends and blanks around a quoted value, and keeps blanks inside one. (#12, #26, #29, #34, #41)
- Errors are short and printed once: one line each, grouped by message, at most 10 listed, and a usage error without the help. (#16, #23, #33, #35, #49)
- Smaller fixes: (#11, #26, #35)
- Help no longer says
(default: 0). -o X.TM2names the labelX.inspectreads a file with rows but no column titles.- Drawers count from 1 in errors.
- Help no longer says
Upgrading
| You use | Do this |
|---|---|
18 mm tape with the CLI or MCP, without --tape |
Add --tape 18, or tape_width_mm: 18 |
-o with another extension |
Name the file .tm2 |
tepra help |
Use tepra -h, or tepra <command> -h |
| The Go API | Nothing, unless you check for the errors above |
Changelog
- 18e28a2 Test the paths no test reached: pictures, icons, errors, CLI (#2)
- 7c44726 Write a label only once it is encoded, and replace it by rename (#10)
- 05376ef Describe a file with rows but no column titles (#11)
- d2e64b7 Check numbers and text when a label is made, not when it is written (#12)
- cb3a822 Wrap errors of reading and encoding files in ErrBadFile (#13)
- 06ff096 Keep keys the package does not know through a read and a write (#14)
- 50a9509 Stretch a background to the printer's dots at most (#15)
- a181658 Fix small defects: CLI message, page errors, icon buffer, nil drawers (#16)
- cd0c1da Replace a label in place, as other tools write (#22)
- 84ed202 Keep error messages short however long the list is (#23)
- 588df27 Check names, blank text, picture sizes and drawer bases (#24)
- 2402ff2 Reject a file with no documents, and pass reader errors through (#25)
- f1a48d3 Fix CLI help defaults, CSV spaces, MCP path message, drawer numbers (#26)
- a9aa904 Take 3000 mm with any margin, and say why there is no room (#32)
- 08baddc Keep reader errors, hidden sentinels and long values right in errors (#33)
- 06ec96b Keep blanks at line ends inside quoted CSV values (#34)
- b91b0fa Print a CLI usage error once, and name a label without .TM2 (#35)
- 280d990 Refuse documents with no tape width, and keep unknown drawers whatever their keys (#36)
- be049b9 Make the CLI and MCP agree on help, names and blanks (#41)
- c05b026 Blame the padding when it is what takes the room for text (#42)
- b7ef8c3 Keep an unknown drawer whatever its identifier holds (#43)
- 67ac1ad Check room for text with a font size too, and fix the error docs (#47)
- c7d67cd Keep a drawer that is not an object, or of no string type (#48)
- d0ffada Say an unknown command is unknown, and exit 1 (#49)
- 0caa29d Find the no-room cause by fitted size, and read base fields of drawers of no type (#51)
- 1671a9a Order inverted lines for 180 turns, and place short pour values by valign (#56)
- 5e7b581 Refuse a font size larger than fits the tape (#57)
- 21c737a Write a label only to a .tm2 file from the CLI, as MCP does (#58)
- fe5e9e9 List every cause of ErrNoRoom in its doc and the README (#59)
- c82729e Make 12 mm the default tape width (#60)