Haskell offline documentation?

前端 未结 9 1879
一整个雨季
一整个雨季 2021-01-30 01:13

What are the possibilities, if any, for getting offline docs for Haskell core libraries (and maybe more)?

Sometimes I take my laptop to the coffee-shop where there is no

相关标签:
9条回答
  • 2021-01-30 01:44

    If you install the Haskell Platform it includes the GHC docs and the GHC library docs (which cover the core libraries). On Windows they are on the Start Menu under "All Programs|Haskell Platform".

    0 讨论(0)
  • 2021-01-30 01:46

    The HTML documentation can be downloaded as .tar.bz2 from the Haskell website:

    https://downloads.haskell.org/~ghc/latest/docs/

    I just downloaded https://www.haskell.org/ghc/docs/7.6.3/libraries.html.tar.bz2 and it's exactly what I've been hoping for.

    There are also other options, such as Dash and Zeal, and see also that reddit thread.

    0 讨论(0)
  • 2021-01-30 01:48

    Velocity is a free and beautiful universal tool to do just that. It supports a wide range of languages, technologies and libraries, and one click updating.

    You will probably be able to find more of what you are already using in its documentation list.

    0 讨论(0)
  • 2021-01-30 01:53

    For Windows, install cygwin's wget and curl packages. That will enable hoogle data.

    0 讨论(0)
  • 2021-01-30 01:54

    It may not be "canonical" per se, but i believe that the most useful option is a docset software like dash(OS X)/zeal + generated docsets. This way you'll get the search for free and also will have an option to build your custom docsets. It's no problem to get the 'base' package haddock documentation with either of the projects out of the box. You can build custom docsets with haddocset or dash-haskell. Also it integrates nicely with emacs/vim/other editors, allows you to have project-based docsets(you'll have the relevant versions on a per-project basis this way, forget all this hassle with local hoogle!) and don't restrict you to any build flow you can have.

    If you build your project with cabal-install you can set documentation: True in your ~/.cabal/config, then reinstall dependencies to get generated haddocks locally.

    If you're using stack, you can utilize stack haddock command to build your dependencies and project with generated haddocks.

    0 讨论(0)
  • 2021-01-30 01:57

    Edit your ~/.cabal/config file. Look for the line (probably commented out) that says documentation: False. Change that line to documentation: True and uncomment it. Now when you build projects with cabal install documentation will also be built and saved locally.

    Look around a little more in that same config file and you'll find things options like doc-index-file, docdir, datadir, prefix, etc that allow you to configure where the documentation is stored.

    0 讨论(0)
提交回复
热议问题