aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html/Classic.theme/haskell_icon.gif (renamed from html/themes/Classic/haskell_icon.gif)bin911 -> 911 bytes
-rw-r--r--html/Classic.theme/minus.gif (renamed from html/themes/Classic/minus.gif)bin56 -> 56 bytes
-rw-r--r--html/Classic.theme/plus.gif (renamed from html/themes/Classic/plus.gif)bin59 -> 59 bytes
-rw-r--r--html/Classic.theme/xhaddock.css (renamed from html/themes/Classic/xhaddock.css)0
-rw-r--r--html/Ocean.std-theme/hslogo-16.png (renamed from html/themes/Ocean/hslogo-16.png)bin1684 -> 1684 bytes
-rw-r--r--html/Ocean.std-theme/minus.gif (renamed from html/themes/Ocean/minus.gif)bin56 -> 56 bytes
-rw-r--r--html/Ocean.std-theme/ocean.css (renamed from html/themes/Ocean/ocean.css)0
-rw-r--r--html/Ocean.std-theme/plus.gif (renamed from html/themes/Ocean/plus.gif)bin59 -> 59 bytes
-rw-r--r--html/Snappy.theme/minus.gif (renamed from html/themes/Snappy/minus.gif)bin56 -> 56 bytes
-rw-r--r--html/Snappy.theme/plus.gif (renamed from html/themes/Snappy/plus.gif)bin59 -> 59 bytes
-rw-r--r--html/Snappy.theme/s_haskell_icon.gif (renamed from html/themes/Snappy/s_haskell_icon.gif)bin607 -> 607 bytes
-rw-r--r--html/Snappy.theme/snappy.css (renamed from html/themes/Snappy/snappy.css)0
-rw-r--r--src/Haddock/Backends/Xhtml/Themes.hs19
13 files changed, 11 insertions, 8 deletions
diff --git a/html/themes/Classic/haskell_icon.gif b/html/Classic.theme/haskell_icon.gif
index 10589f91..10589f91 100644
--- a/html/themes/Classic/haskell_icon.gif
+++ b/html/Classic.theme/haskell_icon.gif
Binary files differ
diff --git a/html/themes/Classic/minus.gif b/html/Classic.theme/minus.gif
index 1deac2fe..1deac2fe 100644
--- a/html/themes/Classic/minus.gif
+++ b/html/Classic.theme/minus.gif
Binary files differ
diff --git a/html/themes/Classic/plus.gif b/html/Classic.theme/plus.gif
index 2d15c141..2d15c141 100644
--- a/html/themes/Classic/plus.gif
+++ b/html/Classic.theme/plus.gif
Binary files differ
diff --git a/html/themes/Classic/xhaddock.css b/html/Classic.theme/xhaddock.css
index 35f4b469..35f4b469 100644
--- a/html/themes/Classic/xhaddock.css
+++ b/html/Classic.theme/xhaddock.css
diff --git a/html/themes/Ocean/hslogo-16.png b/html/Ocean.std-theme/hslogo-16.png
index 0ff8579f..0ff8579f 100644
--- a/html/themes/Ocean/hslogo-16.png
+++ b/html/Ocean.std-theme/hslogo-16.png
Binary files differ
diff --git a/html/themes/Ocean/minus.gif b/html/Ocean.std-theme/minus.gif
index 1deac2fe..1deac2fe 100644
--- a/html/themes/Ocean/minus.gif
+++ b/html/Ocean.std-theme/minus.gif
Binary files differ
diff --git a/html/themes/Ocean/ocean.css b/html/Ocean.std-theme/ocean.css
index 53af455f..53af455f 100644
--- a/html/themes/Ocean/ocean.css
+++ b/html/Ocean.std-theme/ocean.css
diff --git a/html/themes/Ocean/plus.gif b/html/Ocean.std-theme/plus.gif
index 2d15c141..2d15c141 100644
--- a/html/themes/Ocean/plus.gif
+++ b/html/Ocean.std-theme/plus.gif
Binary files differ
diff --git a/html/themes/Snappy/minus.gif b/html/Snappy.theme/minus.gif
index 1deac2fe..1deac2fe 100644
--- a/html/themes/Snappy/minus.gif
+++ b/html/Snappy.theme/minus.gif
Binary files differ
diff --git a/html/themes/Snappy/plus.gif b/html/Snappy.theme/plus.gif
index 2d15c141..2d15c141 100644
--- a/html/themes/Snappy/plus.gif
+++ b/html/Snappy.theme/plus.gif
Binary files differ
diff --git a/html/themes/Snappy/s_haskell_icon.gif b/html/Snappy.theme/s_haskell_icon.gif
index cb2a8158..cb2a8158 100644
--- a/html/themes/Snappy/s_haskell_icon.gif
+++ b/html/Snappy.theme/s_haskell_icon.gif
Binary files differ
diff --git a/html/themes/Snappy/snappy.css b/html/Snappy.theme/snappy.css
index d3d5bf84..d3d5bf84 100644
--- a/html/themes/Snappy/snappy.css
+++ b/html/Snappy.theme/snappy.css
diff --git a/src/Haddock/Backends/Xhtml/Themes.hs b/src/Haddock/Backends/Xhtml/Themes.hs
index 39f698fc..414feec0 100644
--- a/src/Haddock/Backends/Xhtml/Themes.hs
+++ b/src/Haddock/Backends/Xhtml/Themes.hs
@@ -22,7 +22,7 @@ import Haddock.Options
import Control.Monad (liftM)
import Data.Char (toLower)
import Data.Either (lefts, rights)
-import Data.List (nub, partition)
+import Data.List (nub)
import Data.Maybe (isJust, listToMaybe)
import System.Directory
@@ -60,16 +60,19 @@ standardTheme libDir = liftM (liftEither (take 1)) (defaultThemes libDir)
-- | Default themes that are part of Haddock; added with --default-themes
--- First default theme is the standard theme. At present, hard coded to "Ocean"
--- if present.
+-- The first theme in this list is considered the standard theme.
+-- Themes are "discovered" by scanning the html sub-dir of the libDir,
+-- and looking for directories with the extension .theme or .std-theme.
+-- The later is, obviously, the standard theme.
defaultThemes :: FilePath -> IO PossibleThemes
defaultThemes libDir = do
- themeDirs <- getDirectoryItems (libDir </> "html" </> "themes")
- themes <- mapM directoryTheme themeDirs
- return $ liftEither shuffle $ sequenceEither themes
+ themeDirs <- getDirectoryItems (libDir </> "html")
+ themes <- mapM directoryTheme $ discoverThemes themeDirs
+ return $ sequenceEither themes
where
- shuffle ts = let (a,b) = partition isStd ts in a ++ b
- isStd c = themeName c == "Ocean"
+ discoverThemes paths =
+ filterExt ".std-theme" paths ++ filterExt ".theme" paths
+ filterExt ext = filter ((== ext).takeExtension)
-- | Build a theme from a single .css file