packages feed

yst 0.2.2 → 0.2.2.1

raw patch · 13 files changed

+66/−22 lines, 13 files

Files

README.markdown view
@@ -434,22 +434,6 @@ you can include a section in `<div>` tags, or use raw `<ul>` and `<li>` tags instead of markdown formatting. -### Stringtemplate gotchas--Sometimes you want to create a span-level template---something like-`date.st`, which just formats a date:--    $it; format="%B %d, %Y"$--If you create a file containing this line with a regular text editor,-the file will end with a newline character.  This will be treated-as a newline in the template, so you'll get a new line after every-date in a list of dates: not what you want.--The solution is to set up your text editor so that it doesn't-add the newline at the end of the file.  Using [vim][], you can do this-with the commands `set binary` and `set noeol`.- ### Layout templates  Layout files are also string templates, but they are not treated as@@ -506,6 +490,27 @@ at another port, just pass the port number as an argument to `maid`:      maid 5999++## Development++### Source code++yst's source code lives on github at <http://github.com/jgm/yst/tree/master>.+You can clone the repository with++   git://github.com/jgm/yst.git++To install the development code once you've checked it out, just do++    cabal install++(But please stick to the released version if you don't like things to break+unexpectedly!)++### Reporting bugs++If you find a bug, please report it using+[the issue tracker on yst's github page](http://github.com/jgm/yst/issues).   [string template]: http://www.stringtemplate.org/
Yst/Build.hs view
@@ -28,9 +28,15 @@ import System.Directory import System.Exit import System.Time (ClockTime(..))+-- 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)+import System.IO (hPutStrLn)+#else+import Prelude hiding (readFile, putStrLn, print, writeFile) import System.IO.UTF8+#endif import System.IO (stderr)-import Prelude hiding (readFile, putStrLn, print, writeFile) import Control.Monad  dependencies :: Site -> String -> [FilePath]
Yst/CSV.hs view
@@ -21,8 +21,13 @@ import Yst.Types import Yst.Util import Text.CSV+-- 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)+#else import Prelude hiding (readFile) import System.IO.UTF8+#endif  readCSVFile :: FilePath -> IO Node readCSVFile f = catch (readFile f >>= return . csvToNode . parseCSV' f . stripBlanks)
Yst/Data.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts #-}+{-# OPTIONS_GHC -fno-warn-unused-do-bind #-} {- Copyright (C) 2009 John MacFarlane <jgm@berkeley.edu> 
Yst/Render.hs view
@@ -30,8 +30,13 @@ import Text.StringTemplate import Data.Maybe (fromMaybe) import System.FilePath-import System.IO.UTF8+-- 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)+#else import Prelude hiding (readFile, putStrLn, print, writeFile)+import System.IO.UTF8+#endif import Data.Time import Control.Monad 
Yst/Types.hs view
@@ -19,7 +19,6 @@  module Yst.Types where-import System.FilePath import Data.Char import Data.Time import Text.StringTemplate
Yst/Util.hs view
@@ -22,7 +22,13 @@ import System.Exit import System.FilePath import System.IO (stderr)+-- 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)+import System.IO (hPutStrLn)+#else import System.IO.UTF8 (hPutStrLn)+#endif import System.Directory import Control.Monad import Data.Time
demo/date.st view
demo/eventgroup.st view
@@ -1,3 +1,5 @@ **$first(it).date:date(); separator=" - "$** + $it:event()$+
demo/events.yaml view
@@ -15,5 +15,5 @@  - date: 2009-04-15   speaker: Jim Jones-  title:  XSS attacks for dummies+  title:  ὕαλον ϕαγεῖν δύναμαι 
demo/index.st view
@@ -7,3 +7,10 @@ $recentevents:event()$  For a complete list of events, see the [events](events.html) page.++yst supports unicode:++- ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει.+- أنا قادر على أكل الزجاج و هذا لا يؤلمني.+- 我能吞下玻璃而不伤身体。+
yst.cabal view
@@ -1,5 +1,6 @@ name:                yst-version:             0.2.2+version:             0.2.2.1+Tested-With:         GHC == 6.10.4, GHC == 6.12.1 Cabal-version:       >= 1.2 build-type:          Simple synopsis:            Builds a static website from templates and data in YAML or@@ -50,5 +51,6 @@                      filepath, containers, directory, utf8-string, time,                      old-locale, old-time, parsec, xhtml, pandoc, bytestring,                      split+  extensions:        CPP   ghc-options:       -Wall -threaded -fno-warn-orphans   ghc-prof-options:  -auto-all -caf-all
yst.hs view
@@ -26,9 +26,15 @@ import System.Environment import System.Directory import System.Exit+-- 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)+import System.IO (hPutStrLn)+#else+import Prelude hiding (readFile, putStrLn, print, writeFile) import System.IO.UTF8+#endif import System.IO (stderr)-import Prelude hiding (readFile, putStrLn, print, writeFile) import Control.Monad  createSite :: FilePath -> IO ()