It's taken so much effort to create this receipt. It's hard to overstate how happy I am with this little scrap of paper.
The text on the screen is a ReceiptLine document, think markdown but for receipts. My library parses it into ESC/POS commands and prints directly to the printer. No drivers.
The webpage itself talks to the printer, I implemented the driver in typescript.
There's a demo here: https://cellivar.github.io/WebReceiptLinePrinter/demo/
This is the whole document:
```
^^^RECEIPT
12/18/2021, 11:22:33 AM
Asparagus | 1| 1.00
Broccoli | 2| 2.00
Carrot | 3| 3.00
-
^TOTAL | ^6.00
=
```
ReceiptLine is a somewhat obscure standard developed a few years back in Japan. The major receipt printer companies collaborated on it. The idea was to have a standard that the various printers could interoperate with to some degree. I lifted some of my parser from that project.
https://github.com/receiptline/receiptline
Now some of you might reasonably ask "Cellivar why would you write a printer driver in TypeScript?" and the answer is easy: Chromebooks.