yst 0.3.0.1 → 0.3.1
raw patch · 4 files changed
+33/−14 lines, 4 filesdep ~pandoc
Dependency ranges changed: pandoc
Files
- Yst/Build.hs +17/−3
- Yst/Render.hs +9/−9
- changelog +4/−0
- yst.cabal +3/−2
Yst/Build.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE ScopedTypeVariables, CPP #-} {- Copyright (C) 2009 John MacFarlane <jgm@berkeley.edu> @@ -28,7 +28,12 @@ import System.FilePath import System.Directory import System.Exit+#if MIN_VERSION_directory(1,2,0)+import Data.Time.Calendar (Day(..))+import Data.Time.Clock (UTCTime(..), secondsToDiffTime)+#else import System.Time (ClockTime(..))+#endif -- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv -- So we use System.IO.UTF8 only if we have an earlier version #if MIN_VERSION_base(4,2,0)@@ -42,6 +47,15 @@ import Control.Monad import Control.Exception (catch, SomeException) +#if MIN_VERSION_directory(1,2,0)+minTime :: UTCTime+minTime = UTCTime (ModifiedJulianDay 0) (secondsToDiffTime 0)+#else+minTime :: ClockTime+minTime = TOD 0 0+#endif++ findSource :: Site -> FilePath -> IO FilePath findSource = searchPath . sourceDir @@ -83,7 +97,7 @@ srcpath <- searchPath (filesDir site) file srcmod <- getModificationTime srcpath destmod <- catch (getModificationTime destpath)- (\(_::SomeException) -> return $ TOD 0 0)+ (\(_::SomeException) -> return minTime) if srcmod > destmod then do createDirectoryIfMissing True $ takeDirectory destpath@@ -103,7 +117,7 @@ exitWith $ ExitFailure 3 depsmod <- mapM getModificationTime deps destmod <- catch (getModificationTime destpath)- (\(_::SomeException) -> return $ TOD 0 0)+ (\(_::SomeException) -> return minTime) if maximum depsmod > destmod then do createDirectoryIfMissing True $ takeDirectory destpath
Yst/Render.hs view
@@ -138,17 +138,17 @@ converterForFormat :: Format -> String -> String converterForFormat f =- let reader = readMarkdown defaultParserState{stateSmart = True}+ let reader = readMarkdown def{readerSmart = True} in case f of- HtmlFormat -> writeHtmlString defaultWriterOptions . reader- LaTeXFormat -> writeLaTeX defaultWriterOptions . reader+ HtmlFormat -> writeHtmlString def . reader+ LaTeXFormat -> writeLaTeX def . reader PlainFormat -> id- ConTeXtFormat -> writeConTeXt defaultWriterOptions . reader- ManFormat -> writeMan defaultWriterOptions . reader- RTFFormat -> writeRTF defaultWriterOptions . reader- DocBookFormat -> writeDocbook defaultWriterOptions . reader- TexinfoFormat -> writeTexinfo defaultWriterOptions . reader- OpenDocumentFormat -> writeOpenDocument defaultWriterOptions . reader+ ConTeXtFormat -> writeConTeXt def . reader+ ManFormat -> writeMan def . reader+ RTFFormat -> writeRTF def . reader+ DocBookFormat -> writeDocbook def . reader+ TexinfoFormat -> writeTexinfo def . reader+ OpenDocumentFormat -> writeOpenDocument def . reader getTemplate :: Stringable a => String -> STGroup a -> IO (StringTemplate a) getTemplate templateName templateGroup = do
changelog view
@@ -1,3 +1,7 @@+yst 0.3.1 (released 19 Jan 2013)++ * Updated to compile with pandoc 1.10, directory 1.2.+ yst 0.3.0.1 (released 23 Oct 2012) * Allow compilation with latest HStringTemplate.
yst.cabal view
@@ -1,5 +1,5 @@ name: yst-version: 0.3.0.1+version: 0.3.1 Tested-With: GHC == 7.4.1 Cabal-version: >= 1.8 build-type: Simple@@ -58,7 +58,8 @@ HStringTemplate >= 0.6.1 && < 0.6.9 || > 0.6.11 && < 0.7, HsSyck, csv, filepath, containers, directory, utf8-string, time,- old-locale, old-time, parsec, xhtml, pandoc, bytestring,+ old-locale, old-time, parsec, xhtml,+ pandoc >= 1.10 && < 1.11, bytestring, split, HDBC, HDBC-sqlite3 extensions: CPP if impl(ghc >= 6.12)