panda 2009.1.20 → 2009.4.1
raw patch · 12 files changed
+516/−295 lines, 12 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- changelog.markdown +0/−279
- changelog.md +292/−0
- panda.cabal +2/−2
- readme.markdown +0/−4
- readme.md +207/−0
- src/Panda/Helper/Env.hs +1/−1
- src/Panda/Helper/Helper.hs +1/−1
- src/Panda/Helper/StateHelper.hs +6/−4
- src/Panda/Model/Album.hs +2/−1
- src/Panda/Model/Post.hs +1/−1
- src/Panda/Type/Plugin.hs +1/−1
- src/Panda/View/Atom/Comment.hs +3/−1
− changelog.markdown
@@ -1,279 +0,0 @@-2008.12.16--------------### Fix--* Add more modules in panda.cabal--2008.12.15-------------### Feature--* Parallel processing ready--### Fix--* resource with file extension shows correctly--2008.12.14-------------### Feature--* Photo album plugin--2008.11.7------------### Feature--* Use HCheat-* Use MPSUTF8 for utf8 wrapper-* Use kibro 0.4.2--2008.11.6-------------### Fix--* Work with utf8-string 0.3.2--2008.10.27--------------### Feature--* Customizable footer--2008.10.26--------------### Fix--* Missing type/extension.hs in cabal--2008.10.25--------------### Feature--* Modular system: search, comment, analytics are now extensions that can be disabled / enabled--### Fix--* backward compatible with old comment format, no migration required as in 2008.10.24-* works with kibro 4.1--2008.10.24-------------### Feature--* empty field for simple anti-spam-* gravatar support in comment-* dynamic simple math human test --### Migrate--* comment is in a new format not compatible with older version. I made a mistake in designing the comment file format, it's now in 2 files. One contains the comment body, the other contains the comment meta data.--2008.10.21--------------### Fix--* next page link works in if mounted on a directory, e.g. /blog--2008.10.19--------------### Feature--* Pretty URLs-* Configurable date format for plain text--2008.10.18--------------### Fix--* Comment works with multiple lines... ( fixed in mps )--2008.10.17--------------### Fix--* Works with kibro 0.3--2008.10.16--------------### Fix--* link within RSS --2008.10.15-------------### Fix--* RSS link for root--2008.10.14-------------### Fix--* RSS link in header-* pagination link---2008.10.13--------------### Feature--* configurable root_path for `hostname/blog` --2008.10.12-------------### Fix--* navigation style typo---2008.10.11-------------### Feature--* Proper title in header--### Fix--* Change to GPL ( since panda links to GPL libraries )---2008.9.29------------### Feature--* Text based theme---2008.9.28------------### Feature--* Add favicon config-* Add google analytics config---2008.9.20-------------### Fix--* Relax GHC package dependencies--2008.9.19.2---------------### Fix--* Add Type.Sidebar dependency--2008.9.19.1---------------### Feature--* Customizable sidebar--### Fix--* Leave comment in utf-8 posts---2008.9.19-------------### Features--* Comment system-* Change version schema--### Improvements--* uniform unicode handling ( byte8 internal, utf-8 IO )--0.0.0.5.1-------------* UTF8 bug fix release--0.0.0.5-----------### Features--* Support HTML, reStructuredText and LaTeX in addition to Markdown, just add a the appropriate file extension, no extension defaults to Markdown--### Fix--* cabal dependency on parsec--0.0.0.4.2-------------downgrade to `HaXml 0.13` and `RSS 3000.0.1` for `arch`--0.0.0.4.1-------------require `mps-0.0.0.1`--0.0.0.4-----------### Feature-* configurable navigation menu in `site.txt`, example: - - navigation = About, Gallery--* default values for all configurations--### Fix-* unicode support for tags-* work with the `pandoc 1.0.0.1`--0.0.0.3-----------### Feature--* Search-* Feed per tag-* Theme through CSS--### Migration--* Checkout `public/theme/blueprint/wp/css/custom.css` in `panda-template`--0.0.0.2-----------### General--* A new blueprint theme adopted from <http://www.fireandknowledge.org/archives/2007/09/05/blueprint-wordpress-theme/>-* Support for tags, see `panda-template` for example.-* Support for subtitle--### Migration--* Add a tag folder under `db`
+ changelog.md view
@@ -0,0 +1,292 @@+2009.4.1+-----------++### Fix++* this is not a joke+* unicode search+* auto add "http://" for the link-field in comments++### Extra++* All the documentation has been moved into a single readme.md file.++2008.12.16+-----------++### Fix++* Add more modules in panda.cabal++2008.12.15+----------++### Feature++* Parallel processing ready++### Fix++* resource with file extension shows correctly++2008.12.14+----------++### Feature++* Photo album plugin++2008.11.7+---------++### Feature++* Use HCheat+* Use MPSUTF8 for utf8 wrapper+* Use kibro 0.4.2++2008.11.6+----------++### Fix++* Work with utf8-string 0.3.2++2008.10.27+-----------++### Feature++* Customizable footer++2008.10.26+-----------++### Fix++* Missing type/extension.hs in cabal++2008.10.25+-----------++### Feature++* Modular system: search, comment, analytics are now extensions that can be disabled / enabled++### Fix++* backward compatible with old comment format, no migration required as in 2008.10.24+* works with kibro 4.1++2008.10.24+----------++### Feature++* empty field for simple anti-spam+* gravatar support in comment+* dynamic simple math human test ++### Migrate++* comment is in a new format not compatible with older version. I made a mistake in designing the comment file format, it's now in 2 files. One contains the comment body, the other contains the comment meta data.++2008.10.21+-----------++### Fix++* next page link works in if mounted on a directory, e.g. /blog++2008.10.19+-----------++### Feature++* Pretty URLs+* Configurable date format for plain text++2008.10.18+-----------++### Fix++* Comment works with multiple lines... ( fixed in mps )++2008.10.17+-----------++### Fix++* Works with kibro 0.3++2008.10.16+-----------++### Fix++* link within RSS ++2008.10.15+----------++### Fix++* RSS link for root++2008.10.14+----------++### Fix++* RSS link in header+* pagination link+++2008.10.13+-----------++### Feature++* configurable root_path for `hostname/blog` ++2008.10.12+----------++### Fix++* navigation style typo+++2008.10.11+----------++### Feature++* Proper title in header++### Fix++* Change to GPL ( since panda links to GPL libraries )+++2008.9.29+---------++### Feature++* Text based theme+++2008.9.28+---------++### Feature++* Add favicon config+* Add google analytics config+++2008.9.20+----------++### Fix++* Relax GHC package dependencies++2008.9.19.2+------------++### Fix++* Add Type.Sidebar dependency++2008.9.19.1+------------++### Feature++* Customizable sidebar++### Fix++* Leave comment in utf-8 posts+++2008.9.19+----------++### Features++* Comment system+* Change version schema++### Improvements++* uniform unicode handling ( byte8 internal, utf-8 IO )++0.0.0.5.1+----------++* UTF8 bug fix release++0.0.0.5+--------++### Features++* Support HTML, reStructuredText and LaTeX in addition to Markdown, just add a the appropriate file extension, no extension defaults to Markdown++### Fix++* cabal dependency on parsec++0.0.0.4.2+----------++downgrade to `HaXml 0.13` and `RSS 3000.0.1` for `arch`++0.0.0.4.1+----------++require `mps-0.0.0.1`++0.0.0.4+--------++### Feature+* configurable navigation menu in `site.txt`, example: + + navigation = About, Gallery++* default values for all configurations++### Fix+* unicode support for tags+* work with the `pandoc 1.0.0.1`++0.0.0.3+--------++### Feature++* Search+* Feed per tag+* Theme through CSS++### Migration++* Checkout `public/theme/blueprint/wp/css/custom.css` in `panda-template`++0.0.0.2+--------++### General++* A new blueprint theme adopted from <http://www.fireandknowledge.org/archives/2007/09/05/blueprint-wordpress-theme/>+* Support for tags, see `panda-template` for example.+* Support for subtitle++### Migration++* Add a tag folder under `db`
panda.cabal view
@@ -1,5 +1,5 @@ Name: panda-Version: 2009.1.20+Version: 2009.4.1 Build-type: Simple Synopsis: A simple static blog engine Description: A simple static blog engine@@ -11,7 +11,7 @@ Cabal-version: >= 1.2 category: Web homepage: http://www.haskell.org/haskellwiki/Panda-data-files: readme.markdown, changelog.markdown+data-files: readme.md, changelog.md library ghc-options: -Wall -fno-warn-missing-signatures -fno-warn-name-shadowing -fno-warn-orphans -fno-warn-type-defaults
− readme.markdown
@@ -1,4 +0,0 @@-## Panda: a simple blog engine in Haskell--* [Panda homepage](http://www.haskell.org/haskellwiki/Panda)-* Documentation: inside `doc`
+ readme.md view
@@ -0,0 +1,207 @@+## Panda: a simple blog engine in Haskell++### Features++#### simple file structure++ db+ |---- blog+ | |---- 08-09-01 first post+ | |---- 09-09-02 learn javascript.html+ |+ |---- tag+ | |---- programming+ | |---- funny+ |+ |---- static+ |---- About++#### simple config file++ blog_title = C大调+ blog_subtitle = 野猫不吃薯片+ host_name = jinjing.blog.easymic.com+ author_email = nfjinjing@gmail.com++ navigation = About+ per_page = 7+ sidebar = Blogroll.md+ favicon = panda_icon.png++#### standard web technology++extend/customize with pure css and javascript ( note the custom part in css and js from the last section )++#### hacker friendly++* posts are in plain text+* SCM for publishing / data managing ( not really a feature, but a design goal from the beginning )+* blindly follows the KISS principle from code to UI: be a simple blog, no more no less++## Demo++### blog++[My blog](http://jinjing.easymic.com) source is available as a git repo:++ git clone git://github.com/nfjinjing/jinjing-blog.git++Or [browser](http://github.com/nfjinjing/jinjing-blog/tree/master) online++### config++[jinjing's blog config file](http://github.com/nfjinjing/jinjing-blog/blob/401a541443d88bbf8d844874c1473d4b3bc81784/config/site.txt)++## Install++### Quick setup++#### install [lighttpd](http://www.lighttpd.net/ )++Note: only version 1.4.19 has been successfully tested, 1.4.20 is bugged for reasons unknown.++#### install [ghc](http://www.haskell.org/ghc/download.html)++#### install [darcs](http://www.darcs.net/) for `cabal-install`++#### install [cabal-install](http://hackage.haskell.org/trac/hackage/wiki/CabalInstall)++ darcs get --partial http://darcs.haskell.org/cabal-install/+ cd cabal-install+ sh bootstrap.sh++#### install panda++ cabal update; cabal install panda++#### bootstrap++ # panda is a kibro project+ kibro new myblog+ cd myblog+ + # get a template to start+ git clone git://github.com/nfjinjing/panda-template.git db+ sh db/extra/scripts/bootstrap.sh+ +#### run++ kibro start++It should be running on [http://127.0.0.1:3000](http://127.0.0.1:3000) now.++Since Panda is based on Kibro, it helps to read how [Kibro](http://chrisdone.com/blog/tag/Kibro) works.++### Goodies++Install `Ruby` / `Rake`, then `rake -T` to see a list of helper commands.++### Config++Edit `db/config/site.txt`++ blog_title = My shiny blog+ host_name = yourhost.com+ author_email = your_mail@yourhost.com++Restart required. (hint: `rake r`)++## User's guide++### posts++All posts are placed in `db/blog` folder, with naming convention [yy-mm-dd title], in Markdown format by default.++Markdown supports embedding HTML snippets, so embedding youtube video is a peace of cake.++<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/rEYg0Dqtogg&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/rEYg0Dqtogg&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>+ +You can create static pages, in `db/static`, and link to them via `/static/static_file_name` inside your blogs.++For example `db/static/About`, where you can put some profile in.++### tagging++Create a file in `db/tag`, the name of the file will be the name of the new tag.+edit the tag file, insert the full name of a blog post, e.g. `08-09-04 Welcome to Panda`++### html / tex / restructured text format++Just create the file in blog as usual with an extension (e.g. html, rst, tex ), and you are all set.++### customize navigation bar++see example in `config/site`:++ navigation = About, Gallery++Multiple renderer supported, use extension as hints.++Note, the navigation configuration requires the full name of your static page, so you should include extension in configuration as well.++### customize sidebar++see example in `config/site`, `config/sidebar/Blogroll.md`++ sidebar = Blogroll.md+ +Sidebar items are html snippets plugged into view. You can create these plugins in multiple formats, use extension.++### styling++Styling is done by editing `public/theme/blueprint/css/custom.css`, see the default `custom.css` for inspiration.++### theming++New theme can be created without touching `Panda` code, example blueprint theme in `db/config/theme/blueprint.txt`++ container = container+ header = column span-12 first+ navigation = column span-12 first large+ main = column span-9 first+ sidebar = column span-3 last+ footer = footer++ css = screen, blueprint-wp, custom+ js = jquery-1.2.6.min, jquery.getUrlParam, jquery.highlight-2, custom+++These are custom class names for each element block.++You can create new themes by adding theme definition files in `db/config/theme`, put theme resources under `db/public/theme/your_theme_name` and place++ theme = your_new_theme++inside `site.txt`.++note: `css` and `js` are required to be placed under `db/public/theme/your_theme_name/css` and `db/public/theme/your_theme_name/js`, leave out the file extensions in `site.txt`.++### syntax highlighting++ <object + type="text/html" \+ data="http://www.flickr.com/slideShow/index.gne \+ ?user_id=56167317@N00&tags=cat-hack" \+ width="500" height="500">+ </object>++Highlight for `HTML` is enabled by default, see `public/theme/blueprint/js/custom.js` for more language support.++Highlight style is configured at `config/theme/blueprint.txt`, just change `highlight/default` to any css inside `theme/blueprint/css/highlight`.+++### analytics++Google analytics is available, put your `tracker_id` in `site.txt`, if you don't want analytics, ignore the setting.++Once site module is introduced, those `js` code could be configured to be gone forever, but not yet in the current release.++### final note++try to use `<h3>` for heading in your posts, at least `wordpress` is using this convention. `<h1>` is not styled in the blueprint theme, so they look kind of unfitted. But this does not stop anyone from styling `<h1>, <h2>` if wished.++### Links++* [Kibro](http://chrisdone.com/blog/tag/Kibro)+* [Panda on Jinjing's blog](http://jinjing.easymic.com/tag/Panda)+* [Source](http://github.com/nfjinjing/panda/tree)
src/Panda/Helper/Env.hs view
@@ -26,7 +26,7 @@ import Panda.Helper.PreludeEnv hiding (FilePath) import Control.Monad (liftM2, liftM3, liftM4, liftM5) import Control.Arrow ((>>>), (&&&), (***))-import Data.List (isSuffixOf, isInfixOf, sortBy, intersperse) +import Data.List (isSuffixOf, isInfixOf, isPrefixOf, sortBy, intersperse) import Network.URI import Network.CGI hiding (Html) import System.Locale
src/Panda/Helper/Helper.hs view
@@ -69,7 +69,7 @@ params = do query_string <- requestURI ^ uriQuery case query_string of- '?':s -> s.formDecode .map_snd ( unescape_unicode_xml ) .return+ '?':s -> s.formDecode .map_snd ( unescape_unicode_xml > b2u) .return _ -> return [] inputs = getInputs ^ map_snd (strip > unescape_unicode_xml > b2u)
src/Panda/Helper/StateHelper.hs view
@@ -38,10 +38,12 @@ paginate = length > full_paginate (G.per_page) cut = G.cut-cut_re = "^\\s*" ++ cut-match_cut = is_cut-is_cut = isInfixOf cut-split_cut = split cut_re+match_cut = isInfixOf cut+is_cut = isPrefixOf cut++-- not used for efficiency+-- cut_re = "^\\s*" ++ cut+-- split_cut = split cut_re -- model
src/Panda/Model/Album.hs view
@@ -7,6 +7,7 @@ import qualified Panda.Config.Global as G import Panda.Helper.StateHelper import Panda.Helper.ThumbHelper+import List (sort) data AlbumType = Galleria | Fade | SlideViewer | Popeye deriving (Eq, Show, Read) @@ -34,7 +35,7 @@ id.image_path.convert_if_missing_thumb w get_pictures id ^ Album id pre desc t w -get_pictures = image_path > ls > (^ filter is_image)+get_pictures = image_path > ls > (^ filter is_image) > (^ sort) get_picture_title pre x | pre.empty = x
src/Panda/Model/Post.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE NoImplicitPrelude #-} --- what about the performance?+-- what about performance? -- Haskell takes care of that, since IOs are also lazy. -- Posts are not read unless specifically required, i.e. after pagination
src/Panda/Type/Plugin.hs view
@@ -55,4 +55,4 @@ video <- plugin.args.V.from_list ^ render_plugin x.sub plugin_expression video .apply_plugin -render_plugin x = x.render_data.show+render_plugin x = "\n" ++ x.render_data.show
src/Panda/View/Atom/Comment.hs view
@@ -22,7 +22,9 @@ , x.markup ] where- a = if x.author_link.null then x.author.toHtml else toHtml $ hotlink (x.author_link) << x.author+ l = x.author_link+ a = if l.null then x.author.toHtml else toHtml $ hotlink formatted_link << x.author+ formatted_link = if l.starts_with "http://" then l else "http://" ++ l gravatar = thediv ! [theclass "gravatar"] << image ! [src (gravatar_link x)] comment_date x = toHtml $ x.date.format_date "%b %e, %Y at %I:%M %p"