Skip to content

Commit

Permalink
Update readme: Fold the TLDR code example
Browse files Browse the repository at this point in the history
  • Loading branch information
okarmazin committed Jan 28, 2024
1 parent 5260e21 commit 6a67e81
Showing 1 changed file with 16 additions and 23 deletions.
39 changes: 16 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# ESC/POS for Kotlin Multiplatform

<!-- TOC -->
Basic ESC/POS command generator and device connection support for various connection types: Bluetooth, USB, TCP.

* [ESC/POS for Kotlin Multiplatform](#escpos-for-kotlin-multiplatform)
* [Setup](#setup)
* [TLDR Android Bluetooth example](#tldr-android-bluetooth-example)
* [What is ESC/POS?](#what-is-escpos)
* [What does this library do?](#what-does-this-library-do)
* [Feature/Platform matrix](#featureplatform-matrix)
This library is not a wrapper around established ESC/POS libraries, but rather a green field implementation.

<!-- TOC -->
* [ESC/POS for Kotlin Multiplatform](#escpos-for-kotlin-multiplatform)
* [Setup](#setup)
* [What is ESC/POS?](#what-is-escpos)
* [Feature/Platform matrix](#featureplatform-matrix)
<!-- TOC -->

#### Setup
## Setup
The library is available at Maven Central.

```kotlin
Expand All @@ -23,7 +23,8 @@ repositories {
implementation("cz.multiplatform.escpos4k:escpos4k:0.3.0")
```

#### TLDR Android Bluetooth example
<details>
<summary>TLDR Android Bluetooth example</summary>

```kotlin
suspend fun awaitPrint(): MyError? {
Expand Down Expand Up @@ -82,29 +83,21 @@ fun mapToMyError(libraryError: PrintError): MyError {
(1) Use the PrinterManager to open a Bluetooth connection
(2) Print using the CommandBuilder
```
</details>

#### What is ESC/POS?
## What is ESC/POS?

ESC/POS is a set of printer commands developed by Epson for use in thermal printers.
It has been adopted as a "standard" by virtually all receipt printer manufacturers across the globe.
It has been adopted as a "standard" by virtually all thermal printer manufacturers across the globe.

ESC/POS is similar in this regard to the QR code - QR codes
were [invented by Denso Wave](https://en.wikipedia.org/wiki/QR_code)
for use in their automotive manufacturing plants, but are now used just about everywhere.

Similarly, most thermal printers - at least those intended for printing receipts and similar items -
work with a subset of ESC/POS. The set of _actually supported_ ESC/POS commands varies among
printer OEMs and printer models.

#### What does this library do?

This library aims to provide basic ESC/POS command generator as well as device connection support for
various device connection types: Bluetooth, USB, TCP etc.

Being a programming exercise first and foremost, this library purposefully handles as much work as possible in
Common Kotlin. It is not a wrapper around established ESC/POS libraries, but rather a green field implementation.
Most thermal printers work with a subset of ESC/POS. The set of _actually supported_ ESC/POS commands varies
among OEMs and printer models.

#### Feature/Platform matrix
## Feature/Platform matrix

The following table summarizes connector implementation status on each platform.

Expand Down

0 comments on commit 6a67e81

Please sign in to comment.