From 84b4853222cdb56c1844dcb1bd55dca22c26ced6 Mon Sep 17 00:00:00 2001 From: Dmitry Berezovsky Date: Sat, 23 Dec 2023 20:43:32 +0200 Subject: [PATCH] docs: add instructions explaining library import --- README.md | 48 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2a84740..1dc05dd 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ - ![Tapen Picture](https://raw.githubusercontent.com/corvis/tapen/master/docs/assets/cover-picture.png "Tapen cover image") -

Tapen

@@ -18,10 +16,10 @@

-**Tapen** is a tool for composing and printing labels on label printers. At the moment only Brother printers are supported. +**Tapen** is a tool for composing and printing labels on label printers. At the moment only Brother printers are +supported. Developed and tested on linux only. - ## Basic Usage Just print a line of text covering all available height of the tape: @@ -54,15 +52,51 @@ There are a couple of possible installation methods: 1. With pip: `pip install tapen` 2. Use pre-compiled binary. Just download binary from [releases page](https://github.com/corvis/tapen/releases) +## Usage guide + +### Libraries + +Library is a collection of templates to be used for printing. You can connect a library using `tapen import-lib` +command. The general syntax is: + +```shell +tapen import-lib +``` + +Where: + +* `library-name` - name you will be using to refer to the library locally. You decide how you want to call the library, + however the name should be unique for your local installation. +* `library-locator` - locator pointing the library. It can be a path to a local directory or a URL to a remote library. + The exact syntax depends on the storage. See below for details. + +There are a few library storages supported: + +| Storage | Locator syntax | Description | +|-------------------|---------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------| +| Local directory | `local:/path/to/library` | Path to a directory containing library files. | +| Github repository | `github://owner/repo[@tag-or-branch]` | Github repository containing library files, **optionaly** you can include the tag or branch name. Example: `github://JointBox/labels@master` | + +Examples: + +```shell +# Import library from local directory +tapen import-lib my-lib1 local:/path/to/library +# Import library from github repository +tapen import-lib my-lib2 github://JointBox/labels +tapen import-lib my-lib3 github://JointBox/labels@master +``` + # Credits * Dmitry Berezovsky (@corvis) - author and main maintainer -* Dominic Radermacher (blip@mockmoon-cybernetics.ch) - creator of libptouch, the source code of this library was used to understand the interface to Brotehr devices. +* Dominic Radermacher (blip@mockmoon-cybernetics.ch) - creator of libptouch, the source code of this library was used to + understand the interface to Brotehr devices. * [CLI Rack](https://github.com/corvis/cli-rack) # Disclaimer This module is licensed under MIT. This means you are free to use it in commercial projects. -The GPLv3 license clearly explains that there is no warranty for this free software. Please see the included LICENSE file -for details. +The GPLv3 license clearly explains that there is no warranty for this free software. Please see the included LICENSE +file for details. \ No newline at end of file