forked from digitallyinduced/ihp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-haddock
executable file
·57 lines (51 loc) · 2.35 KB
/
build-haddock
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Builds the api documentation for all IHP modules
# Output is placed in directory haddock-build
# After building, you can view the api docs with: open haddock-build/index.html
mkdir -p haddock-build
haddock --html -t "IHP Api Reference" --hyperlinked-source --built-in-themes --quickjump -o haddock-build \
$(find IHP -name '*.hs' -not \( -name 'GenericController.hs' \) -not \( -regex '.+CLI/.+.hs' \) | xargs) \
--optghc="-i." \
--optghc="-XOverloadedStrings" \
--optghc="-XNoImplicitPrelude" \
--optghc="-XImplicitParams" \
--optghc="-XRank2Types" \
--optghc="-XDisambiguateRecordFields" \
--optghc="-XNamedFieldPuns" \
--optghc="-XDuplicateRecordFields" \
--optghc="-XOverloadedLabels" \
--optghc="-XFlexibleContexts" \
--optghc="-XTypeSynonymInstances" \
--optghc="-XFlexibleInstances" \
--optghc="-XQuasiQuotes" \
--optghc="-XTypeFamilies" \
--optghc="-XPackageImports" \
--optghc="-XScopedTypeVariables" \
--optghc="-XRecordWildCards" \
--optghc="-XTypeApplications" \
--optghc="-XDataKinds" \
--optghc="-XDeriveGeneric" \
--optghc="-XMultiParamTypeClasses" \
--optghc="-XTypeOperators" \
--optghc="-XDeriveDataTypeable" \
--optghc="-XMultiWayIf" \
--optghc="-XUndecidableInstances" \
--optghc="-XBlockArguments" \
--optghc="-XPartialTypeSignatures" \
--optghc="-XLambdaCase" \
--optghc="-XBangPatterns" \
--optghc="-XInstanceSigs" \
--optghc="-XFunctionalDependencies" \
--optghc="-XDefaultSignatures" \
--optghc="-XStandaloneDeriving" \
--optghc="-XTemplateHaskell" \
--optghc="-XDeepSubsumption" \
--optghc="-XOverloadedRecordDot" \
--optghc="-package-env -"
cd haddock-build
# Add favicon
find . -type f \( -iname "*.html" \) -exec sed -i 's#<head>#<head><link rel="shortcut icon" type="image\/x-icon" href="https:\/\/ihp.digitallyinduced.com\/ihp-logo.svg"\/>#g' '{}' +
# Add ihp-haddock.css
cp ../ihp-haddock.css ihp-haddock.css
find . -type f \( -iname "*.html" \) -exec sed -i 's#<\/head>#<link href="ihp-haddock.css" rel="stylesheet"/><\/head>#g' '{}' +
# Link title to index
find . -type f \( -iname "*.html" \) -exec sed -i 's#<span class=\"caption\">IHP Api Reference</span>#<a href=\"index.html\" class=\"caption\"><img src=\"https://ihp.digitallyinduced.com/Guide/images/ihp-logo-readme.svg\"/>IHP Api Reference</a>#g' '{}' +