Todos

I've posted a few todo lists now and again, especially as I was--but like most weblog content, it eventually scrolls off and is usually not thought of. So I went back and looked at my several todo lists, removing what I did. Here's the remainder, perhaps rephrased and perhaps clarified:

  • markpasc.org weblog colophon.
  • Radio news sorter. Still tinkering with it; it's diverged enough into its own special code that I doubt it'll be part of Kit, but rather a separate tool. Hopefully I can find a way to make them interoperate if you install both, but I haven't looked at that at all.
  • Stapler.py. I decided I was going at it too high-level, and will probably start up with something rather more like Cheesegrater and then abstract into the full Stapler.root feature set from that.
  • Kit: LiveJournal-like <lj-cut/>, if possible; sane permalinks; and a fixed HTML nester (it has odd output for some items).
  • Kit news things.
    • <pre/> neutering.
    • content:encoded support.
    • Mark feeds for deletion.
    • "Hide news posts containing" option.
  • Movable Type things.
    • MT HTML tidying plug-in. I forget if someone wrote this already.
    • Referrer listing. Still think an app that finds and verifies referrers then posts them as TrackBacks would be a nice uninvasive solution.
    • Entry Contents plugin: "For most posts, return the usual 300 words tag. If there's no Excerpt--that is, if MT is generating the post's excerpt from, say, 10 words of the entry content--say 290 more words instead. If the post also had images, say something like 290 more words; 2 images." This will be pretty easy now that I know how to make plugins.
  • Todo list in weblog sidebar, to obviate the need for lists I have to find and recap every so often.

One of the things was a "reheader" plugin for Movable Type that would let you use <h1/> and such without worrying about what's in your . You can put the code below in a rehead.pl in your plugins directory, then use tags like <$MTEntryBody rehead="3" smarty_pants="1" apply_macros="1"$> to, eg, turn <h1/>s into <h4/>s, such as if your item titles are <h3/>s like mine. So the parameter is the last header level you used above the entry.

Don't forget to use it on your <$MTEntryMore$>, especially since that's where you probably have headers, if you post like I do. This plugin is public domain.

#!/usr/bin/perl
use MT::Template::Context;
MT::Template::Context->add_global_filter (rehead => sub {
    my ($content, $top) = (shift, shift);
    $top =~ s/^h//i;
    $content =~ s{<(/)?h([\d])}{"<$1h". ($2 + $top)}ge;
    $content;
});