Skip to content

Instantly share code, notes, and snippets.

@MarcoSero
Created December 9, 2014 15:02
Show Gist options
  • Save MarcoSero/72ccc9e92a1eccdfbac1 to your computer and use it in GitHub Desktop.
Save MarcoSero/72ccc9e92a1eccdfbac1 to your computer and use it in GitHub Desktop.
Convert all Cabal documentation to a Dash docset
#!/bin/zsh
arch=x86_64
os=osx
kernel=darwin
compiler=ghc
version=7.8.3
user=~/.ghc/$arch-$kernel-$version/package.conf.d
target=myhaskell.docset
dash_path="~/Library/Application Support/Dash/DocSets/Haskell/"
rm -rf $target
echo "Genereting docset from global libraries..."
haddocset -t $target create
echo "Genereting doc from user libraries..."
for pkg in $user/*.conf ; do haddocset -t $target add $pkg ; done
echo "Copying new docset into Dash"
mv -R $target $dash_path
echo "Now you can restart Dash and rescan the docsets"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment