Skip to content

Commit

Permalink
Merge pull request #287785 from chewblacka/fix-docfd
Browse files Browse the repository at this point in the history
docfd: add fzf support
  • Loading branch information
NickCao authored Feb 11, 2024
2 parents ebddbb7 + 7786bf7 commit 4a97fef
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions pkgs/by-name/do/docfd/package.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, ocamlPackages, fetchFromGitHub, python3, dune_3, makeWrapper, poppler_utils }:
{ lib, ocamlPackages, fetchFromGitHub, python3, dune_3, makeWrapper, poppler_utils, fzf }:

ocamlPackages.buildDunePackage rec {
pname = "docfd";
Expand All @@ -14,26 +14,23 @@ ocamlPackages.buildDunePackage rec {
};

nativeBuildInputs = [ python3 dune_3 makeWrapper ];
buildInputs = [ poppler_utils ] ++
(with ocamlPackages; [ oseq spelll notty nottui lwd cmdliner domainslib digestif yojson eio_main containers-data timedesc ]);
buildInputs = with ocamlPackages; [ oseq spelll notty nottui lwd cmdliner domainslib digestif yojson eio_main containers-data timedesc ];

postInstall = ''
# docfd needs pdftotext from popler_utils to allow pdf search
wrapProgram $out/bin/docfd --prefix PATH : "${lib.getBin poppler_utils}/bin/"
# also fzf for "docfd ?" usage
wrapProgram $out/bin/docfd --prefix PATH : "${lib.makeBinPath [ poppler_utils fzf ]}"
'';

meta = with lib; {
description = "TUI multiline fuzzy document finder";
longDescription = ''
Interactive grep, but word/token/phrase based rather than regex
and line based, so you can search across multiple lines (simlar to
Recoll but TUI).
Aims to provide a good UX via text editor and PDF viewer integration.
When opening a text file, Docfd opens file at first line of search
result. If PDF, then Docfd opens file at first page of the search
result and starts a text search of the most unique word of the matched
phrase within the same page.
Main intended use case: navigating directories of notes and PDFs.
TUI multiline fuzzy document finder.
Think interactive grep for both text files and PDFs, but word/token based
instead of regex and line based, so you can search across lines easily.
Docfd aims to provide good UX via integration with common text editors
and PDF viewers, so you can jump directly to a search result with a
single key press.
'';
homepage = "https://github.com/darrenldl/docfd";
license = licenses.mit;
Expand Down

0 comments on commit 4a97fef

Please sign in to comment.