packages feed

yst 0.2.3 → 0.2.3.1

raw patch · 7 files changed

+19/−11 lines, 7 files

Files

README.markdown view
@@ -24,6 +24,12 @@ a special directory:  `~\.cabal\bin` on unix systems.  You will need to make sure that directory is in your system path.) +If you get the error "yst-0.2.3 depends on template-haskell-2.4.0.0+which failed to install," then try the following:++    cabal install syb-with-class-0.6+    cabal install yst+ Getting started --------------- @@ -169,11 +175,12 @@  - `indexfile`: the filename of the index file (default: `index.yaml`) - `title`:  the title of the whole site-- `templatedir`:  the directory containing templates (default: `.`)+- `sourcedir`:  the directory containing all the templates and page sources+  (default: `.`) - `datadir`:  the directory containing yaml data files (default: `.`) - `filesdir`: the directory containing static files (default: `files`)-- `layout`: the default layout template for the site (default:-  `layout.html.st`)+- `layout`: the default layout template for the site, relative to+  `sourcedir` (default: `layout.html.st`)  ### `index.yaml` and submenus @@ -193,7 +200,8 @@    menu  Each page must have at least `url`, `title`, and either `template` or-`source`.+`source`. Values for `template`, `source`, and `layout` are relative to+`sourcedir` specified in `config.yaml`.  The pages may be organized into a tree-like hierarchy, which will be reflected in the site navigation menu.  It is easiest to see how this
Yst/CSV.hs view
@@ -30,7 +30,7 @@ #endif  readCSVFile :: FilePath -> IO Node-readCSVFile f = catch (readFile f >>= return . csvToNode . parseCSV' f . stripBlanks)+readCSVFile f = catch (readFile f >>= return . csvToNode . parseCSV' f . stripBlanks . filter (/='\r'))                    (\e -> errorExit 11 ("Error parsing " ++ f ++ ": " ++ show e) >> return NNil)  parseCSV' :: FilePath -> String -> CSV
Yst/Data.hs view
@@ -123,7 +123,7 @@   return (fname, opts)  pIdentifier :: GenParser Char st [Char]-pIdentifier = spaces >> (pQuoted '\'' <|> pQuoted '"' <|> many (noneOf " \t\n;,'\""))+pIdentifier = spaces >> (pQuoted '\'' <|> pQuoted '"' <|> many (noneOf " \t\n<>=;,'\""))  -- | Case-insensitive string parser. pString :: String -> GenParser Char st String
Yst/Render.hs view
@@ -110,7 +110,7 @@   todaysDate <- liftM utctDay getCurrentTime   rawContents <-     case sourceFile page of-          SourceFile sf   -> readFile (srcDir </> sf)+          SourceFile sf   -> liftM (filter (/='\r')) $ readFile (srcDir </> sf)           TemplateFile tf -> do             templ <- getTemplate tf g             return $ render (setManyAttrib attrs templ)
Yst/Yaml.hs view
@@ -25,7 +25,7 @@ import Data.Time import System.Locale (defaultTimeLocale) import Codec.Binary.UTF8.String (encodeString, decodeString)-import qualified Data.ByteString.Char8 as B (ByteString, readFile)+import qualified Data.ByteString.Char8 as B (ByteString, readFile, filter)  -- Note: Syck isn't unicode aware, so we use parseYamlBytes and do our -- own encoding and decoding.@@ -39,7 +39,7 @@ packBuf = Data.Yaml.Syck.packBuf . encodeString  readYamlFile :: FilePath -> IO Node-readYamlFile f = catch (B.readFile f >>= parseYamlBytes >>= return . yamlNodeToNode)+readYamlFile f = catch (B.readFile f >>= parseYamlBytes . B.filter (/='\r') >>= return . yamlNodeToNode)                    (\e -> errorExit 11 ("Error parsing " ++ f ++ ": " ++ show e) >> return NNil)  yamlNodeToNode :: YamlNode -> Node
demo/index.yaml view
@@ -17,7 +17,7 @@   template : april_events.st   requires : event.st   data     :-    april  : FROM events.yaml WHERE date >= '2009-04-01' AND date < '2009-05-01' ORDER BY date+    april  : FROM events.yaml WHERE date>='2009-04-01' AND date < '2009-05-01' ORDER BY date   layout   : layout.tex.st   inmenu   : no  
yst.cabal view
@@ -1,5 +1,5 @@ name:                yst-version:             0.2.3+version:             0.2.3.1 Tested-With:         GHC == 6.10.4, GHC == 6.12.1 Cabal-version:       >= 1.2 build-type:          Simple