aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Hengel <sol@typeful.net>2014-08-22 12:14:16 +0800
committerSimon Hengel <sol@typeful.net>2014-08-22 12:14:16 +0800
commite99252026ad1b50215b86ffe30038351ca486bfa (patch)
treed0a88fd913edd590fefb952d635871f11afda41b
parent2c3f2b47fa5e66f5503b5418415e2fa75d134689 (diff)
Move Haddock API to a separate package
-rw-r--r--.gitignore3
-rw-r--r--.travis.yml1
-rw-r--r--LICENSE4
-rw-r--r--haddock-api/LICENSE23
-rwxr-xr-xhaddock-api/Setup.lhs3
-rw-r--r--haddock-api/haddock-api.cabal94
-rw-r--r--haddock-api/resources/html/Classic.theme/haskell_icon.gif (renamed from resources/html/Classic.theme/haskell_icon.gif)bin911 -> 911 bytes
-rw-r--r--haddock-api/resources/html/Classic.theme/minus.gif (renamed from resources/html/Classic.theme/minus.gif)bin56 -> 56 bytes
-rw-r--r--haddock-api/resources/html/Classic.theme/plus.gif (renamed from resources/html/Classic.theme/plus.gif)bin59 -> 59 bytes
-rw-r--r--haddock-api/resources/html/Classic.theme/xhaddock.css (renamed from resources/html/Classic.theme/xhaddock.css)0
-rw-r--r--haddock-api/resources/html/Ocean.std-theme/hslogo-16.png (renamed from resources/html/Ocean.std-theme/hslogo-16.png)bin1684 -> 1684 bytes
-rw-r--r--haddock-api/resources/html/Ocean.std-theme/minus.gif (renamed from resources/html/Ocean.std-theme/minus.gif)bin56 -> 56 bytes
-rw-r--r--haddock-api/resources/html/Ocean.std-theme/ocean.css (renamed from resources/html/Ocean.std-theme/ocean.css)0
-rw-r--r--haddock-api/resources/html/Ocean.std-theme/plus.gif (renamed from resources/html/Ocean.std-theme/plus.gif)bin59 -> 59 bytes
-rw-r--r--haddock-api/resources/html/Ocean.std-theme/synopsis.png (renamed from resources/html/Ocean.std-theme/synopsis.png)bin11327 -> 11327 bytes
-rw-r--r--haddock-api/resources/html/frames.html (renamed from resources/html/frames.html)0
-rw-r--r--haddock-api/resources/html/haddock-util.js (renamed from resources/html/haddock-util.js)0
-rw-r--r--haddock-api/resources/latex/haddock.sty (renamed from resources/latex/haddock.sty)0
l---------haddock-api/src1
-rw-r--r--haddock.cabal116
-rw-r--r--src/Haddock.hs3
-rw-r--r--src/Haddock/Version.hs9
22 files changed, 138 insertions, 119 deletions
diff --git a/.gitignore b/.gitignore
index d3ca28b8..6b8d26e0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
/dist/
-/haddock-library/dist
+/haddock-api/dist/
+/haddock-library/dist/
/html-test/out/
/latex-test/out/
diff --git a/.travis.yml b/.travis.yml
index 338d394d..98720920 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,6 +15,7 @@ before_install:
- doctest -isrc -i$(echo vendor/attoparsec-*) -optP-include -optPdist/build/autogen/cabal_macros.h src/Documentation/Haddock/Parser.hs
- cabal install
- cd ..
+ - (cd haddock-api/ && cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test && cabal install)
script:
- cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test
diff --git a/LICENSE b/LICENSE
index 1636bfcd..460decfc 100644
--- a/LICENSE
+++ b/LICENSE
@@ -5,11 +5,11 @@ modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
diff --git a/haddock-api/LICENSE b/haddock-api/LICENSE
new file mode 100644
index 00000000..460decfc
--- /dev/null
+++ b/haddock-api/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2002-2010, Simon Marlow. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/haddock-api/Setup.lhs b/haddock-api/Setup.lhs
new file mode 100755
index 00000000..5bde0de9
--- /dev/null
+++ b/haddock-api/Setup.lhs
@@ -0,0 +1,3 @@
+#!/usr/bin/env runhaskell
+> import Distribution.Simple
+> main = defaultMain
diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal
new file mode 100644
index 00000000..c40edb14
--- /dev/null
+++ b/haddock-api/haddock-api.cabal
@@ -0,0 +1,94 @@
+name: haddock-api
+version: 2.14.4
+synopsis: A documentation-generation tool for Haskell libraries
+description: Haddock is a documentation-generation tool for Haskell
+ libraries
+license: BSD3
+license-file: LICENSE
+author: Simon Marlow, David Waern
+maintainer: Simon Hengel <sol@typeful.net>, Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>
+homepage: http://www.haskell.org/haddock/
+bug-reports: https://github.com/haskell/haddock/issues
+copyright: (c) Simon Marlow, David Waern
+category: Documentation
+build-type: Simple
+cabal-version: >= 1.10
+stability: experimental
+
+data-dir:
+ resources
+data-files:
+ html/frames.html
+ html/haddock-util.js
+ html/Classic.theme/haskell_icon.gif
+ html/Classic.theme/minus.gif
+ html/Classic.theme/plus.gif
+ html/Classic.theme/xhaddock.css
+ html/Ocean.std-theme/hslogo-16.png
+ html/Ocean.std-theme/minus.gif
+ html/Ocean.std-theme/ocean.css
+ html/Ocean.std-theme/plus.gif
+ html/Ocean.std-theme/synopsis.png
+ latex/haddock.sty
+
+library
+ default-language:
+ Haskell2010
+
+ build-depends:
+ base >= 4.3 && < 4.8
+ , bytestring
+ , filepath
+ , directory
+ , containers
+ , deepseq
+ , array
+ , xhtml >= 3000.2 && < 3000.3
+ , Cabal >= 1.10
+ , ghc == 7.8.3
+
+ , ghc-paths
+ , haddock-library
+
+ hs-source-dirs:
+ src
+
+ ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2
+
+ exposed-modules:
+ Documentation.Haddock
+
+ other-modules:
+ Haddock
+ Haddock.Interface
+ Haddock.Interface.Rename
+ Haddock.Interface.Create
+ Haddock.Interface.AttachInstances
+ Haddock.Interface.LexParseRn
+ Haddock.Interface.ParseModuleHeader
+ Haddock.Parser
+ Haddock.Utils
+ Haddock.Backends.Xhtml
+ Haddock.Backends.Xhtml.Decl
+ Haddock.Backends.Xhtml.DocMarkup
+ Haddock.Backends.Xhtml.Layout
+ Haddock.Backends.Xhtml.Names
+ Haddock.Backends.Xhtml.Themes
+ Haddock.Backends.Xhtml.Types
+ Haddock.Backends.Xhtml.Utils
+ Haddock.Backends.LaTeX
+ Haddock.Backends.HaddockDB
+ Haddock.Backends.Hoogle
+ Haddock.ModuleTree
+ Haddock.Types
+ Haddock.Doc
+ Haddock.Version
+ Haddock.InterfaceFile
+ Haddock.Options
+ Haddock.GhcUtils
+ Haddock.Convert
+ Paths_haddock_api
+
+source-repository head
+ type: git
+ location: https://github.com/haskell/haddock.git
diff --git a/resources/html/Classic.theme/haskell_icon.gif b/haddock-api/resources/html/Classic.theme/haskell_icon.gif
index 10589f91..10589f91 100644
--- a/resources/html/Classic.theme/haskell_icon.gif
+++ b/haddock-api/resources/html/Classic.theme/haskell_icon.gif
Binary files differ
diff --git a/resources/html/Classic.theme/minus.gif b/haddock-api/resources/html/Classic.theme/minus.gif
index 1deac2fe..1deac2fe 100644
--- a/resources/html/Classic.theme/minus.gif
+++ b/haddock-api/resources/html/Classic.theme/minus.gif
Binary files differ
diff --git a/resources/html/Classic.theme/plus.gif b/haddock-api/resources/html/Classic.theme/plus.gif
index 2d15c141..2d15c141 100644
--- a/resources/html/Classic.theme/plus.gif
+++ b/haddock-api/resources/html/Classic.theme/plus.gif
Binary files differ
diff --git a/resources/html/Classic.theme/xhaddock.css b/haddock-api/resources/html/Classic.theme/xhaddock.css
index ed231b5a..ed231b5a 100644
--- a/resources/html/Classic.theme/xhaddock.css
+++ b/haddock-api/resources/html/Classic.theme/xhaddock.css
diff --git a/resources/html/Ocean.std-theme/hslogo-16.png b/haddock-api/resources/html/Ocean.std-theme/hslogo-16.png
index 0ff8579f..0ff8579f 100644
--- a/resources/html/Ocean.std-theme/hslogo-16.png
+++ b/haddock-api/resources/html/Ocean.std-theme/hslogo-16.png
Binary files differ
diff --git a/resources/html/Ocean.std-theme/minus.gif b/haddock-api/resources/html/Ocean.std-theme/minus.gif
index 1deac2fe..1deac2fe 100644
--- a/resources/html/Ocean.std-theme/minus.gif
+++ b/haddock-api/resources/html/Ocean.std-theme/minus.gif
Binary files differ
diff --git a/resources/html/Ocean.std-theme/ocean.css b/haddock-api/resources/html/Ocean.std-theme/ocean.css
index de436324..de436324 100644
--- a/resources/html/Ocean.std-theme/ocean.css
+++ b/haddock-api/resources/html/Ocean.std-theme/ocean.css
diff --git a/resources/html/Ocean.std-theme/plus.gif b/haddock-api/resources/html/Ocean.std-theme/plus.gif
index 2d15c141..2d15c141 100644
--- a/resources/html/Ocean.std-theme/plus.gif
+++ b/haddock-api/resources/html/Ocean.std-theme/plus.gif
Binary files differ
diff --git a/resources/html/Ocean.std-theme/synopsis.png b/haddock-api/resources/html/Ocean.std-theme/synopsis.png
index 85fb86ec..85fb86ec 100644
--- a/resources/html/Ocean.std-theme/synopsis.png
+++ b/haddock-api/resources/html/Ocean.std-theme/synopsis.png
Binary files differ
diff --git a/resources/html/frames.html b/haddock-api/resources/html/frames.html
index 1b4e38d4..1b4e38d4 100644
--- a/resources/html/frames.html
+++ b/haddock-api/resources/html/frames.html
diff --git a/resources/html/haddock-util.js b/haddock-api/resources/html/haddock-util.js
index 9a6fccf7..9a6fccf7 100644
--- a/resources/html/haddock-util.js
+++ b/haddock-api/resources/html/haddock-util.js
diff --git a/resources/latex/haddock.sty b/haddock-api/resources/latex/haddock.sty
index 6e031a98..6e031a98 100644
--- a/resources/latex/haddock.sty
+++ b/haddock-api/resources/latex/haddock.sty
diff --git a/haddock-api/src b/haddock-api/src
new file mode 120000
index 00000000..e057607e
--- /dev/null
+++ b/haddock-api/src
@@ -0,0 +1 @@
+../src/ \ No newline at end of file
diff --git a/haddock.cabal b/haddock.cabal
index 7e3fa0e2..57f6d15c 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -35,45 +35,21 @@ extra-source-files:
latex-test/ref/Simple/*.tex
latex-test/ref/Simple/*.sty
-data-dir: resources
-data-files: html/frames.html
- html/haddock-util.js
- html/Classic.theme/haskell_icon.gif
- html/Classic.theme/minus.gif
- html/Classic.theme/plus.gif
- html/Classic.theme/xhaddock.css
- html/Ocean.std-theme/hslogo-16.png
- html/Ocean.std-theme/minus.gif
- html/Ocean.std-theme/ocean.css
- html/Ocean.std-theme/plus.gif
- html/Ocean.std-theme/synopsis.png
- latex/haddock.sty
-
flag in-ghc-tree
description: Are we in a GHC tree?
default: False
manual: True
--- Using this disables -O2, and hence allows to use --disable-optimization,
--- which is about twice as fast. This should probably be the default, but we
--- need some benchmarks first..
-flag dev
- default: False
- manual: True
-
executable haddock
default-language: Haskell2010
main-is: Main.hs
hs-source-dirs: driver
- if flag(dev)
- ghc-options: -funbox-strict-fields -Wall -fwarn-tabs
- else
- ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2
+ ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2
build-depends:
base >= 4.3 && < 4.8
if flag(in-ghc-tree)
- hs-source-dirs: src, haddock-library/vendor/attoparsec-0.12.1.1, haddock-library/src
+ hs-source-dirs: haddock-api/src, haddock-library/vendor/attoparsec-0.12.1.1, haddock-library/src
cpp-options: -DIN_GHC_TREE
build-depends:
filepath,
@@ -134,93 +110,7 @@ executable haddock
Haddock.GhcUtils
Haddock.Convert
else
- build-depends: haddock, haddock-library
-
-library
- default-language: Haskell2010
-
- build-depends:
- base >= 4.3 && < 4.8,
- bytestring,
- filepath,
- directory,
- containers,
- deepseq,
- array,
- xhtml >= 3000.2 && < 3000.3,
- Cabal >= 1.10,
- ghc == 7.8.3
-
- if flag(in-ghc-tree)
- cpp-options: -DIN_GHC_TREE
- hs-source-dirs: src, haddock-library/vendor/attoparsec-0.12.1.1, haddock-library/src
-
- exposed-modules:
- Documentation.Haddock.Parser
- Documentation.Haddock.Types
- Documentation.Haddock.Doc
-
- other-modules:
- Data.Attoparsec
- Data.Attoparsec.ByteString
- Data.Attoparsec.ByteString.Buffer
- Data.Attoparsec.ByteString.Char8
- Data.Attoparsec.ByteString.FastSet
- Data.Attoparsec.ByteString.Internal
- Data.Attoparsec.Combinator
- Data.Attoparsec.Internal
- Data.Attoparsec.Internal.Fhthagn
- Data.Attoparsec.Internal.Types
- Data.Attoparsec.Number
- Documentation.Haddock.Utf8
- Documentation.Haddock.Parser.Util
-
- else
- build-depends: ghc-paths, haddock-library
- hs-source-dirs: src
-
-
- if flag(dev)
- ghc-options: -funbox-strict-fields -Wall -fwarn-tabs
- else
- ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2
-
- exposed-modules:
- Documentation.Haddock
-
- other-modules:
- Haddock
- Haddock.Interface
- Haddock.Interface.Rename
- Haddock.Interface.Create
- Haddock.Interface.AttachInstances
- Haddock.Interface.LexParseRn
- Haddock.Interface.ParseModuleHeader
- Haddock.Parser
- Haddock.Utils
- Haddock.Backends.Xhtml
- Haddock.Backends.Xhtml.Decl
- Haddock.Backends.Xhtml.DocMarkup
- Haddock.Backends.Xhtml.Layout
- Haddock.Backends.Xhtml.Names
- Haddock.Backends.Xhtml.Themes
- Haddock.Backends.Xhtml.Types
- Haddock.Backends.Xhtml.Utils
- Haddock.Backends.LaTeX
- Haddock.Backends.HaddockDB
- Haddock.Backends.Hoogle
- Haddock.ModuleTree
- Haddock.Types
- Haddock.Doc
- Haddock.Version
- Haddock.InterfaceFile
- Haddock.Options
- Haddock.GhcUtils
- Haddock.Convert
- Paths_haddock
-
- if flag(in-ghc-tree)
- buildable: False
+ build-depends: haddock-api, haddock-library
test-suite html-test
type: exitcode-stdio-1.0
diff --git a/src/Haddock.hs b/src/Haddock.hs
index 3d049b18..ad78c50d 100644
--- a/src/Haddock.hs
+++ b/src/Haddock.hs
@@ -19,7 +19,6 @@
-----------------------------------------------------------------------------
module Haddock (haddock, readPackagesAndProcessModules, withGhc') where
-
import Haddock.Backends.Xhtml
import Haddock.Backends.Xhtml.Themes (getThemes)
import Haddock.Backends.LaTeX
@@ -54,7 +53,7 @@ import Data.Int
import System.FilePath
#else
import qualified GHC.Paths as GhcPaths
-import Paths_haddock
+import Paths_haddock_api (getDataDir)
#endif
import GHC hiding (verbosity)
diff --git a/src/Haddock/Version.hs b/src/Haddock/Version.hs
index f4729c7d..2ef3a257 100644
--- a/src/Haddock/Version.hs
+++ b/src/Haddock/Version.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Version
@@ -12,11 +13,17 @@ module Haddock.Version (
projectName, projectVersion, projectUrl
) where
+#ifdef IN_GHC_TREE
import Paths_haddock ( version )
+#else
+import Paths_haddock_api ( version )
+#endif
import Data.Version ( showVersion )
-projectName, projectUrl :: String
+projectName :: String
projectName = "Haddock"
+
+projectUrl :: String
projectUrl = "http://www.haskell.org/haddock/"
projectVersion :: String