Closed kuk0 closed 8 years ago
Yes, it's super confusing, and the lack of a coherent design is one of the things that has stopped me doing it in Hoogle 5 thus far. What is your use case for having a custom default.txt? How was it generated? Maybe that would help illuminate what the design should be.
We get the text files directly by running haddock --hoogle. We have a different build system and don't have cabal integration, so when running hoogle internally, we just convert and combine all the databases. Keeping this low-level api would be nice so that hoogle doesn't rely on/assume one particular technology (in this case, cabal).
the --doc flag for convert is a little weird; it only supports http:// (and not https://) and for files it adds an extra /index.html later, the code for showing the links strips everything from the last slash so if it's a file, we're supposed to put in the directory (since /index.html is added automatically), but for http, we're supposed to put the whole filepath (including index.html?) ... or spend some time tinkering to reverse engineer this and then add an extra slash at the end so nothing is stripped...
test plan:
i would even go on further and remove the
</> "index.html"
but i guess i don't really want to change the behaviour and break other people's stuff... afaik, generating from an individual source text file is not supported yet in hoogle5, so for now i'm fixing it in 4...