Tag Archives: story engine

More on the story engine

I started working up the story engine last night in Ruby. Greg suggested that XSLT would be perfect for it if I stored my stories as XML. Do a simple transformation, and voila, a story in XHTML with layout and everything. I was hoping I could knock it out in a single evening.

Turns out Ruby and XSLT are two more separate critters than I thought — there’s no default library to handle it, and the three or so available are older and lack documentation. Better yet, the one easily available as a gem doesn’t use Ruby’s nice REXML, it uses LibXML.

Combine all that with never having used XSLT before, and I’m in for some annoyance. Drat. Then, if I want any WP integration (like searching, for instance), I’ll need to write a WP plugin of some sort.

I think I’ll switch to writing a WP plugin. 🙂

Story engine

I’ve always loved the simplicity and pleasantness of whatever must be under the hood of Elf’s stories — he seems to have easy management of story arcs, multiple sortings of stories, multiples sets of stories, next and previous buttons within stories, etc.

I’m debating how I want to build my own little story engine. Right now, my stories are in WordPress, published as page. One avenue I could take would be to write a WordPress plugin to allow me to manage stories the way I want — keep them as pages, but add the fluff I want.

Another avenue would be to roll my own — make a separate little system in Python or Ruby, whatever. Not a web-based system, but a system that just parses the stories into HTML files based on when I want them published, and lets me do all the features above. Have it run daily as a cron job.

I don’t know how much I want to tie myself to the WordPress monolith — for instance, it’d be nice to have the pages be static HTML without explicit caching. But a WordPress plugin would be something others might be interested in.

Then again, mucking around in other people’s code is likely to be messy. And less fun. And still in PHP.

Sounds like I may do the standalone system.