1
mirror of https://gitlab.com/jessieh/qrprinter.git synced 2024-12-22 01:41:46 +00:00
LuaJIT library facilitating easy encoding and printing of strings as QR codes
Go to file
2021-10-07 02:57:34 -04:00
rockspec Update .rockspec 2021-10-07 02:57:34 -04:00
src Initial commit 2021-10-07 01:55:46 -04:00
.gitignore Initial commit 2021-10-07 01:55:46 -04:00
fennel-0.10.0-x86_64 Initial commit 2021-10-07 01:55:46 -04:00
LICENSE Initial commit 2021-10-07 01:55:46 -04:00
Makefile Initial commit 2021-10-07 01:55:46 -04:00
README.md Update README.md 2021-10-07 06:20:40 +00:00

qrprinter

A wrapper for libqrencode that provides an easy way of encoding and printing strings as QR codes from Lua.

Written in Fennel.

Installation

Install with luarocks:

luarocks install qrprinter

Example Usage

Documentation

Encoding

qrprinter.encode_string

qrprinter.encode_string( string )

Encodes string into a table representing a QR code.

Returns a 2D sequential table of true/false values representing black/white QR modules.

Printing

All print functions accept an optional table options that may contain two keys:

  • invert: If non-nil, the output colors will be inverted
  • padding: Number of blanks cells to print around the QR code (default 2)

qrprinter.print_qr

qrprinter.print_qr( qr, [options] )

Print qr to stdout using ANSI escape sequences.
Alias of qrprinter.print_qr_ansi.

qrprinter.print_qr_ascii

qrprinter.print_qr_ascii( qr, [options] )

Print qr to stdout using ASCII characters.

qrprinter.print_qr_ansi

qrprinter.print_qr_ansi( qr, [options] )

Print qr to stdout using ANSI escape sequences.

qrprinter.print_qr_utf8

qrprinter.print_qr_utf8( qr, [options] )

Print qr to stdout using UTF8 block elements.