update readme

This commit is contained in:
phiresky 2023-05-26 16:37:28 +02:00
parent ed06cd9af1
commit 30837dbca2
4 changed files with 67 additions and 55 deletions

2
Cargo.lock generated
View File

@ -1371,7 +1371,7 @@ checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
[[package]] [[package]]
name = "ripgrep_all" name = "ripgrep_all"
version = "1.0.0-alpha.2" version = "1.0.0-alpha.5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-compression 0.4.0", "async-compression 0.4.0",

View File

@ -11,7 +11,7 @@ license = "AGPL-3.0-or-later"
name = "ripgrep_all" name = "ripgrep_all"
readme = "README.md" readme = "README.md"
repository = "https://github.com/phiresky/ripgrep-all" repository = "https://github.com/phiresky/ripgrep-all"
version = "1.0.0-alpha.2" version = "1.0.0-alpha.5"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

116
README.md
View File

@ -52,6 +52,7 @@ rga-fzf() {
``` ```
And for your `~/.config/fish/config.fish`: And for your `~/.config/fish/config.fish`:
``` ```
function rga-fzf function rga-fzf
set RG_PREFIX 'rga --files-with-matches' set RG_PREFIX 'rga --files-with-matches'
@ -86,9 +87,11 @@ Linux x64, macOS and Windows binaries are available [in GitHub Releases][latestr
`pacman -S ripgrep-all`. `pacman -S ripgrep-all`.
#### Nix #### Nix
`nix-env -iA nixpkgs.ripgrep-all` `nix-env -iA nixpkgs.ripgrep-all`
#### Debian-based #### Debian-based
download the [rga binary][latestrelease] and get the dependencies like this: download the [rga binary][latestrelease] and get the dependencies like this:
`apt install ripgrep pandoc poppler-utils ffmpeg` `apt install ripgrep pandoc poppler-utils ffmpeg`
@ -139,50 +142,46 @@ rga --rga-list-adapters
Adapters: Adapters:
- **ffmpeg** - **pandoc**
Uses ffmpeg to extract video metadata/chapters and subtitles. Uses pandoc to convert binary/unreadable text documents to plain markdown-like text
Extensions: `.mkv`, `.mp4`, `.avi` Runs: pandoc --from= --to=plain --wrap=none --markdown-headings=atx
Extensions: .epub, .odt, .docx, .fb2, .ipynb
* **pandoc** - **poppler**
Uses pandoc to convert binary/unreadable text documents to plain markdown-like text. Uses pdftotext (from poppler-utils) to extract plain text from PDF files
Extensions: `.epub`, `.odt`, `.docx`, `.fb2`, `.ipynb` Runs: pdftotext - -
Extensions: .pdf
Mime Types: application/pdf
- **poppler** - **postprocpagebreaks**
Uses pdftotext (from poppler-utils) to extract plain text from PDF files. Adds the page number to each line for an input file that specifies page breaks as ascii page break character.
Extensions: `.pdf` Mainly to be used internally by the poppler adapter.
Mime Types: `application/pdf` Extensions: .asciipagebreaks
- **zip** - **ffmpeg**
Reads a zip file as a stream and recurses down into its contents. Uses ffmpeg to extract video metadata/chapters, subtitles, lyrics, and other metadata
Extensions: `.zip` Extensions: .mkv, .mp4, .avi, .mp3, .ogg, .flac
Mime Types: `application/zip`
- **decompress** - **zip**
Reads compressed file as a stream and runs a different extractor on the contents. Reads a zip file as a stream and recurses down into its contents
Extensions: `.tgz`, `.tbz`, `.tbz2`, `.gz`, `.bz2`, `.xz`, `.zst` Extensions: .zip, .jar
Mime Types: `application/gzip`, `application/x-bzip`, `application/x-xz`, `application/zstd` Mime Types: application/zip
- **tar** - **decompress**
Reads a tar file as a stream and recurses down into its contents. Reads compressed file as a stream and runs a different extractor on the contents.
Extensions: `.tar` Extensions: .tgz, .tbz, .tbz2, .gz, .bz2, .xz, .zst
Mime Types: application/gzip, application/x-bzip, application/x-xz, application/zstd
* **sqlite** - **tar**
Uses sqlite bindings to convert sqlite databases into a simple plain text format. Reads a tar file as a stream and recurses down into its contents
Extensions: `.db`, `.db3`, `.sqlite`, `.sqlite3` Extensions: .tar
Mime Types: `application/x-sqlite3`
The following adapters are disabled by default, and can be enabled using `--rga-adapters=+pdfpages,tesseract`: - **sqlite**
Uses sqlite bindings to convert sqlite databases into a simple plain text format
Extensions: .db, .db3, .sqlite, .sqlite3
Mime Types: application/x-sqlite3
- **pdfpages** The following adapters are disabled by default, and can be enabled using '--rga-adapters=+foo,bar':
Converts a pdf to its individual pages as png files. Only useful in combination with tesseract.
Extensions: `.pdf`
Mime Types: `application/pdf`
- **tesseract**
Uses tesseract to run OCR on images to make them searchable.
May need `-j1` to prevent overloading the system.
Make sure you have tesseract installed.
Extensions: `.jpg`, `.png`
## USAGE: ## USAGE:
@ -202,6 +201,17 @@ The following adapters are disabled by default, and can be enabled using `--rga-
> Detection is only done on the first 8KiB of the file, since we can\'t > Detection is only done on the first 8KiB of the file, since we can\'t
> always seek on the input (in archives). > always seek on the input (in archives).
**\--rga-no-cache**
> Disable caching of results
>
> By default, rga caches the extracted text, if it is small enough, to a
> database in \${XDG*CACHE_DIR-\~/.cache}/ripgrep-all on Linux,
> *\~/Library/Caches/ripgrep-all\_ on macOS, or
> C:\\Users\\username\\AppData\\Local\\ripgrep-all on Windows. This way,
> repeated searches on the same set of files will be much faster. If you
> pass this flag, all caching will be disabled.
**-h**, **\--help** **-h**, **\--help**
> Prints help information > Prints help information
@ -210,15 +220,9 @@ The following adapters are disabled by default, and can be enabled using `--rga-
> List all known adapters > List all known adapters
**\--rga-no-cache** **\--rga-print-config-schema**
> Disable caching of results > Print the JSON Schema of the configuration file
>
> By default, rga caches the extracted text, if it is small enough, to a
> database in \~/.cache/rga on Linux, _\~/Library/Caches/rga_ on macOS,
> or C:\\Users\\username\\AppData\\Local\\rga on Windows. This way,
> repeated searches on the same set of files will be much faster. If you
> pass this flag, all caching will be disabled.
**\--rg-help** **\--rg-help**
@ -242,25 +246,32 @@ The following adapters are disabled by default, and can be enabled using `--rga-
> use all default adapters except for bar and baz. \"+bar,baz\" means > use all default adapters except for bar and baz. \"+bar,baz\" means
> use all default adapters and also bar and baz. > use all default adapters and also bar and baz.
**\--rga-cache-compression-level=**\<cache-compression-level\> **\--rga-cache-compression-level=**\<compression-level\>
> ZSTD compression level to apply to adapter outputs before storing in > ZSTD compression level to apply to adapter outputs before storing in
> cache db > cache db
> >
> Ranges from 1 - 22 \[default: 12\] > Ranges from 1 - 22 \[default: 12\]
**\--rga-cache-max-blob-len=**\<cache-max-blob-len\> **\--rga-config-file=**\<config-file-path\>
> Max compressed size to cache
>
> Longest byte length (after compression) to store in cache. Longer
> adapter outputs will not be cached and recomputed every time. Allowed
> suffixes: k M G \[default: 2000000\]
**\--rga-max-archive-recursion=**\<max-archive-recursion\> **\--rga-max-archive-recursion=**\<max-archive-recursion\>
> Maximum nestedness of archives to recurse into \[default: 4\] > Maximum nestedness of archives to recurse into \[default: 4\]
**\--rga-cache-max-blob-len=**\<max-blob-len\>
> Max compressed size to cache
>
> Longest byte length (after compression) to store in cache. Longer
> adapter outputs will not be cached and recomputed every time.
>
> Allowed suffixes on command line: k M G \[default: 2000000\]
**\--rga-cache-path=**\<path\>
> Path to store cache db \[default: /home/phire/.cache/ripgrep-all\]
**-h** shows a concise overview, **\--help** shows more detail and **-h** shows a concise overview, **\--help** shows more detail and
advanced options. advanced options.
@ -287,6 +298,7 @@ to debug the adapters.
You can use the provided [`flake.nix`](./flake.nix) to setup all build- and You can use the provided [`flake.nix`](./flake.nix) to setup all build- and
run-time dependencies: run-time dependencies:
1. Enable [Flakes](https://nixos.wiki/wiki/Flakes) in your Nix configuration. 1. Enable [Flakes](https://nixos.wiki/wiki/Flakes) in your Nix configuration.
1. Add [`direnv`](https://direnv.net/) to your profile: 1. Add [`direnv`](https://direnv.net/) to your profile:
`nix profile install nixpkgs#direnv` `nix profile install nixpkgs#direnv`

View File

@ -5,7 +5,7 @@ content=$(
<!-- this part generated by update-readme.sh --> <!-- this part generated by update-readme.sh -->
$(cargo run --bin rga -- --rga-list-adapters) $(cargo run --bin rga -- --rga-list-adapters)
$(help2man -N "cargo run --bin rga --" | pandoc -f man -t markdown --atx-headers | rg --multiline "## USAGE:(.|\n)*") $(help2man -N "cargo run --bin rga --" | pandoc -f man -t markdown --markdown-headings=atx | rg --multiline "## USAGE:(.|\n)*")
<!-- end of part generated by update-readme.sh --> <!-- end of part generated by update-readme.sh -->
END END
) )