BlueGit

timfa posprint

Release 0.3.0: document ASCII checkboxes and bump version.

Sync HELP/DSL/README with [ ] / [x] and $[Name] bool params; set package version for the tagged release.

Co-authored-by: Cursor <cursoragent@cursor.com>

timfa Tim Falken · pushed by timfa

Authored 2026-07-17 · 4 months ago

Hash
06765f57f75bf1973ce3b81c252a4587a9503b9b
Parent
c38b4825
8 files changed +12 −13
Cargo.lock +1 −1
@@ -2769,7 +2769,7 @@ checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3"
2769 2769
2770 2770 [[package]]
2771 2771 name = "posprint"
2772 version = "0.2.1"
2772 version = "0.3.0"
2773 2773 dependencies = [
2774 2774 "barcoders",
2775 2775 "chrono",
@@ -2769,7 +2769,7 @@ checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3"
2769
2769
2770[[package]]
2770[[package]]
2771name = "posprint"
2771name = "posprint"
2772version = "0.2.1"
2772version = "0.3.0"
2773dependencies = [
2773dependencies = [
2774 "barcoders",
2774 "barcoders",
2775 "chrono",
2775 "chrono",
Cargo.toml +1 −1
@@ -1,6 +1,6 @@
1 1 [package]
2 2 name = "posprint"
3 version = "0.2.1"
3 version = "0.3.0"
4 4 edition = "2021"
5 5 rust-version = "1.88"
6 6 description = "Designer for POS-print documents"
@@ -1,6 +1,6 @@
1[package]
1[package]
2name = "posprint"
2name = "posprint"
3version = "0.2.1"
3version = "0.3.0"
4edition = "2021"
4edition = "2021"
5rust-version = "1.88"
5rust-version = "1.88"
6description = "Designer for POS-print documents"
6description = "Designer for POS-print documents"
README.md +5 −4
@@ -6,7 +6,7 @@ Cross-platform designer for POS (point-of-sale) receipt documents. Edit template
6 6
7 7 ## Status
8 8
9 **v0.2.1** — Rust + egui app with editor, preview, help, `.pos` files, parameters, and multi-transport printing.
9 **v0.3.0** — Inline checkboxes (`[]` / `[x]`) and `$[Name]` bool parameters, nested bullet lists, editor paste fixes, multi-transport printing.
10 10
11 11 ## Build and run
12 12
@@ -46,15 +46,16 @@ All `${Parameters}` must be supplied via `--set NAME=VALUE` or the command fails
46 46 | Linux (Arch) | `.pkg.tar.zst` (x86_64) | `sudo pacman -U posprint_*_x86_64.pkg.tar.zst` |
47 47 | Windows | `posprint.exe` | Download from GitLab release job artifacts |
48 48
49 Tag a version (e.g. `0.2.0`) to trigger release builds.
49 Tag a version (e.g. `0.3.0`) to trigger release builds.
50 50
51 51 ## Features
52 52
53 53 - Markdown-like template editor with live preview (Design tab)
54 54 - Page width (mm) and calibrated preview zoom
55 55 - Save and load `.pos` files
56 - Parameter tokens (`${DocumentNumber}`) with print dialog and CLI `--set`
57 - Bullet lists, headings, `@date` / `@time`, barcodes, QR, images
56 - Parameter tokens: `${Name}` (text) and `$[Name]` (bool checkbox) via print dialog and CLI `--set`
57 - Inline ASCII checkboxes (`[]` / `[ ]` / `[x]`) — CP437-safe on thermal printers
58 - Nested bullet lists, headings, `@date` / `@time`, barcodes, QR, images
58 59 - Print via USB-direct, Windows spooler, or serial (baud probed)
59 60 - In-app **Help** tab (from [docs/HELP.md](docs/HELP.md))
60 61
@@ -6,7 +6,7 @@ Cross-platform designer for POS (point-of-sale) receipt documents. Edit template
6
6
7## Status
7## Status
8
8
9**v0.2.1** — Rust + egui app with editor, preview, help, `.pos` files, parameters, and multi-transport printing.
9**v0.3.0** — Inline checkboxes (`[]` / `[x]`) and `$[Name]` bool parameters, nested bullet lists, editor paste fixes, multi-transport printing.
10
10
11## Build and run
11## Build and run
12
12
@@ -46,15 +46,16 @@ All `${Parameters}` must be supplied via `--set NAME=VALUE` or the command fails
46| Linux (Arch) | `.pkg.tar.zst` (x86_64) | `sudo pacman -U posprint_*_x86_64.pkg.tar.zst` |
46| Linux (Arch) | `.pkg.tar.zst` (x86_64) | `sudo pacman -U posprint_*_x86_64.pkg.tar.zst` |
47| Windows | `posprint.exe` | Download from GitLab release job artifacts |
47| Windows | `posprint.exe` | Download from GitLab release job artifacts |
48
48
49Tag a version (e.g. `0.2.0`) to trigger release builds.
49Tag a version (e.g. `0.3.0`) to trigger release builds.
50
50
51## Features
51## Features
52
52
53- Markdown-like template editor with live preview (Design tab)
53- Markdown-like template editor with live preview (Design tab)
54- Page width (mm) and calibrated preview zoom
54- Page width (mm) and calibrated preview zoom
55- Save and load `.pos` files
55- Save and load `.pos` files
56- Parameter tokens (`${DocumentNumber}`) with print dialog and CLI `--set`
56- Parameter tokens: `${Name}` (text) and `$[Name]` (bool checkbox) via print dialog and CLI `--set`
57- Bullet lists, headings, `@date` / `@time`, barcodes, QR, images
57- Inline ASCII checkboxes (`[]` / `[ ]` / `[x]`) — CP437-safe on thermal printers
58- Nested bullet lists, headings, `@date` / `@time`, barcodes, QR, images
58- Print via USB-direct, Windows spooler, or serial (baud probed)
59- Print via USB-direct, Windows spooler, or serial (baud probed)
59- In-app **Help** tab (from [docs/HELP.md](docs/HELP.md))
60- In-app **Help** tab (from [docs/HELP.md](docs/HELP.md))
60
61
docs/ARCHITECTURE.md +1 −1
@@ -94,7 +94,7 @@ While the print dialog is open, the main UI is disabled and editor autocomplete
94 94 ### Print
95 95
96 96 1. **Print** → parse → `collect_parameter_names`.
97 2. Dialog: one field per parameter; `list_printers()` for USB / spooler / serial.
97 2. Dialog: text field per `${Name}`, checkbox per `$[Name]`; `list_printers()` for USB / spooler / serial.
98 98 3. `substitute_document` → `EscPosEncoder` → `open_printer` → `print_bytes`.
99 99 4. Serial baud is probed (`115200` first, then `9600`, …).
100 100
@@ -94,7 +94,7 @@ While the print dialog is open, the main UI is disabled and editor autocomplete
94### Print
94### Print
95
95
961. **Print** → parse → `collect_parameter_names`.
961. **Print** → parse → `collect_parameter_names`.
972. Dialog: one field per parameter; `list_printers()` for USB / spooler / serial.
972. Dialog: text field per `${Name}`, checkbox per `$[Name]`; `list_printers()` for USB / spooler / serial.
983. `substitute_document` → `EscPosEncoder` → `open_printer` → `print_bytes`.
983. `substitute_document` → `EscPosEncoder` → `open_printer` → `print_bytes`.
994. Serial baud is probed (`115200` first, then `9600`, …).
994. Serial baud is probed (`115200` first, then `9600`, …).
100
100
docs/DSL-SPEC.md +1 −1
@@ -96,7 +96,7 @@ Wrapped lines use a hanging indent matching the bullet prefix width:
96 96 | `[x]` / `[X]` | `[x]` |
97 97 | `$[Name]` | `[ ]` or `[x]` from a bool parameter |
98 98
99 ASCII brackets + `x` stay inline in the native CP437 font. `${Name}` and `$[Name]` cannot share a name.
99 ASCII brackets + `x` stay inline in the native CP437 font. Do not use Unicode ☐ / √ — many ESC/POS printers map those to CJK glyphs. `${Name}` and `$[Name]` cannot share a name.
100 100
101 101 Parameters work inside any text, and inside barcode/QR/image directives (below).
102 102
@@ -96,7 +96,7 @@ Wrapped lines use a hanging indent matching the bullet prefix width:
96| `[x]` / `[X]` | `[x]` |
96| `[x]` / `[X]` | `[x]` |
97| `$[Name]` | `[ ]` or `[x]` from a bool parameter |
97| `$[Name]` | `[ ]` or `[x]` from a bool parameter |
98
98
99ASCII brackets + `x` stay inline in the native CP437 font. `${Name}` and `$[Name]` cannot share a name.
99ASCII brackets + `x` stay inline in the native CP437 font. Do not use Unicode ☐ / √ — many ESC/POS printers map those to CJK glyphs. `${Name}` and `$[Name]` cannot share a name.
100
100
101Parameters work inside any text, and inside barcode/QR/image directives (below).
101Parameters work inside any text, and inside barcode/QR/image directives (below).
102
102
docs/HELP.md +1 −3
@@ -98,7 +98,7 @@ Long items wrap with a hanging indent:
98 98
99 99 ### Checkboxes
100 100
101 Inline checkboxes use ASCII brackets so they print in the native font:
101 Inline checkboxes print as ASCII so they stay in the printer’s CP437 font (Unicode ☐ / √ often become CJK garbage):
102 102
103 103 | Syntax | Result |
104 104 |--------|--------|
@@ -114,8 +114,6 @@ $[Paid]
114 114
115 115 `$[Paid]` is a **parameter**: in the Print dialog it is a true/false checkbox; on the receipt it becomes `[ ]` or `[x]`. CLI: `--set Paid=true`.
116 116
117 Unicode ballot boxes are not used (they become CJK garbage on CP437 printers).
118
119 117 ### Horizontal rule
120 118
121 119 ```markdown
@@ -98,7 +98,7 @@ Long items wrap with a hanging indent:
98
98
99### Checkboxes
99### Checkboxes
100
100
101Inline checkboxes use ASCII brackets so they print in the native font:
101Inline checkboxes print as ASCII so they stay in the printer’s CP437 font (Unicode ☐ / √ often become CJK garbage):
102
102
103| Syntax | Result |
103| Syntax | Result |
104|--------|--------|
104|--------|--------|
@@ -114,8 +114,6 @@ $[Paid]
114
114
115`$[Paid]` is a **parameter**: in the Print dialog it is a true/false checkbox; on the receipt it becomes `[ ]` or `[x]`. CLI: `--set Paid=true`.
115`$[Paid]` is a **parameter**: in the Print dialog it is a true/false checkbox; on the receipt it becomes `[ ]` or `[x]`. CLI: `--set Paid=true`.
116
116
117Unicode ballot boxes are not used (they become CJK garbage on CP437 printers).
118
119### Horizontal rule
117### Horizontal rule
120
118
121```markdown
119```markdown
packaging/arch/PKGBUILD +1 −1
@@ -1,6 +1,6 @@
1 1 # Maintainer: posprint contributors
2 2 pkgname=posprint
3 pkgver=0.2.1
3 pkgver=0.3.0
4 4 pkgrel=1
5 5 pkgdesc="Designer for POS-print documents with live preview and USB ESC/POS printing"
6 6 arch=('x86_64')
@@ -1,6 +1,6 @@
1# Maintainer: posprint contributors
1# Maintainer: posprint contributors
2pkgname=posprint
2pkgname=posprint
3pkgver=0.2.1
3pkgver=0.3.0
4pkgrel=1
4pkgrel=1
5pkgdesc="Designer for POS-print documents with live preview and USB ESC/POS printing"
5pkgdesc="Designer for POS-print documents with live preview and USB ESC/POS printing"
6arch=('x86_64')
6arch=('x86_64')
src/dsl/parser.rs +1 −1
@@ -711,7 +711,7 @@ fn parse_inlines(input: &str, line: usize, col: usize) -> Result<Vec<Inline>, Pa
711 711 Ok(out)
712 712 }
713 713
714 /// Parse `[]`, `[ ]`, `[x]`, `[X]`, or `[x]` at the start of `chars`.
714 /// Parse `[]`, `[ ]`, `[x]`, or `[X]` at the start of `chars`.
715 715 /// Returns `(checked, chars_consumed)`.
716 716 fn try_parse_checkbox(chars: &[char]) -> Option<(bool, usize)> {
717 717 if chars.first() != Some(&'[') {
@@ -711,7 +711,7 @@ fn parse_inlines(input: &str, line: usize, col: usize) -> Result<Vec<Inline>, Pa
711 Ok(out)
711 Ok(out)
712}
712}
713
713
714/// Parse `[]`, `[ ]`, `[x]`, `[X]`, or `[x]` at the start of `chars`.
714/// Parse `[]`, `[ ]`, `[x]`, or `[X]` at the start of `chars`.
715/// Returns `(checked, chars_consumed)`.
715/// Returns `(checked, chars_consumed)`.
716fn try_parse_checkbox(chars: &[char]) -> Option<(bool, usize)> {
716fn try_parse_checkbox(chars: &[char]) -> Option<(bool, usize)> {
717 if chars.first() != Some(&'[') {
717 if chars.first() != Some(&'[') {