The bamboo package

[Tags: gpl, library]

[Skip to ReadMe]


Versions2009.4.22, 2009.4.23, 2009.4.25, 2009.4.26, 2009.4.27, 2009.4.30, 2009.4.50, 2009.4.52, 2009.5.13, 2009.5.18, 2009.5.18.1, 2009.5.18.2, 2009.5.19, 2009.5.22, 2009.5.23, 2009.5.27, 2009.6.6, 2009.6.8, 2009.6.9, 2009.6.25, 2009.8.16, 2009.11.1, 2010.1.1, 2010.1.26, 2010.2.25
Dependenciesbase (==4.*), base64-string, bytestring, containers, data-default (>=0.2), directory, filepath, gravatar (>=0.3), hack (>=2009.5.19), hack-contrib (>=2009.6.25), haskell98, hcheat (>=2009.6.25), mps (>=2009.6.25), mtl, network, old-locale, old-time, pandoc, parsec (>=2), parsedate (>=3000.0.0), process, time, unix, utf8-string (>=0.3.3), xhtml, zlib [details]
AuthorWang, Jinjing
MaintainerWang, Jinjing <>
Home page
UploadedSun Aug 16 16:23:02 UTC 2009 by JinjingWang
Downloads4146 total (86 in last 30 days)
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]




Maintainers' corner

For package maintainers and hackage trustees

Readme for bamboo-2009.8.16

Bamboo: a simple blog middleware on hack

Bamboo is a port of Panda, but runs on top of Hack. It's an experimental project but quite portable.


plain text as data source

|---- blog
|     |---- 08-09-01 first post
|     |---- 09-09-02 learn javascript.html
|---- tag
|     |---- programming
|     |---- funny
|---- static
      |---- About

simple config

blog_title    = C大调
blog_subtitle = 野猫不吃薯片
host_name     =
author_email  =

navigation    = About
per_page      = 7
sidebar       =
favicon       = bamboo_icon.png

hacker friendly


By it's middleware nature, bamboo could be used with other hack middleware to achieve extensibility; Bamboo plugins are also middleware, so they can be used not only in bamboo, but any other CMS like web application.


Easy install in 3 steps

1. update cabal

cabal update

2. install bamboo

cabal install happy
cabal install bamboo-launcher

3. run

mkdir myblog
cd myblog

Bird view architecture

hack-interface :
  1. bamboo-hack-compatible-layer -- bamboo-controller -- bamboo-theme
  2. [ bamboo-plugins ]
  3. [ hack-middleware-stack ]


bamboo can be customized in 3 ways:


Theme is separated from the bamboo's controller, connected through an interface and a state.

Though theme could be pure, it has the type of

data Interface = 
  | IndexFeed
  | Post
  | Static
  | Tag
  | TagFeed
  | Search
  deriving (Show, Eq)

type Theme = Interface -> State -> IO Response

This makes theme creation a relatively complex task, since a theme author basically has to do everything: from html construction to model manipulation. But since state is passed purely and return type is in IO, it also provides the ultimate safety and flexibility to theme construction, something unmatched by any main stream web frameworks. Integrating twitter? no problem, do them in IO.


Plugin is a proper hack middleware, so it works on an upper layer of the blog engine. It has all the power of a middleware, i.e. intercept request and response, and also the limitation, e.g. no idea of the underlying data structure of the app.

Plugin can be used to to do customization on the env object, or transformation to the response body. An example plugin is syntax highlighting, which could be done in the core, but would be more lightweight ( in terms of architecture design ) to be separated into a plugin.

You are hence not limited to use just bamboo-plugins to customize your blog, any hack-middleware which suite your need will do.

Javascript / CSS

In db/config/theme, you can customize precisely which js / css files to use, this allows client side customization and also lightweight configuration without compilation.