From the Hackage check/upload page:
Checking a Cabal package
Re-uploading a package with the same version number is not permitted, so you might want to do some checking before uploading:
- You could check that your source bundle builds, including the haddock documentation if it's a library.
- The following form checks that a package is uploadable, warns about sundry other matters, and presents a preview of the web page for the package. It does not add the package to the database.
(my emphasis)
How do I generate a preview of the web page for the package locally? i.e. without using that website form?
(The "web page for the package" is e.g. this is QuickCheck's.)
To create a new project using Cabal, you should first be in a specific directory set aside for the project. Then you can use cabal init -n to create a project. This will auto-generate a . cabal file for you with defaults in all the metadata fields.
Using Cabal By default stack installs packages to ~/. cabal and ~/. ghc in your home directory.
You use cabal haddock
to generate this page. This will generate the documentation in dist/doc/html/<library-or-executable-name>/index.html
.
Additionally, you can edit your ~/.cabal/config
file to include the line:
documentation: True
This will automatically install documentation for all of the packages you install with Cabal, and you will get a list of all installed modules on the system in the ~/.cabal/share/doc/index.html
file; this is useful for ghci
sessions or when you want to find out which package contains which modules, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With