panda 0.0.0.5 → 0.0.0.5.1
raw patch · 9 files changed
+35/−13 lines, 9 files
Files
- Panda.hs +0/−2
- Panda/Controller/Application.hs +9/−2
- Panda/Helper/Env.hs +4/−1
- Panda/Helper/Helper.hs +4/−0
- Panda/Model/Post.hs +6/−2
- Panda/Model/Tag.hs +4/−5
- Panda/Type/Reader.hs +2/−0
- changelog.markdown +5/−0
- panda.cabal +1/−1
Panda.hs view
@@ -1,5 +1,3 @@-{-# OPTIONS -fno-monomorphism-restriction #-}- module Panda ( module Panda.Controller.Application,
Panda/Controller/Application.hs view
@@ -1,5 +1,14 @@+-- the controller is the most complex module for a reason:+-- models are made as simple and small as possible+-- views are pure functions.++-- I believe this leads to more robust system, and provides much more+-- flexibility in both design and implementation++ {-# OPTIONS -fno-monomorphism-restriction #-} + module Panda.Controller.Application where import qualified Data.Map as Map@@ -23,8 +32,6 @@ import qualified Panda.View.Theme.BluePrint.Tag as TagV import qualified Panda.View.Theme.BluePrint.Search as SearchV import qualified Panda.View.RSS as RSSV-- blog_regex = "^/[0-9][0-9]-[0-9][0-9]-[0-9][0-9]"
Panda/Helper/Env.hs view
@@ -1,3 +1,6 @@+-- this sets some scoping for every module, which prevents importing+-- common modules in every file+ module Panda.Helper.Env ( module MPS , module Control.Monad @@ -16,7 +19,7 @@ import MPS hiding (base, col, sub) import Control.Monad hiding (join)-import Control.Arrow ((>>>))+import Control.Arrow ((>>>), (&&&), (***)) import Data.List import Network.URI import Network.CGI hiding (Html)
Panda/Helper/Helper.hs view
@@ -1,3 +1,7 @@+-- helper module is a central place for reusable functions+-- for this project, more general helpers are usually moved+-- to MPS package, for multi-project usage+ {-# OPTIONS -fno-monomorphism-restriction #-} module Panda.Helper.Helper where
Panda/Model/Post.hs view
@@ -1,8 +1,12 @@+-- what about the performance?+-- Haskell takes care of that, since IOs are also lazy.+-- Posts are not read unless specifically required, i.e. after pagination+ module Panda.Model.Post where -- env-import Panda.Helper.Env hiding (match, readFile, title, body)-import Prelude hiding ((.), (/), id)+import Panda.Helper.Env hiding (match, title, body)+import Prelude hiding ((.), (/), id, readFile) import qualified Panda.Config.Global as Config import Panda.Type.Reader
Panda/Model/Tag.hs view
@@ -23,14 +23,13 @@ list = ls Config.tag_uri <.> map (Config.tag_id /) >>= mapM get -get id = get_resources id <.> Tag id (get_name id)-get_name id = id.from_utf8.split "/" .tail.join'-get_resources id = (Config.flat_uri / id) .readFile +get id = get_resources id <.> Tag id (get_name id)+get_name id = id.from_utf8.split "/" .tail.join'+get_resources id = (Config.flat_uri / id) .readFile -- preserve ansi file path <.> filter_comment <.> lines <.> map (Config.blog_id / ) <.> to_set -to_tuple x = (x.name, x.resources)-tag_map' xs = xs . map (to_tuple) . to_h+tag_map' xs = xs . map (name &&& resources) . to_h tag_map = list <.> tag_map' for_resource xs x = xs.select (resources >>> Set.member x) .map name
Panda/Type/Reader.hs view
@@ -23,6 +23,8 @@ to_html r = r defaultParserState >>> writeHtml defaultWriterOptions +-- this list can go on, as long as there is a library that does+-- the convertion. pretty extensible, isn't it. rr Markdown = to_html readMarkdown rr RST = to_html readRST rr HTML = primHtml
changelog.markdown view
@@ -1,3 +1,8 @@+0.0.0.5.1+----------++* UTF8 bug fix release+ 0.0.0.5 --------
panda.cabal view
@@ -1,5 +1,5 @@ Name: panda-Version: 0.0.0.5+Version: 0.0.0.5.1 Build-type: Simple Synopsis: Simple Static Blog Engine Description: Simple Static Blog Engine