Skip to content

Commit

Permalink
Point to reference documentation on Hackage
Browse files Browse the repository at this point in the history
Fixes #846
  • Loading branch information
jaspervdj authored Nov 22, 2021
1 parent f64d6df commit e0e88d3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 44 deletions.
9 changes: 0 additions & 9 deletions Makefile

This file was deleted.

5 changes: 1 addition & 4 deletions web/reference.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ title: Reference

# Reference

We keep a copy of the reference of the latest stable version here. This
reference is automatically generated by
[Haddock](http://www.haskell.org/haddock/). You can
[find it here](reference/index.html).
You can browse the reference documentation [on Hackage](https://hackage.haskell.org/package/hakyll).
30 changes: 0 additions & 30 deletions web/site.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ main = hakyllWith config $ do
route idRoute
compile copyFileCompiler

-- Haddock stuff
match "reference/**.html" $ do
route idRoute
compile $ fmap (withUrls hackage) <$> getResourceString

-- Haddock stuff
match ("reference/**" `mappend` complement "**.html") $ do
route idRoute
compile copyFileCompiler

-- Pages
match "*.markdown" $ do
route $ setExtension "html"
Expand Down Expand Up @@ -86,26 +76,6 @@ config = defaultConfiguration
}


--------------------------------------------------------------------------------
-- | Turns
--
-- > /usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-String.html
--
-- into
--
-- > http://hackage.haskell.org/packages/archive/base/4.6.0.0/doc/html/Data-String.html
hackage :: String -> String
hackage url
| "/usr" `isPrefixOf` url =
"http://hackage.haskell.org/packages/archive/" ++
packageName ++ "/" ++ version' ++ "/doc/html/" ++ baseName
| otherwise = url
where
(packageName, version') = second (drop 1) $ break (== '-') package
(baseName : package : _) = map dropTrailingPathSeparator $
reverse $ splitPath url


--------------------------------------------------------------------------------
-- | Partition tutorials into tutorial series, other articles, external articles
tutorialsCtx :: [Item String] -> Context String
Expand Down
2 changes: 1 addition & 1 deletion web/templates/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h1>Navigation</h1>
<a href="/index.html">home</a>
<a href="/tutorials.html">tutorials</a>
<a href="/libraries.html">libraries</a>
<a href="/reference.html">reference</a>
<a href="https://hackage.haskell.org/package/hakyll" target="_blank">reference</a>
<a href="/about.html">about</a>
<a href="/tutorials/faq.html">faq</a>
<a href="/examples.html">examples</a>
Expand Down

0 comments on commit e0e88d3

Please sign in to comment.