[commit: haddock] ghc-head, master, wip/revert-ttg-2017-11-20, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13: Add QuickJump version to meta.json (#696) (aca68f6)

git at git.haskell.org git at git.haskell.org
Mon Nov 20 21:11:40 UTC 2017


Repository : ssh://git@git.haskell.org/haddock

On branches: ghc-head,master,wip/revert-ttg-2017-11-20,wip/ttg-2017-11-06,wip/ttg2-2017-11-10,wip/ttg3-2017-11-12,wip/ttg4-constraints-2017-11-13
Link       : http://git.haskell.org/haddock.git/commitdiff/aca68f620beb07f9bdebdf52948c6ea670be4980

>---------------------------------------------------------------

commit aca68f620beb07f9bdebdf52948c6ea670be4980
Author: Alexander Biehl <alexbiehl at gmail.com>
Date:   Mon Oct 30 08:45:51 2017 +0100

    Add QuickJump version to meta.json (#696)


>---------------------------------------------------------------

aca68f620beb07f9bdebdf52948c6ea670be4980
 haddock-api/haddock-api.cabal                        |  2 +-
 haddock-api/src/Haddock.hs                           |  2 +-
 haddock-api/src/Haddock/Backends/{ => Xhtml}/Meta.hs | 10 ++++++++--
 haddock.cabal                                        |  2 +-
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal
index 5ce35b9..9b580a5 100644
--- a/haddock-api/haddock-api.cabal
+++ b/haddock-api/haddock-api.cabal
@@ -86,12 +86,12 @@ library
     Haddock.Backends.Xhtml.Decl
     Haddock.Backends.Xhtml.DocMarkup
     Haddock.Backends.Xhtml.Layout
+    Haddock.Backends.Xhtml.Meta
     Haddock.Backends.Xhtml.Names
     Haddock.Backends.Xhtml.Themes
     Haddock.Backends.Xhtml.Types
     Haddock.Backends.Xhtml.Utils
     Haddock.Backends.LaTeX
-    Haddock.Backends.Meta
     Haddock.Backends.HaddockDB
     Haddock.Backends.Hoogle
     Haddock.Backends.Hyperlinker
diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs
index 1795106..a46e58b 100644
--- a/haddock-api/src/Haddock.hs
+++ b/haddock-api/src/Haddock.hs
@@ -27,9 +27,9 @@ module Haddock (
 
 import Data.Version
 import Haddock.Backends.Xhtml
+import Haddock.Backends.Xhtml.Meta
 import Haddock.Backends.Xhtml.Themes (getThemes)
 import Haddock.Backends.LaTeX
-import Haddock.Backends.Meta
 import Haddock.Backends.Hoogle
 import Haddock.Backends.Hyperlinker
 import Haddock.Interface
diff --git a/haddock-api/src/Haddock/Backends/Meta.hs b/haddock-api/src/Haddock/Backends/Xhtml/Meta.hs
similarity index 61%
rename from haddock-api/src/Haddock/Backends/Meta.hs
rename to haddock-api/src/Haddock/Backends/Xhtml/Meta.hs
index c62c1ae..5cf03ec 100644
--- a/haddock-api/src/Haddock/Backends/Meta.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Meta.hs
@@ -1,4 +1,4 @@
-module Haddock.Backends.Meta where
+module Haddock.Backends.Xhtml.Meta where
 
 import Haddock.Utils.Json
 import Haddock.Version
@@ -7,6 +7,11 @@ import Data.ByteString.Builder (hPutBuilder)
 import System.FilePath ((</>))
 import System.IO (withFile, IOMode (WriteMode))
 
+-- | Everytime breaking changes to the Quckjump api
+-- happen this needs to be modified.
+quickjumpVersion :: Int
+quickjumpVersion = 1
+
 -- | Writes a json encoded file containing additional
 -- information about the generated documentation. This
 -- is useful for external tools (e.g. hackage).
@@ -15,7 +20,8 @@ writeHaddockMeta odir = do
   let
     meta_json :: Value
     meta_json = object [
-        "haddock_version" .= String projectVersion
+        "haddock_version"   .= String projectVersion
+      , "quickjump_version" .= quickjumpVersion
       ]
 
   withFile (odir </> "meta.json") WriteMode $ \h ->
diff --git a/haddock.cabal b/haddock.cabal
index 51f7127..40ccb55 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -120,12 +120,12 @@ executable haddock
       Haddock.Backends.Xhtml.Decl
       Haddock.Backends.Xhtml.DocMarkup
       Haddock.Backends.Xhtml.Layout
+      Haddock.Backends.Xhtml.Meta
       Haddock.Backends.Xhtml.Names
       Haddock.Backends.Xhtml.Themes
       Haddock.Backends.Xhtml.Types
       Haddock.Backends.Xhtml.Utils
       Haddock.Backends.LaTeX
-      Haddock.Backends.Meta
       Haddock.Backends.HaddockDB
       Haddock.Backends.Hoogle
       Haddock.Backends.Hyperlinker



More information about the ghc-commits mailing list