From e0e88d3c43135b90bec0bc6dd7c5be79982b6d87 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 22 Nov 2021 17:42:52 +0100 Subject: [PATCH] Point to reference documentation on Hackage Fixes #846 --- Makefile | 9 --------- web/reference.markdown | 5 +---- web/site.hs | 30 ------------------------------ web/templates/default.html | 2 +- 4 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 3571b0590..000000000 --- a/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -PACKAGE="$(shell stack ls dependencies --separator='-' | grep hakyll)" -LOCAL_DOC_ROOT="$(shell stack path --local-doc-root)" - -# Generate the docs and copy them to the website dir -haddock: - stack build --haddock --no-haddock-deps - rsync -r "$(LOCAL_DOC_ROOT)/$(PACKAGE)/" web/reference/ - -.PHONY: haddock diff --git a/web/reference.markdown b/web/reference.markdown index 450f493cf..b0b2e61e7 100644 --- a/web/reference.markdown +++ b/web/reference.markdown @@ -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). diff --git a/web/site.hs b/web/site.hs index dc86b695f..0c29b3947 100644 --- a/web/site.hs +++ b/web/site.hs @@ -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" @@ -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 diff --git a/web/templates/default.html b/web/templates/default.html index 866965a4b..a5e483092 100644 --- a/web/templates/default.html +++ b/web/templates/default.html @@ -30,7 +30,7 @@

Navigation

home tutorials libraries - reference + reference about faq examples