diff --git a/README.md b/README.md index 6f13116..1959e52 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/cmd/super-zaje/README.md b/cmd/super-zaje/README.md index 47ddf8f..d7faf63 100644 --- a/cmd/super-zaje/README.md +++ b/cmd/super-zaje/README.md @@ -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 +``` + +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 diff --git a/cmd/zaje/README.md b/cmd/zaje/README.md index 2d566ab..f9b8c3b 100644 --- a/cmd/zaje/README.md +++ b/cmd/zaje/README.md @@ -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