Skip to content

Commit

Permalink
Update README.md (#3)
Browse files Browse the repository at this point in the history
* Update README.md

* Configure markdownlint

* Setup markdownlint workflow

* Try to fix the workflow

* Fix the typo

* Test if fails

* Revert "Test if fails"

This reverts commit f482c48.

* Move golangci-lint configuration to a separate directory

* Configure workflow

* Fix the configuration
  • Loading branch information
kamilturek authored Aug 21, 2022
1 parent e983158 commit cfc1bce
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
File renamed without changes.
5 changes: 5 additions & 0 deletions .ci/markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"no-duplicate-heading": {
"siblings_only": true
}
}
1 change: 1 addition & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: '--config .ci/.golangci.yml'
22 changes: 22 additions & 0 deletions .github/workflows/markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: markdownlint
on:
push:
tags:
- v*
branches:
- master
pull_request:
permissions:
contents: read
jobs:
markdownlint:
name: Lint Markdown files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: markdownlint
uses: avto-dev/markdown-lint@v1.5.0
with:
args: '.'
config: '.ci/markdownlint.json'
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,32 @@
A CLI tool & Go package for conversion of ZPL files.
A wrapper around [Labelary ZPL Web Service](http://labelary.com/service.html).

## Installation

### CLI Tool

Using Go:

```bash
go install github.com/kamilturek/go-zpl/cmd/go-zpl@latest
```

Using Homebrew:

```bash
echo "coming soon"
```

### Go package

```bash
go get github.com/kamilturek/go-zpl
```

## Usage

### CLI Tool

`go-zpl` provides a help message describing all available options along with
their default values.

Expand Down Expand Up @@ -39,6 +63,34 @@ $ head -n 1 hello.pdf
%PDF-1.4
```

### Go package

```go
package main

import "github.com/kamilturek/go-zpl"

func main() {
// Using convenience wrapper
zpl.ToPNG(
[]byte("^xa^cfa,50^fo100,100^fdHello World^fs^xz"),
// Optional extra configuration
zpl.WithWidth(4),
zpl.WithHeight(6),
zpl.WithDensity(8),
)

// Or configuring the converter from scratch
f, _ := os.Open("hello.zpl")
zpl.Convert(
zpl.WithInput(f),
zpl.WithOutput(os.Stdout),
zpl.WithOutputFormat(zpl.PNG),
zpl.WithDensity(12),
)
}
```

## Contributing

Please create a GitHub issue for any feedback, bugs, requests or issues.
Expand Down

0 comments on commit cfc1bce

Please sign in to comment.