Skip to content

Commit

Permalink
README revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
jessp01 committed Aug 6, 2023
1 parent b28e1e4 commit b01c0ee
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ If you take this route, you'll need to copy the `highlight/syntax_files` and `ut
It's a separate binary because it depends on the [gosseract](https://github.com/otiai10/gosseract) which in turn
depends on `libtesseract` and requires its SOs to be available on the machine.

First, install `zaje` using [install_zaje.sh](./install_zaje.sh), and then...
First, install `zaje` using [install_zaje.sh](https://github.com/jessp01/zaje/blob/master/install_zaje.sh), and then...

#### Installing on Debian/Ubuntu
```sh
Expand Down
43 changes: 43 additions & 0 deletions cmd/super-zaje/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,49 @@
[![GoReportCard][go-report-card-badge]][go-report-card]
[![License][badge-license]][license]

### Installing `super-zaje`

`super-zaje` does everything `zaje` does but provides the additional functionality of extracting text from an image.
It's a separate binary because it depends on the [gosseract](https://github.com/otiai10/gosseract) which in turn
depends on `libtesseract` and requires its SOs to be available on the machine.

First, install `zaje` using [install_zaje.sh](https://github.com/jessp01/zaje/blob/master/install_zaje.sh), and then...

#### Installing on Debian/Ubuntu
```sh
# install deps:
$ sudo apt-get install -y libtesseract-dev libleptonica-dev tesseract-ocr-eng golang-go
```

Most popular Linux distros include the `libtesseract` package but it may be named differently. If the official repos of
your distro of choice do not have it, you can always compile it from source.

#### Installing on Darwin (what people mistakenly refer to as MacOS)
```sh
$ brew install tesseract
```

After installing `tesseract`, simply invoke the below to install `super-zaje`:

```sh
# install super-zaje
$ go install github.com/jessp01/zaje/cmd/super-zaje@latest
```

You can then use it thusly:
```sh
$ ~/go/bin/super-zaje -l sh </path/to/img/of/http/url>
```

For example, try:
```sh
$ ~/go/bin/super-zaje "https://github.com/jessp01/zaje/blob/master/testimg/go1.png?raw=true"
```

**NOTE**: `zaje` is capable of detecting the lexer to use based on the first line of text but with images, you'll often
need to help it and specify a designated lexer by passing `-l $NAME` (e.g: `zaje -l sh`, `zaje -l server-log`, etc).


```yml
NAME:
super-zaje - Syntax highlighter to cover all your shell needs
Expand Down
24 changes: 24 additions & 0 deletions cmd/zaje/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@
[![GoReportCard][go-report-card-badge]][go-report-card]
[![License][badge-license]][license]

### Installation

Because `zaje` depends on lexers from the `gohighlight` package and also provides some [helper shell
functions](./utils/functions.rc), I've created [install\_zaje.sh](./install_zaje.sh) to handle its deployment.

This is a shell script and does not require Go to be installed. Simply download and invoke with no arguments:

```sh
$ curl https://raw.githubusercontent.com/jessp01/zaje/master/install_zaje.sh > install_zaje.sh
$ ./install_zaje.sh
```

If you run `install_zaje.sh` as a super user, you only need to start a new shell to get all the functionality.
Otherwise, you'll need to source the functions file (see the script's output for instructions).

Being a Golang application, you can also build it yourself with `go` get or fetch a [specific version](https://github.com/jessp01/zaje/releases).
Fetching from the master branch using `go`:

```sh
$ go install github.com/jessp01/zaje/cmd@latest
```

If you take this route, you'll need to copy the `highlight/syntax_files` and `utils/functions.rc` manually.

```yml
NAME:
zaje - Syntax highlighter to cover all your shell needs
Expand Down

0 comments on commit b01c0ee

Please sign in to comment.