on master help sign in
Unicode is a bitch.

I am leaving a character in one of the examples, so we would notice it directly, should we ever break it again.

commitda31280dd7c93499327e149af9679806d1a09e46 authorJasper Van der Jeugt <jaspervdj@gmail.com> dateTue 19 Jan 2010, 09:15 (17 years ago) parent271e7a3
4 files changed+12−15
examples/brochure/about.markdown+1−1 hakyll.cabal+1−2 src/Text/Hakyll/Page.hs+9−10 src/Text/Hakyll/Render/Internal.hs+1−2
examples/brochure/about.markdown+1−1
@@ -5,7 +5,7 @@ Nullam imperdiet sodales orci vitae molestie. Nunc quam orci, pharetra a
55rhoncus vitae, eleifend id felis. Suspendisse potenti. Etiam vitae urna orci.
66Quisque pellentesque dignissim felis, egestas tempus urna luctus vitae. In hac
77habitasse platea dictumst. Morbi fringilla mattis odio, et mattis tellus
8−accumsan vitae.
8+accumsan vitae. 碁
99
1010Vivamus eget mauris sit amet nulla laoreet lobortis. Nulla in diam elementum
1111risus convallis commodo. Cras vehicula varius dui vitae facilisis. Proin
hakyll.cabal+1−2
@@ -34,8 +34,7 @@ library
3434 mtl >= 1.1,
3535 old-locale >= 1,
3636 time >= 1,
37− parallel >= 2,
38− utf8-string >= 0.3
37+ parallel >= 2
3938 exposed-modules: Text.Hakyll
4039 Text.Hakyll.Hakyll
4140 Text.Hakyll.Render
src/Text/Hakyll/Page.hs+9−10
@@ -12,8 +12,7 @@ import Data.Maybe (fromMaybe)
1212import Control.Parallel.Strategies (rdeepseq, ($|))
1313import Control.Monad.Reader (liftIO)
1414import System.FilePath (takeExtension)
15−import System.IO (IOMode(..), openFile, hClose)
16−import qualified System.IO.UTF8 as U
15+import System.IO
1716
1817import Text.Pandoc
1918
@@ -93,18 +92,18 @@ cachePage page@(Page mapping) = do
9392
9493 writePageToCache = do
9594 handle <- openFile destination WriteMode
96− U.hPutStrLn handle "---"
95+ hPutStrLn handle "---"
9796 mapM_ (writePair handle) $ M.toList simpleMetaData
9897 mapM_ (writeSection handle) $ M.toList sectionMetaData
99− U.hPutStrLn handle "---"
100− U.hPutStrLn handle $ getBody page
98+ hPutStrLn handle "---"
99+ hPutStrLn handle $ getBody page
101100 hClose handle
102101
103− writePair h (k, v) = do U.hPutStr h $ k ++ ": " ++ v
104− U.hPutStrLn h ""
102+ writePair h (k, v) = do hPutStr h $ k ++ ": " ++ v
103+ hPutStrLn h ""
105104
106− writeSection h (k, v) = do U.hPutStrLn h $ "--- " ++ k
107− U.hPutStrLn h v
105+ writeSection h (k, v) = do hPutStrLn h $ "--- " ++ k
106+ hPutStrLn h v
108107
109108 destination = toCache $ getURL page
110109
@@ -147,7 +146,7 @@ readPage pagePath = do
147146 -- Read file.
148147 handle <- liftIO $ openFile path ReadMode
149148 sections <- fmap (splitAtDelimiters . lines )
150− (liftIO $ U.hGetContents handle)
149+ (liftIO $ hGetContents handle)
151150
152151 let context = concat $ zipWith ($) sectionFunctions sections
153152 page = fromContext $ M.fromList $
src/Text/Hakyll/Render/Internal.hs+1−2
@@ -16,7 +16,6 @@ import Data.List (isPrefixOf, foldl')
1616import Data.Char (isAlpha)
1717import Data.Maybe (fromMaybe)
1818import Control.Parallel.Strategies (rdeepseq, ($|))
19−import qualified System.IO.UTF8 as U
2019
2120import Text.Hakyll.Renderable
2221import Text.Hakyll.Page
@@ -90,6 +89,6 @@ writePage page = do
9089 context = additionalContext' `M.union` (M.singleton "root" $ toRoot url)
9190 makeDirectories destination
9291    -- Substitute $root here, just before writing.
93− liftIO $ U.writeFile destination $ finalSubstitute (getBody page) context
92+ liftIO $ writeFile destination $ finalSubstitute (getBody page) context
9493 where
9594 url = getURL page