From 0f181c4a70ef5e4753545cd9e0734a015bb815e1 Mon Sep 17 00:00:00 2001 From: Alexander Biehl Date: Mon, 30 Oct 2017 10:15:49 +0100 Subject: Put Quickjump behind --quickjump flag (#697) --- haddock-api/src/Haddock/Backends/Xhtml/Meta.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'haddock-api/src/Haddock/Backends/Xhtml') diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Meta.hs b/haddock-api/src/Haddock/Backends/Xhtml/Meta.hs index 5cf03ec4..621bdd41 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Meta.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Meta.hs @@ -15,14 +15,14 @@ quickjumpVersion = 1 -- | Writes a json encoded file containing additional -- information about the generated documentation. This -- is useful for external tools (e.g. hackage). -writeHaddockMeta :: FilePath -> IO () -writeHaddockMeta odir = do +writeHaddockMeta :: FilePath -> Bool -> IO () +writeHaddockMeta odir withQuickjump = do let meta_json :: Value - meta_json = object [ - "haddock_version" .= String projectVersion - , "quickjump_version" .= quickjumpVersion - ] + meta_json = object (concat [ + [ "haddock_version" .= String projectVersion ] + , [ "quickjump_version" .= quickjumpVersion | withQuickjump ] + ]) withFile (odir "meta.json") WriteMode $ \h -> - hPutBuilder h (encodeToBuilder meta_json) \ No newline at end of file + hPutBuilder h (encodeToBuilder meta_json) -- cgit v1.2.3