Skip to content

Instantly share code, notes, and snippets.

@erantapaa
Last active October 26, 2015 02:16
Show Gist options
  • Save erantapaa/987d44dca7ee2e919dae to your computer and use it in GitHub Desktop.
Save erantapaa/987d44dca7ee2e919dae to your computer and use it in GitHub Desktop.
build a Dash docset for the GHC API

Instructions for building a Dash docset for the GHC API (for ghc 7.10.2)

The ghc module is hidden by default, so it's not included in any of the Haskell docsets I could find. Here is a recipe for building a docset which contains just ghc-7.10.2.

  1. Build https://github.com/philopon/haddocset
  2. In a work directory, copy the null-ghc-pkg script
  3. Make the null-ghc-pkg script executable
  4. Find the location of the ghc package conf file. If you have installed the Haskell Platform it will reside in
/Library/Frameworks/GHC.framework/Versions/7.10.2-x86_64/usr/lib/ghc-7.10.2/package.conf.d/ghc-7.10.2-XXXXXX.conf
  1. Copy the build-ghc-docset script and edit in the location of the ghc package conf file.
  2. Expose the ghc-7.10.2 package with: ghc-pkg expose ghc-7.10.2. This may require sudo acess.
  3. Run the build-ghc-docset script.
  4. Re-hide the ghc-7.10.2 package with: ghc-pkg hide ghc-7.10.2.
  5. The docset resides in the directory ghc-7.10.2.docset. Double click it to load it into Dash.
#!/bin/sh
GHC_PKG_CONF="...path to the ghc-7.10.2-XXXXXXX.conf file..."
haddocset -t ghc-7.10.2 --hc-pkg ./null-ghc-pkg \
create --CFBundleName "GHC 7.10.2 API" --CFBundleIdentifier "ghc-7.10.2" "$GHC_PKG_CONF"
#!/bin/sh
mkdir -p /tmp/asd/qwe
echo "/tmp/asd/qwe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment