tools: doc building fixes

This commit is contained in:
Simon Michael 2010-03-13 00:19:05 +00:00
parent 999697b914
commit df0350a67c

View File

@ -28,8 +28,9 @@ VIEWPS=open
VIEWPDF=open VIEWPDF=open
PRINT=lpr PRINT=lpr
MAIN=hledger.hs
SOURCEFILES:= \ SOURCEFILES:= \
hledger.hs \ $(MAIN) \
[A-Z]*hs \ [A-Z]*hs \
Commands/[A-Z]*hs \ Commands/[A-Z]*hs \
Ledger/[A-Z]*hs Ledger/[A-Z]*hs
@ -300,22 +301,20 @@ site: push
# We munge haddock and hoogle into a rough but useful framed layout. # We munge haddock and hoogle into a rough but useful framed layout.
# For this to work the hoogle cgi must be built with base target "main". # For this to work the hoogle cgi must be built with base target "main".
# XXX move the framed index building into haddock: ? # XXX move the framed index building into haddock: ?
apidocs: haddock #hoogle apidocs: haddock hscolour #hoogle
sed -i -e 's%^></HEAD%><base target="main"></HEAD%' website/api-doc/modules-index.html ; \ sed -i -e 's%^></HEAD%><base target="main"></HEAD%' website/api-doc/modules-index.html ; \
cp website/api-doc-frames.html website/api-doc/index.html ; \ cp website/api-doc-frames.html website/api-doc/index.html ; \
# cp website/hoogle-small.html website/api-doc # cp website/hoogle-small.html website/api-doc
# generate and view the api docs # generate and view the api docs
viewapidocs: api-docs viewapidocs: apidocs
$(VIEWHTMLCMD) website/api-doc/index.html $(VIEWHTMLCMD) website/api-doc/index.html
MAIN=hledger.hs
# generate code documentation with haddock # generate code documentation with haddock
# --ignore-all-exports means we are documenting internal implementation, not library api # --ignore-all-exports means we are documenting internal implementation, not library api
HADDOCK=haddock -B `ghc --print-libdir` --no-warnings --ignore-all-exports $(subst -D,--optghc=-D,$(DEFINEFLAGS)) HADDOCK=haddock -B `ghc --print-libdir` $(subst -D,--optghc=-D,$(DEFINEFLAGS)) --ignore-all-exports --no-warnings
haddock: hscolour $(MAIN) haddock:
$(HADDOCK) -o website/api-doc -h --source-module=src-%{MODULE/./-}.html --source-entity=src-%{MODULE/./-}.html#%N $(filter-out %api-doc-dir hscolour,$^) && \ $(HADDOCK) -o website/api-doc -h --source-module=src-%{MODULE/./-}.html --source-entity=src-%{MODULE/./-}.html#%N $(MAIN) && \
cp website/api-doc/index.html website/api-doc/modules-index.html cp website/api-doc/index.html website/api-doc/modules-index.html
HSCOLOUR=HsColour -css HSCOLOUR=HsColour -css
@ -344,8 +343,8 @@ hoogle: hoogleindex
fi fi
#generate a hoogle index #generate a hoogle index
hoogleindex: $(MAIN) hoogleindex:
$(HADDOCK) -o website/api-doc --hoogle $^ && \ $(HADDOCK) -o website/api-doc --hoogle $(MAIN) && \
cd website/api-doc && \ cd website/api-doc && \
hoogle --convert=main.txt --output=default.hoo hoogle --convert=main.txt --output=default.hoo