More reST Helpfulness
Mike Orr has this cool little howto explaining how to do various HTML markup
techniques using reST:
It's unfinished, but it's full of useful advice for beginning to think of your
plain-text layout as markup instead of trying to do everything with particular
reST and HTML woes
Well, I went through and cleaned up my old entries, using this
technique. When I was done, I decided to clean up all the entries
that were generating reST errors because reST was freaking out trying to
interpret raw HTML. I basically went through and cleaned up all of
Nutella's entries and a bunch of Sam's.
For Nutella, he essentially wrote everything as one solid block of HTML,
often with no newlines at all. So what I did was wrap most of his
entries in reST's raw html directive, like so:
.. raw:: html
<cite>blarblarblar</cite> etc etc <a
The outcome is as you'd expect:
etc etc a link
Nutella used <cite> a lot, and decimal unicode entities to print hanzi.
For Sam, he had written most of his entries in the wiki markup, using
only occasional HTML for URLs and <pre> blocks and so on. I wrapped a
few individual paragraphs in the .. raw:: html bit, but mostly I
just fixed his bad entries to be properly reSTy.
How to Fix Old Entries
So one somewhat bothersome aspect of the blosxom system is that if you
edit a file, that bumps it up to the top of the listing. This is
because pyblosxom sorts all entries by the modification time of the
There are quite a few old entries in here that could do with a few
repairs, but they really don't belong at the top of the page or the RSS
feed. So for you folks, I give you the magic of touch!
Here is an example of how to use cp and touch to edit old
entries while keeping their posting date the same:
$ cd /var/www/motd/madness/goober/
$ cp -a no-its-true.txt /tmp/old-entry
$ vi no-its-true.txt
$ touch no-its-true.txt -r /tmp/old-entry
First, the cp -a causes the file in /tmp/ to have the same exact
modification time as the oirginal file. We are actually just backing up
the modification time here, and don't care about the contents.
Then we edit the file as normal (I use vi, but I know that many folks
Finally, we use touch -r to make the edited entry have the same
modification time as our backup in /tmp/.
So this would be helpful for folks like Nutella, who need to go in and
mass-replace a lot of <br> and <p> stuff with ordinary blank lines.
If you edit an old entry, let me know and I'll give the full site build a push.
Right now pyblosxom only updates files that have brand new mtimes, so this
trick will sneak past that. I can force a full rebuild that will update
Switching to REST
I noticed nutella mumbling about the ability to check the output of his
entries. I only just realized that he was actually entering everything in
HTML, and ignoring the actual plain-text formatting that motd uses. Even his
entries that were just blank unadorned paragraphs were separated with <p> tags
instead of blank lines.
Well I've now switched laziness away from the old "genericwiki" formatter, and
over to reST. This means that shoving HTML code inline will no longer work,
and you'll have to learn reST layout in order to punch in unicode entities or
make non-trivial links. The end result, however, will be to banish those
hideous less-than/greater-than symbols from everyone's posts.
But the bonus is that you can always test by running rest2html on an entry and
checking your result in a browser.
Ha ha Wiki.
Welcome to the land of WikiWords. Now everything in StudlyCaps
becomes a GoogleSearch. (Yeah, I upgraded pyblosxom, and grabbed some
caching and formatting extensions along the way)
So after Nate threw a hissy fit and broke this thing, holding his
breath until it was fixed, I threw in an exception wrapper.
story = file(filename).readlines()
I submitted that fix upstream, so life should be good.
I have made a madness/ directory, and it is world-writable, with the tmp bit
on. This means that anyone can make a new file and play with it, but you can't
futz with other peoples' entries. I'll prime it in a moment.
I dunno how I'd manage the colored entries, really. This system doesn't pay
much attention to a file before slurping it up, so I'm not sure what styles I
could throw on in a per-directory fashion.
So I hacked up pyblosxom to support flavors in more than just the
top-level dir. You can play with them by hacking up the .html files
from /var/www/motd, and copying them to your MOTD dir. See
http://zork.net/motd/nick for an example of how I abused this, and
look through /var/www/motd/nick to see how I got this to work (and how
I made it stick in my subcategories).
I just noticed that the clock rolled back to 1am, thanks to daylight
savings ending here in California.
I'm curious as to whether or not this entry (roughly 1:05PST) will be
placed later than the previous one (1:27PDT).
So nobody should notice, but I switched from the Perl version of
blosxom to the python version. One bonus this gives is the ability to
define little filter modules to the text. I had hand-hacked in the
blank-lines-separate-paragraphs bit to the Perl version, but I've been
able to do still more by simply hacking pyblosxom to use a default
It can cache the files if things get too slow, but I don't imagine
that will happen.
The most notable changes are that URLs such as http://www.lnx-bbc.org/
and http://www.lnx-bbc.org/logo.png will be translated (the second one
was "http://www.lnx-bbc.org/logo.png", and the URL has to be separated
by whitespace -- I may add angle brackets or something to the mix at
Also, you can do emphatic text with the application of asterisks.
(that was just "emphatic text" -- again, spaces make the magic
Spam spam spam spam
Okay, sorry folks. I was just testing out blagg. You can look at
~nick/.blagg for a sample config file. It's probably not all that
useful, but you can just set the thing up to troll various sites and
slurp in articles.
I really only installed it for completeness, but I should have
probably made a subdir for the stuff before I started monkeying.
But that <a
entry</a> is actually the book I'm reviewing.
I figure I'll post it once enough of the wrinkles are ironed out. It
looks like <a href="http://zork.net/motd/muse">muse</a> and <a
href="http://zork.net/motd/inkblot">inkblot</a> managed to use the
script to set up their dirs, so things are probably about ready to
This is partly just a neat little hack that I'm using as part of the
research for an article, but at some point this will reach a level of
functionality where I figure it could be a useful fixture for zork.
I'm interested partly in installing blagg and seeing how to integrate
that into a multi-user environment. The blosxom stuff was mostly
written with a single-user MacOSX system in mind, so I'm playing and
Note that there's also a <a href="http://zork.net/motd2">python
version</a> of this software that supports the same data files. the
difference is that I added the one-line hack to get the
blank-line-denotes-paragraphs feature to the perl version, while the
python system has a more elaborate parser setup that I have yet to
fully work out.
At any rate, I'll play and fiddle for at least a week yet.
The script enforces a bit of policy by making the user's subdir and
giving the file the appropriate .txt extension. Did you know that you
can type "motd tinkerbell" and it'll make a tinkerbell.txt file?
Of course, it's not as powerful as simply editing the files yourself.
It can't do sub-subdirs, for example (all slashes get turned to
underscores). But it's good for getting folks to make entries off the
Did you know you can make subdirs of your personal dirs, and
categorize your entries thusly?
another motd test
Wow, this stuff is coming along, eh.
I'm playing with my new fancy motd script, which makes new entries in
your motd dir.
Neat like my feet.
I'm also playing with pyblosxom, which promises more advanced
But it doesn't seem to actually work.
Trying blank-line munging.
Let's see if this does the trick...
Starting it up
So I've been writing this big article on why diaries are not weblogs,
etc, and blosxom was the only free software it listed.
I'm a little irritated that I have to type in HTML, but I may just
throw a big PRE tag in.