A Blog for Pod People
This is the second entry in my new blog, which was previously hand-written. If I want to add another page, this now involves some copying and pasting.
And so it seems we've reached the stage where automating this comes into play.
I could probably just do what a "blog engine" does by hand: Create a "blank" HTML file with just the basic formatting, copy that for each entry and fill out the main content. Don't forget to add the title etc.
I certainly thought about this, but decided that I'd rather start some coding. After all, every programmer's blog is supposed to be over-engineered, and doing this is currently my primary source of creating blog entries in the first place.
Dependency hell
At work, I'm currently doing a lot of web stuff, too. But here we're talking proper over-engineering, with Java- and Typescript-based backends.
One thing you really notice there, is how many dependent libraries and whole frameworks you start to pull in rather fast.
So I decided that I won't do this here, for as long as humanly possible.
But what does that leave me with? I'm mostly working in a Unix-type environment, so I guess things like a shell or some basic text-processing command line tools are a given.
Writing anything longer than 15 lines isn't really fun in shell, though.
So I decided to pick Perl. I'm used to it, a lot of Unix systems have it in their core, and once you install git, it's in there, too (which means that for Windows systems, I don't even have to go all WSL).
Perls in a POD
One thing that comes with every Perl installation since the dawn of time is its own documentation system, called POD – Plain Old Documentation.
It's used mainly for explaining the code itself, not for a lot of writing outside of this. But it works for avoiding to write HTML as well as it worked for writing TROFF back in the days.
In use, it looks a bit like this:
=head2 A Blog for Pod People
This is the second entry in my new blog, which was previously hand-written.
If I want to add another page, this now involves some copying and pasting.
If you want to emphasize text, you can write that with
I<italics> or B<bold>
Verbatim blocks like the above are just indented (similar to markdown), support for lists is a bit lackluster and images aren't plain enough – I just write literal HTML for this.
This is all done with the pod2html command line tool that comes with Perl, but if I ever need to go beyond that, I can hook into a lot of Perl modules to extend this. Neat!
Tying things together
pod2html just gives me basic HTML output, so I needed to write a script that puts these into a basic HTML wrapper (more important in future days), writes a list of all articles on the front page, and generates the RSS feed.
All this as simple as possible. I have two articles as of now, so I don't need to write an article list by months, or only put the last 20 items in the feed. There's also little styling, so no need to integrate that in the setup. It's under 200 lines of code, and it's probably going to stay that way for a while.
I'll put it in a public repository once it's not as embarassing.
Status Quo
Other News
My media diet, where I only listen/watch state-funded German media works quite well.
I've listened to more political podcasts for Germany for a change (I've subscribed to quite a few British ones in my regular podcast app), and I've watched a whole dubbed movie!
A Few Good Men worked quite alright, though. Nicholson's German voice is gravely enough, counter to the usual tendency of having a lot of squeaky voice actors in play.
I'm also using my vacation time to set up my office, although I'm typing this from my 10-year old Macbook Air, as with limited floor space – and limited parter patience – it's a bit like Sokoban when you're moving your properties around. Currently I'm in the stage where the office floor and my chair are occupied. Should get better tomorrow.
I also discovered that I now have 16 computer mice and trackballs. Yikes.