Repository navigation
v0.2.0
Added
qrkit/render/ascii:AsciiOptionsopaque type plusdefault_options/0,with_margin/2,with_inverse_option/2,to_string_with/2, andto_string_compact_with/2— mirroring the builder-style options shapeqrkit/render/svgalready exposes (svg.default_options |> svg.with_margin(2)). The new functions let terminal callers tighten the quiet zone for debug dumps, fixture diffs, and inline-doc panels without giving up the ISO/IEC 18004 4-module default for camera-scannable output. Existingto_string/1,with_inverse/1, andto_string_compact/1keep the 4-module default and are unchanged at the API level. (#8)
Fixed
qrkit/content: comprehensive RFC compliance pass for the iCalendar and vCard renderers (issues #9–#17).vcard_to_stringandevent_to_stringnow terminate lines with CRLF (\r\n) per RFC 5545 §3.1 / RFC 2426 §2.1, not LF-only — strict consumers (Apple iOS Calendar in MIME contexts, Outlook drag-and-drop,python-icalendar,node-vcard) accept the output. (#12)- Both renderers fold long content lines at 75 octets with
CRLF<space>continuation per RFC 5545 §3.1 / RFC 2426 §2.6. Folding is grapheme-aware so multi-byte UTF-8 sequences are never split. (#13) escape_ical/escape_vcardstrip raw\randNULfrom TEXT values (RFC 5545 §3.3.11 / RFC 2426 §2.4.2 forbid raw control characters; CR in particular emulated CRLF and broke the document). (#11)event_to_stringnow emits the RFC-requiredPRODID(VCALENDAR §3.7.3),UID, andDTSTAMP(VEVENT §3.6.1).UIDis a deterministic synthesis of the event's title hash + start + end so the same event produces the same UID across runs;DTSTAMPdefaults tostart_unixsince no clock is available in a pure rendering function. (#14)vcard_to_stringalways emits the RFC 2426 MANDATORYNandFNproperties (§3.1.1 / §3.1.2) — when the caller did not callwith_name, both are emitted with empty values (N:;;;;andFN:) so the structure is still spec-conformant. (#15)event_to_stringinall_daymode now bumpsDTENDtostart + 1 daywhen the caller passedend_unix == start_unix, matching RFC 5545 §3.6.1's non-inclusive-end requirement for DATE-valued events. (#16)event_to_stringhandles pre-epochunixvalues correctly by floor-dividing into days / seconds-of-day (Gleam's/and%truncate toward zero, which had let negative sub-day components leak into the formatted output). (#9)event_to_stringclamps year to[1, 9999]so values beyond Y10K cannot break the RFC 5545 fixed-widthYYYYMMDDTHHMMSSZformat. (#10)- Final BEGIN/END boundary line is now terminated with CRLF (RFC 5545 §3.1 / RFC 2426 §2.1 require every content line — including the last — to end with CRLF).
content.emailnow percent-encodes thetoaddr-spec along withsubjectandbody, so reserved characters (?,&,#, space) intono longer produce a malformedmailto:URI. (#17)
Install
gleam add qrkitSee HexDocs for the API
reference.