[Haskell-cafe] access programs own documentation

Roman Cheplyaka roma at ro-che.info
Sun Jan 12 21:46:32 UTC 2014


Except Nomyx is a pure executable[1] and thus won't have a ghc package db entry.

[1]: http://hackage.haskell.org/package/Nomyx-0.4.1/Nomyx.cabal

* adam vogt <vogt.adam at gmail.com> [2014-01-12 14:45:48-0500]
> Hi Corentin,
> 
> One way is to call `ghc-pkg describe Nomyx-0.4.1` and look for the
> line starting with haddock-html. Or maybe look at how ghc-pkg does it
> <https://github.com/ghc/ghc/blob/master/utils/ghc-pkg/Main.hs>.
> 
> This can fail sometimes (though perhaps not for documentation), since
> you can have multiple packages with the same name and version
> installed, and I don't know how you can get the ABI hash of a
> dependency into a program.
> 
> Regards,
> Adam
> 
> 
> 
> On Sun, Jan 12, 2014 at 1:11 PM, Corentin Dupont
> <corentin.dupont at gmail.com> wrote:
> > Hi guys,
> > I'd like to access, from within my program, the program own haddock
> > documentation.
> > From the cabal autogen path file, I can access the location of the program's
> > data file, binaries etc. (getBinDir, getLibDir, getDataDir) but not the
> > location of the doc. How to do that?
> > For example on my machine:
> >
> > datadir    = "/home/kau/.cabal/share/i386-linux-ghc-7.6.3/Nomyx-0.4.1"
> >
> > The documentation is generated in
> > "/home/kau/.cabal/share/doc/i386-linux-ghc-7.6.3/Nomyx-0.4.1", but it
> > depends on the configuration.
> >
> > Thanks,
> > Corentin
> >
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140112/8f3fa535/attachment.sig>


More information about the Haskell-Cafe mailing list