rezoom 0.0.3 → 0.0.4
raw patch · 3 files changed
+12/−11 lines, 3 files
Files
- Main.hs +7/−6
- Rezoom/Builder.hs +4/−4
- rezoom.cabal +1/−1
Main.hs view
@@ -7,11 +7,12 @@ import System.Console.GetOpt import Control.Monad (join) import Control.Applicative ((<$>))-import Control.Monad.Reader-import Paths_rezoom (getDataFileName)+import Paths_rezoom+import qualified Data.Version as V import qualified Data.Map as M -version = "0.0.1"+ourVersion :: String+ourVersion = V.showVersion version data Flag = Version | Output String |@@ -61,7 +62,7 @@ main = do args <- getArgs case getOpt Permute options args of- (flags, [], []) -> if Version `elem` flags then do putStrLn ("rezoom " ++ version)+ (flags, [], []) -> if Version `elem` flags then do putStrLn ("rezoom " ++ ourVersion) else do error $ usageInfo header options (_, [], _) -> error $ "Username required!\n" ++ usageInfo header options (flags, username:_, []) -> do@@ -71,10 +72,10 @@ css <- readFile cssfile json <- parse <$> getAPI username case json of- Left err -> do error "Unable to parse API response, sorry."+ Left err -> error "Unable to parse API response, sorry." Right res -> do putStrLn "Building resume..."- let html = runReader build $ Resume sane res css+ let html = build $ Resume sane res css writeFile filename html putStrLn "All done." (_, _, msgs) -> error $ concat msgs ++ usageInfo header options
Rezoom/Builder.hs view
@@ -25,14 +25,14 @@ instance Eq Html where x == y = showHtml x == showHtml y - build :: Reader Resume String+ build :: Resume -> String build = do- v <- asks source+ v <- source case v $$ "repositories" of Nothing -> error "Unknown username." Just repos -> do- fileContents <- asks css- options <- asks opts+ fileContents <- css+ options <- opts return $ renderHtml $ buildHeader fileContents +++ body << thediv ! [identifier "container"] << thediv ! [identifier "container-inner"] <<
rezoom.cabal view
@@ -1,6 +1,6 @@ Cabal-Version: >= 1.6 Name: rezoom-Version: 0.0.3+Version: 0.0.4 Synopsis: Github resume generator Description: Generates a resume from your github page. License: GPL