ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
753 stars 137 forks source link

Locally index a package.txt hoogle file after generating #329

Open cah6 opened 5 years ago

cah6 commented 5 years ago

Hey there! My question is whether it's possible to either:

My situation is that we would like a local hoogle with project dependencies docs but also the project's docs themselves. We use nix for dependencies, so that once in the shell, docs are available via ghc-pkg for all the dependencies, but not the project itself. I can fairly easily generate the docs for the project itself via cabal new-haddock --haddock--hoogle, but I'm not sure how to get that file into the hoogle database once it's made. If http://hackage.haskell.org/api is also the API for a local hoogle db it seem likes some variation of curl -XPOST localhost:8080/packages -H 'Accept: text/plain' -F package=@/path/to/file should work but nothing I've tried makes it accept it (usually it returns "File not found"). Is there a way to do something like this?

ndmitchell commented 5 years ago

The design of Hoogle was that was meant to be possible, but every time I started to come up with a design for this piece, it rapidly got into its own little language and I gave up. It's probably not too hard to add, but probably requires some hacking.

Is the question about the API endpoint the same question or a different one? Not sure I understand that bit?

cah6 commented 5 years ago

Ah darn, okay. That question was regarding the same issue, I thought the /packages API might allow doing this sort of single package upload and that I was just using it wrong or something.

ndmitchell commented 5 years ago

The API endpoints on the web server are read only - they have no impact on the database.