diff options
author | Mark Lentczner <markl@glyphic.com> | 2010-07-27 20:04:03 +0000 |
---|---|---|
committer | Mark Lentczner <markl@glyphic.com> | 2010-07-27 20:04:03 +0000 |
commit | ccb3be7d8d24eda2b5d871b96966049f2f1a7fc3 (patch) | |
tree | 3fb58e3666bd3f27ace12dcac066023c9da10d55 | |
parent | fef839b8f0ccec340f92018c382f424c9266767a (diff) |
move themes into html dir with .theme and .std-theme extensions
-rw-r--r-- | html/Classic.theme/haskell_icon.gif (renamed from html/themes/Classic/haskell_icon.gif) | bin | 911 -> 911 bytes | |||
-rw-r--r-- | html/Classic.theme/minus.gif (renamed from html/themes/Classic/minus.gif) | bin | 56 -> 56 bytes | |||
-rw-r--r-- | html/Classic.theme/plus.gif (renamed from html/themes/Classic/plus.gif) | bin | 59 -> 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) | bin | 1684 -> 1684 bytes | |||
-rw-r--r-- | html/Ocean.std-theme/minus.gif (renamed from html/themes/Ocean/minus.gif) | bin | 56 -> 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) | bin | 59 -> 59 bytes | |||
-rw-r--r-- | html/Snappy.theme/minus.gif (renamed from html/themes/Snappy/minus.gif) | bin | 56 -> 56 bytes | |||
-rw-r--r-- | html/Snappy.theme/plus.gif (renamed from html/themes/Snappy/plus.gif) | bin | 59 -> 59 bytes | |||
-rw-r--r-- | html/Snappy.theme/s_haskell_icon.gif (renamed from html/themes/Snappy/s_haskell_icon.gif) | bin | 607 -> 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.hs | 19 |
13 files changed, 11 insertions, 8 deletions
diff --git a/html/themes/Classic/haskell_icon.gif b/html/Classic.theme/haskell_icon.gif Binary files differindex 10589f91..10589f91 100644 --- a/html/themes/Classic/haskell_icon.gif +++ b/html/Classic.theme/haskell_icon.gif diff --git a/html/themes/Classic/minus.gif b/html/Classic.theme/minus.gif Binary files differindex 1deac2fe..1deac2fe 100644 --- a/html/themes/Classic/minus.gif +++ b/html/Classic.theme/minus.gif diff --git a/html/themes/Classic/plus.gif b/html/Classic.theme/plus.gif Binary files differindex 2d15c141..2d15c141 100644 --- a/html/themes/Classic/plus.gif +++ b/html/Classic.theme/plus.gif 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 Binary files differindex 0ff8579f..0ff8579f 100644 --- a/html/themes/Ocean/hslogo-16.png +++ b/html/Ocean.std-theme/hslogo-16.png diff --git a/html/themes/Ocean/minus.gif b/html/Ocean.std-theme/minus.gif Binary files differindex 1deac2fe..1deac2fe 100644 --- a/html/themes/Ocean/minus.gif +++ b/html/Ocean.std-theme/minus.gif 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 Binary files differindex 2d15c141..2d15c141 100644 --- a/html/themes/Ocean/plus.gif +++ b/html/Ocean.std-theme/plus.gif diff --git a/html/themes/Snappy/minus.gif b/html/Snappy.theme/minus.gif Binary files differindex 1deac2fe..1deac2fe 100644 --- a/html/themes/Snappy/minus.gif +++ b/html/Snappy.theme/minus.gif diff --git a/html/themes/Snappy/plus.gif b/html/Snappy.theme/plus.gif Binary files differindex 2d15c141..2d15c141 100644 --- a/html/themes/Snappy/plus.gif +++ b/html/Snappy.theme/plus.gif diff --git a/html/themes/Snappy/s_haskell_icon.gif b/html/Snappy.theme/s_haskell_icon.gif Binary files differindex cb2a8158..cb2a8158 100644 --- a/html/themes/Snappy/s_haskell_icon.gif +++ b/html/Snappy.theme/s_haskell_icon.gif 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 |