Third Post; New Blog Engine

➲  Date: Tue, 26 Apr 2011 09:28:20 +0200; Tags: [ocaml; meta; dibrawi].

I got quickly annoyed by Wordpress' interface, and by the engine itself, and by those ugly themes, and … OK, let's stop bad-mouthing other people …
‘On n'est jamais mieux servi que par soi-même
I added a Blog module to Dibrawi's helper interface for Camlmix. Let's say Dibrawi is a Wiki engine under heavy development, based on the Bracetax syntax, bibliography management with Sebib, and other stuff (e.g. an address book). It has a wiki default running mode, which only converts the wiki pages, the bibliography, and the address book to HTML. The wiki mode is fast and seems secure(or at least it is more secure than any other wiki engine I know …). On the other hand, each page can be preprocessed separately (locally, on command line) while activating OCaml code (Camlmix). This code will be compiled and run to generate whatever the user wants (like a web site, or a PDF). In wiki mode, the OCaml code is just displayed as code or ignored.
Henceforth, this new blog engine is a nice occasion to start showing some of the ideas behind Dibrawi. With some OCaml code one can quickly and easily generate a static blog (which uses Disqus as comment system). The bunch of HTML files together with the RSS feeds can be uploaded to any hosting facility (like GitHub ;–)).
The idea is to play with the Blog module's functions (and the rest of the dibrawi library) to generate a full blog. Here is a full example:
Once the framework is set up, each new blog post is just some text enclosed between blog#new_post and blog#end_post calls, e.g.:
{mix:code} blog#new_post 
  ~title:"Anyweb, Document Source Code The Way You Like"
  ~date:"Tue, 19 Apr 2011 21:26:42 +0200"
  ~tags:[ "hack_of_the_day"; "anyweb"; "coq"; "ocaml" ]
  "anyweb-document-source-code-the-way-you-like"
{mix:end}
 
I was playing with Adam Chlipala's
{q|{link http://adam.chlipala.net/cpdt/ |CPDT}} book
and I wanted to take notes on some notations.
I also wanted to do it in a
 
  # Quite a lot of text ... 
 
{mix:code} blog#end_post {mix:end}
Each time, generating the blog is as simple as calling dbw with the run command:
dbw run path/to/Blog.brtx 
and that's all for today folks!

blog comments powered by Disqus

Sebastien Mondet


Menu:




Site generated thanks to bracetax, camlmix, sebib, and more …
Updated on Sat, 10 Dec 2011 12:46:34 -0500.
Sebastien Mondet

Powered by Caml