Aim: document a repo with plutus code using haddock.
Problem: Naively running cabal haddock
has a problem that seems to be caused by plutus (on-chain) code.
For example, plutus-pioneer-program week03 runs in the repl with cabal repl
, but cabal haddock
errors as follows.
Haddock coverage:
GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a builtin, or an external INLINABLE function: Variable Ledger.Typed.Scripts.Validators.wrapValidator
No unfolding
Context: Compiling expr: Ledger.Typed.Scripts.Validators.wrapValidator
Context: Compiling expr: Ledger.Typed.Scripts.Validators.wrapValidator
@ Week03.Homework1.VestingDatum
Context: Compiling expr: Ledger.Typed.Scripts.Validators.wrapValidator
@ Week03.Homework1.VestingDatum @ ()
Context: Compiling expr: Ledger.Typed.Scripts.Validators.wrapValidator
@ Week03.Homework1.VestingDatum
@ ()
Week03.Homework1.$fUnsafeFromDataVestingDatum
Context: Compiling expr: Ledger.Typed.Scripts.Validators.wrapValidator
@ Week03.Homework1.VestingDatum
@ ()
Week03.Homework1.$fUnsafeFromDataVestingDatum
PlutusTx.IsData.Instances.$fUnsafeFromData()
Context: Compiling expr at "plutus-pioneer-program-week03-0.1.0.0-inplace:Week03.Homework1:(60,8)-(60,37)"
cabal: Failed to build documentation for
plutus-pioneer-program-week03-0.1.0.0.
Is there a straightforward way to build haddock docs for repos with plutus code?