Reducing Friction


A month ago I said I was planning to blog regularly. A month ago. So I’m not there yet, but clearly making progress, considering my last post before that was in 2012.

In the process of publishing that entry and the note linking to it, I ran into a limitation of my Web preprocessor. It works by recursively transforming a source directory tree into a new directory tree. Most files are copied as is, a few are ignored, and certain filenames indicate that special treatment is required: A name of "+foo.html.md" is interpreted as Markdown and generates foo.html; "@bar.html.pl" is executed, and its output is captured and interpolated into bar.html. In the former case, the filename extension is used to select a conversion routine. The "autodir" converter generates a simple directory index. In order to provide year, month, and day directory listings, I had to create a "+index.html.autodir" file for each, for a total of six empty placeholder files to two files with actual content.

Unsurprisingly, this gets old rather quickly. Having to create a new placeholder file every day I’d write an entry is a mental drag, even if the actual activity takes just a few seconds. My intention to fix this soon gave me even more of a reason to put off writing.

(There’s a considerable difference between having to create new directories versus new placeholder files. Besides needing only one mkdir -p command to create them, directories aren’t tracked by Git. Placeholder files have to be added either to their own commit or one shared with content, adding visual clutter either way.)

Today I revised the preprocessor to apply directory index generation recursively. I expected this to be a simple matter of programming, but it wasn’t — a small mental shift was required: Previously, content generation was on a per-file basis. Now, the presence of a .autodir file indicated a property of the directory containing it, not just a single file. Also, there are explicitly written indexes underneath directories with auto-generated ones, so implementing an override was required before making the autodir property recursive.

I’m sure this won’t be the last issue I have, but it was the only mental roadblock I can recall troubling me recently, so look forward to more entries coming soon.