QZ qz thoughts
a blog from Eli the Bearded
Tag search results for blosxom Page 2 of 4

Improved Tags Plugin


First major revision to the aaa_tags plugin. Several new features with this.

  1. AND search for multiple tags. Use ^ to separate tags.
  2. OR search for multiple tags. Use | to separate tags.
  3. NOT search for excluding tags. Prefix with ~ to exclude.
  4. All of those can be (crudely) combined for a complex search. Use , to combine them.
  5. Multiple uses of tag= CGI parameter allowed, if individual words, they will be considered an OR list.
  6. UTF-8 tags are now allowed.
    Tags can be ASCII letters, numbers, hyphen and underscore, plus any Unicode codepoints above U+00A0 (A0 is non-breaking space; that is not allowed in tags).
  7. If there are stories before filter() but the tag search has removed them all by the end of filter(), then story() will (attempt to) display an error page. Due to the way date filtering works in blosxom, story() may not get the chance. But it works for date unfiltered stuff.
  8. New template for that error: aaa_nothing_left
  9. New interpolatable variables.
    • Configuration parameters $aaa_tags::top_count and $aaa_tags::threshold
    • $aaa_tags::frequent_tags has a list of tags, much like the old $aaa_tags::top_tags, but alpha-sorted and a list of all tags with more than $aaa_tags::threshold uses.
    • $aaa_tags::this_search_terse has a value suitable for stuffing into a tag= CGI parameter for repeating the current search. Can be used anywhere.
    • $aaa_tags::this_search_verbose has a text description of the search, only for use in the error template.
    • $aaa_tags::this_search_table has a table of usage frequencies of the tags in the current search, only for use in the error template.

This is a lot of new code. There are probably bugs lurking in all of this. I've only done cursory testing, but I've been very happy with the results.

Reviews from 2020
/qz/blosxom?tag=review^2020
2003, 2004, 2005, 2006, 2007, and 2008 posts without "deadlink" tag (but see below)
/qz/blosxom?tag=2003|2004|2005|2006|2007|2008,~deadlink
Posts from 2020 not tagged with "blog"
/qz/blosxom?tag=2020,~blog
Blosxom or "administrivia" posts, as two tags
/qz/blosxom?tag=blosxom&tag=administrivia
UTF-8 tag, unique to this specific post.
/qz/blosxom?tag=utf-8✓
A search that will return no results.
/qz/blosxom?tag=blog,~blog

Testing this has made me realize (a) I've got a real problem with bad "deadlink" tagging, as in posts that should have that tag don't; and (b) the deadlink test was kinda flawed in that in only looked for 200 responses so sites that redirected http: to https: got mistakenly flagged. I need to fix both of those issues before the results of the example deadlink search reflect what really should be called deadlinks.

Post Filter


So I started working on a method to compose posts better, for my idea of better at least. Version one of qzpostfilt (and a README and some test code) is available in the git repo and browsable here.

It's a mis-mash of Markdown and nroff/troff style commands. I picked what I thought the easiest to remember and to type on a phone keyboard methods of composing my posts would be. Basically you have markdown style inline formatting for bold, italic, code and *roff style formatting for more block level stuff. As a general rule: .foo creates <foo> and you need to explicitly close your ./foo.

my xterm composing this post

It ends up looking more like *roff than markdown.

I see this as the first step towards a composing tool. I'll also need a CGI wrapper for phone use and a command line wrapper to help with tags. As of today, it's more of a :% !qzpostfilt in vi sort of thing.

Also in blosxom blog news, I've changed the html flavor templates slightly and made changes to the CSS file mostly to better support reading on small screens, but also for a <ul> class to use in recipe posts.

Lastly, I added another two dozen logos to the mix. Previously there had been 146, so it's up to 170 now. I don't recall how I created the first logos, this time my method was to type "QZ" in libreoffice, change the font size to 180, and then go through the fonts I have installed, screenshotting all the interesting ones. I next very roughly cropped the images so that each QZ was alone on a white background. From there I started scripting the work.

# for every png file, convert to ppm (RGB color), auto-crop a white border,
# convert to pgm (grayscale), rescale so ysize (height) is 100 pixels,
# convert to png making white (and only exactly white) transparent, saving
# that result in the "new" directory
for f in *png ; do pngtoppm $f | pnmcrop -white | ppmtopgm | 
   pnmscale -ysize 100 | pnmtopng -transparent =white > new/$f ; done

(That's something I need to add to qzpostfilt: a <pre> handler. Todo. Hand fix for now.)

A second, messier, pass with identify got me the files renamed to look like "linux-biolinum-keys-h100-w205.png" instead of "linux-biolinum-keys.png". My randomlogo plugin uses the height and width information when available.

Ides of March Patch


The Ides of a month in Roman counting is where they switched from counting days up in a month to counting days down. The Ides of March was also the day newly elected leaders took office. Julius Casear declared himself Emperor, no longer an elected leader, and the Ides was thus a fitting day to be elected dead.

On a totally unrelated note, I have a new patch ready.

This reorders some code, to ensure the &$interpolate() configurable function is available early. I'll use it in filter() in my new tags plugin (probably ready tomorrow). I've also fixed a bug that was sometimes doubling up the last post on a page. I didn't bother figuring out how code execution gets there, just added next; to restart the loop if it happens. I don't know if that only occurred because of my plugins, or if it was a long standing bug in blosxom for everyone.

I also removed the place were it sets -quiet as a param, I don't think that was used anywhere, but it caused it to be added to CGI parameters.

Lastly, I modified the version number in the code.

A new pagination plugin


I found my "round tuit" and rewrote the old paginate plugin to include the features of cooluri, thus superceding my modified versions of both of those (paginateqz-v0.10, nowcooluri-v0.2).

The new paginateqz handles both at once allowing me to have the "newer" and "older" pagination links on permalink pages, and those links go through posts a single entry at a time. This is the feature I really wanted. It works just like a real blog now!

At the same time I added some features. There's a new interpolation variable $paginateqz::np_sep which is a separator only set when next and previous links are set. The template filler in paginateqz now is respectful of how you may have a plugin to find templates (spoiler, I do) and how you may have a plugin to do interpolation (I do not).

Next up will be a tagging plugin. I have a draft which can find and display tags, but it does not let one search by tags, yet. I also need to actually go and tag posts for it to be useful. After that, I'll have all the features I find essential. Non-essential, but nice to have, will include searching and comments. The comments one is hard because of spammers. Tags that search takes me to 80% value of complete search, I think.