@lotics/cli 0.316.0 → 0.316.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/cli.js +33 -6
- package/docs/document_templates.md +10 -0
- package/docs/workflows.md +2 -1
- package/package.json +1 -1
|
@@ -107,6 +107,16 @@ A field can also print as a **QR code** or a **Code 128 barcode** (a picture a p
|
|
|
107
107
|
|
|
108
108
|
A record's **photos** (a files field, an act's paper hands each as a file cell `{id, name, mime, url}`) print too, and only for a file whoever makes the paper may read — the same rule the file proxy applies; any other file is never drawn. html: `{{#each photos}}<img src="{{url}}">{{/each}}` (only the data's file cells are inlined; a url typed into a text field stays a link). Word: `{{IMAGE picture(cover, 8)}}`, and `{{FOR p IN photos}}{{IMAGE picture($p, 8)}}{{END-FOR p}}` for several. Excel: `{{cover | picture:6}}` as the whole cell, or `{{this | picture}}` inside `{{#each photos}}` (each row grows to its picture). The number is the width in centimetres (8, or 6 in Excel, by default). `picture` takes one image file: a list (loop over it), a file that is no image or one that cannot be read is refused by name. Photos are embedded at most 1600 pixels across, about 200 dpi at 20 cm.
|
|
109
109
|
|
|
110
|
+
A Word command (`{{ … }}`) reads the data and calls, by name, a Word helper (`picture`, `qr`, `code128`) or one of these text
|
|
111
|
+
and number functions: `trim`, `trimStart`, `trimEnd`, `lower`, `upper`, `capitalize`, `replace`, `replaceAll`, `removeChars`, `removeSpaces`,
|
|
112
|
+
`startsWith`, `endsWith`, `contains`, `substring`, `padStart`, `padEnd`, `length`, `join`, `split`, `repeat`, `formatNumber`,
|
|
113
|
+
`formatDecimal`, `numberToWords`. It holds no JavaScript method or regular-expression literal: `{{upper(name)}}`,
|
|
114
|
+
`{{formatDecimal(total, 0, "vi-VN")}}`, and `{{removeSpaces(removeChars(cccd || "", ".…"))}}` for the text without its dots,
|
|
115
|
+
ellipses and spaces. `removeChars(text, chars)` removes every character of `text` that occurs in `chars` (a set of characters,
|
|
116
|
+
never a pattern); `removeSpaces(text)` removes every whitespace character of `text`, anywhere in it, the set `trim` trims.
|
|
117
|
+
|
|
118
|
+
A field named like a function is read as the field, and calling the function then fails.
|
|
119
|
+
|
|
110
120
|
`set_template`'s description holds each type's exact marker grammar and helper list.
|
|
111
121
|
|
|
112
122
|
## Generating a filled file
|
package/docs/workflows.md
CHANGED
|
@@ -305,7 +305,8 @@ The same work can be written with the helpers below, which are additions to Java
|
|
|
305
305
|
- **Math**: `sum`, `sumBy`, `mean`, `meanBy`, `minBy`, `maxBy`, `round`, `ceil`, `floor`, `min`, `max`,
|
|
306
306
|
`abs`, `mod`, `pow`, `sqrt`, `clamp`, `percentage`
|
|
307
307
|
- **Text**: `upper`, `lower`, `capitalize`, `trim`, `contains`, `startsWith`, `endsWith`, `replace`,
|
|
308
|
-
`replaceAll`, `
|
|
308
|
+
`replaceAll`, `removeChars(str, chars)` (without every character that occurs in `chars`),
|
|
309
|
+
`removeSpaces(str)` (without any whitespace; a Word template command calls both too), `substring`, `length`, `split`, `join`, `padStart(str, length, char)`,
|
|
309
310
|
`padEnd(str, length, char)`, `formatNumber(x, decimals)` (ungrouped; rounds the decimal, a half away
|
|
310
311
|
from zero: `formatNumber(1.005, 2)` is `1.01`),
|
|
311
312
|
`formatDecimal(x, decimals, locale)` (grouped: `formatDecimal(151000, 0, "vi-VN")` is `151.000`),
|