haskelldocumentationhaddock

How to embed images in Haddock documentation


How can I embed images within local Haddock documentation?

I see for example the lens package just uses external links to images, but I'd like to store the images locally.

(This question is very similar to an (unanswered) question on the mailing list).


Solution

  • If you want to store your image locally you can:

    -- A longer description of the package.
    description: Some haskell package description.
    
        <<file:///home/user/your_image.png>>
    

    Result:

    Enter image description here

    If you don't want or can't add image by relative path, just put image name without full path:

    <<your_image.png>>

    In this case, your image must be in the project/docs directory.