zia

...now on my laptop...

Wednesday, 2003-3-19

Wrapping bzero to add features

In my Radio Weblog, I manually create and maintain a
table of contents. I'd like to do the same thing for
my bzero weblog; I think it will be easier to automate
than the Radio one would be. Simply replace the
BZERO_EDITOR with a script that waits for the editor
to exit, and then indexes the new entry (if indeed it
is new).

Then I got to thinking about Mark Pilgrim's announcement
today of a Python version of Textile, which I suspect I
could hack into my bzero routine without a whole lot of plumbing.
Although I don't have the source to bzero,
bzero does use the OS filesystem as its database,
so it's much more accessible than in some other tools.

So here's the idea: for my BZERO_EDITOR, I write a
small shell and/or Python script, which would do the following:

  • take the given filename (e.g., data/2003/3/19/2.txt),
    and check to see if it's the raw "empty" file;
  • if so, let me edit a new parallel file (e.g., rags/2003/3/19/2.rag);
  • then once the underlying editor exits, check to see if
    the rags file is newer than the data... file, and if so
    copy it over;
  • if the data... file was not the raw file, check for the
    existence of the corresponding rags file; if none exists,
    just edit the data... file directly. If a rags file does
    exist, then just assume that it is better than the data...
    file and run the preprocessor to re-create the data... file.
  • Finally, if the file was new, add its title into the
    table-of-contents file. That's where it makes sense to
    use one of the template substitution engines
    (as long as I'm running at least one Python preprocessor
    anyway), e.g., YAPTU or XYAPTU or a fancy one like Cheetah,
    to insert the TOC into a new HTML page.


Can I write this in the car on the way south?

Comment on this post [ so far]

Dyer predictions

These days, shouldn't everyone whose surname is "Dyer" be in the business of prognostication?

[See AMK's diary.]

Comment on this post [ so far]