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>
@@ -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]]2771
name = "posprint"2771
name = "posprint"2772
version = "0.2.1"2772
version = "0.3.0"2773
dependencies = [2773
dependencies = [2774
"barcoders",2774
"barcoders",2775
"chrono",2775
"chrono",@@ -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]
2
name = "posprint"
2
name = "posprint"
3
version = "0.2.1"
3
version = "0.3.0"
4
edition = "2021"
4
edition = "2021"
5
rust-version = "1.88"
5
rust-version = "1.88"
6
description = "Designer for POS-print documents"
6
description = "Designer for POS-print documents"
@@ -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 template6
6
7
## Status7
## Status8
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 run11
## Build and run12
12
@@ -46,15 +46,16 @@ All `${Parameters}` must be supplied via `--set NAME=VALUE` or the command fails46
| 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
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
## Features51
## Features52
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 zoom54
- Page width (mm) and calibrated preview zoom55
- Save and load `.pos` files55
- Save and load `.pos` files56
- 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, images57
- Inline ASCII checkboxes (`[]` / `[ ]` / `[x]`) — CP437-safe on thermal printers58
- Nested bullet lists, headings, `@date` / `@time`, barcodes, QR, images58
- 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
@@ -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 autocomplete94
### Print94
### Print95
95
96
1. **Print** → parse → `collect_parameter_names`.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
3. `substitute_document` → `EscPosEncoder` → `open_printer` → `print_bytes`.98
3. `substitute_document` → `EscPosEncoder` → `open_printer` → `print_bytes`.99
4. Serial baud is probed (`115200` first, then `9600`, …).99
4. Serial baud is probed (`115200` first, then `9600`, …).100
100
@@ -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
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
Parameters work inside any text, and inside barcode/QR/image directives (below).101
Parameters work inside any text, and inside barcode/QR/image directives (below).102
102
@@ -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
### Checkboxes99
### Checkboxes100
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
| 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
117
Unicode ballot boxes are not used (they become CJK garbage on CP437 printers).118
119
### Horizontal rule117
### Horizontal rule120
118
121
```markdown119
```markdown@@ -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 contributors1
# Maintainer: posprint contributors2
pkgname=posprint2
pkgname=posprint3
pkgver=0.2.13
pkgver=0.3.04
pkgrel=14
pkgrel=15
pkgdesc="Designer for POS-print documents with live preview and USB ESC/POS printing"5
pkgdesc="Designer for POS-print documents with live preview and USB ESC/POS printing"6
arch=('x86_64')6
arch=('x86_64')@@ -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>, Pa711
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)`.
716
fn try_parse_checkbox(chars: &[char]) -> Option<(bool, usize)> {
716
fn try_parse_checkbox(chars: &[char]) -> Option<(bool, usize)> {
717
if chars.first() != Some(&'[') {
717
if chars.first() != Some(&'[') {