2018-07-22

mdlbear: the positively imaginary half of a cubic mandelbrot set (Default)

Not a particularly productive week, especially on the job front: one application, some email, a phone conversation, and setting up another phone conversation for this week. I have made some progress on software; the React web app I started last week is basically working, and just needs some CSS cleanup and refactoring before I won't be embarrassed to link to it. (At which point I'll have to figure out just how to deploy it, but that's another matter.)

The React app is partly aimed at adding a marketable skill to my repertoire, and partly at giving me something (a related phone app, using React Native) that I can potentially sell. Because I don't want to count on being able to land an actual job. It's no longer a given, at my age.

React is an extremely popular Javascript framework for building "single-page (web) applications", usually abbreviated SPAs. It's pretty good as such things go, and lets you use functional programming for almost everything. It gets confusing when you actually need to manage state; I eventually figured out that you have to put all your state in one place, in a top-level object that only gets created once.

It's also been pointed out (thanks, [personal profile] texxgadget!) that I should pull my entries tagged with curmudgeon together into a book. That's always been the plan, actually; the only question is how long it would take me to do it. See above about "not particularly productive". I have wasted a lot of time over the last year. (Some people are no doubt going to point out that I've also been recovering from a bad case of burnout; that's true but doesn't keep me from being annoyed at myself about it.)

An intermediate step in that program is mirroring my computer-related blogging to someplace other than DW; Stephen.Savitzky.net is the obvious choice. I've made a little progress with setup there, but I got stuck a week or two ago trying to find a templating engine I can stand. The other possibility is a GitHub blog.

I had a lot of fun yesterday going to the Whidbey Island Area Fair with C and N. N came up Friday night and stayed in what used to be her bedroom, where we've set up an airbed.

Other activity for the week included a trip to Coupeville so C could have labs done and her PICC line taken out, and two trips to the mainland: one for C's urology appointment, and the other for dentist appointments for both of us. The urology appointment is always a good excuse to visit the Mexican restaurant across the parking lot. They have salsa mole. C's labs showed that her kidneys are continuing to recover, but her potassium is low. We went home and ate bananas, potato chips, and baked potatoes.

Neither of us has anything scheduled for this week, so I may take an opportunity to go down and visit the other end of the caravan. Tuesday might work.

Notes & links, as usual )

mdlbear: (technonerdmonster)

In comments on "Done Since 2018-07-15" we started having a discussion of mirroring and cross-posting DW blog entries, and in particular what my plans are for implementing personal blog sites that mirror all or some of a -- this -- Dreamwidth journal.

Non-techie readers might conceivably want to skip this post.

Where I am now:

Right now, my blog posting process is, well, let's just say idiosyncratic. Up until sometime late last year, I was posting using an Emacs major mode called lj-update-mode; it was pretty good. It had only two significant problems:

  1. It could only create one post at a time, and there was no good way to save a draft and come back to it later. I could live with that.
  2. It stopped working when DW switched to all HTTPS. It was using an obsolete http library, and noone was maintaining either of them.

My current system is much better.

  1. I run a command, either make draft or, if I'm pretty sure I'm going to post immediately, make entry. I pass the filename, without the yyyy/mm/dd prefix, along with an optional title. If I don't pass the title I can add it later. The draft gets checked in with git; I can find out when I started by using git log.
  2. I edit the draft. It can sit around for days or months; doesn't matter. It' an ordinary html file except that it has an email-like header with the metadata in it.
  3. When I'm done, I make post. Done. If I'm posting a draft I have to pass the filename again to tell it which draft; make entry makes a symlink to the entry, which is already in a file called yyyy/mm/dd-filename.html. It gets posted, and committed in git with a suitable commit message.

You can see the code in MakeStuff/blogging on GitHub. It depends on a Python client called charm, which I forked to add the Location: header and some sane defaults like not auto-formatting. Charm is mostly useless -- it does almost everything using a terminal-based text editor. Really? But it does have a "quick-post" mode that takes metadata on the command line, and a "sync" mode that you can use to sync your journal with an archive. Posts in the archive are almost, but not quite, in the same format as the MakeStuff archive; the main difference is that the filenames look like yyyy/mm/dd_HHMM. Close, but not quite there.

There's another advantage that isn't apparent in the code: you can add custom make targets that set up your draft using a template. For example, my "Done since ..." posts are started with make done, and my "Computer Curmudgeon" posts are started with make curmudgeon. There are other shortcuts for River and S4S posts. I also have multiple directories for drafts, separated roughly by subject, but all posting into the same archive.

Where I want to go:

Here's what I want next:

  • The ability to post in either HTML or markdown -- markdown has a great toolchain, including the ability to syntax-color your code blocks.
  • The ability to edit posts by editing the archived post and uploading it. Right now it's a real pain to keep them in sync.
  • A unified archive, with actual URLs in the metadata rather than just the date and time in the filename.
  • The ability to put all or part of my blog on different sites. I really want the computer-related posts to go on Stephen.Savitzky.net (usually shortened to S.S.net in my notes), and a complete mirror on steve.savitzky.net (s.s.net).
  • Cross-links in both directions between my sites and DW.

How to get there:

Here's a very brief sketch of what needs to be done. It's only vaguely in sequence, and I've undoubtedly left parts out. But it's a start.

Posting, editing, and archiving

  • Posting in HTML or markdown is a pretty easy one; I can do that just by modifying the makefiles and (probably) changing the final extension from .html to .posted so that make can apply its usual dependency-inference magic.
  • Editing and a unified archive will both require a new command-line client. There aren't any. There are libraries, in Ruby, Haskell, and Javascript, that I can wrap a program around. (The Python code in charm doesn't look worth saving.) I wanted to learn Ruby anyway.
  • The unified archive will also require a program that can go back in time and match up archived posts with the right URLs, reconcile the two file naming conventions, and remove the duplicates that are due to archiving posts both in charm and MakeStuff. Not too hard, and it only has to be done once.
  • It would be nice to be able to archive comments, too. The old ljbackup program can do it, so it's feasible. It's in Perl, so it might be a good place to start.

Mirror, mirror, on the server...

This is a separate section because it's mostly orthogonal to the posting, archiving, etc.

  • The only part of the posting section that really needs to be done first is the first one, changing the extension of archived posts to .posted. (That's because make uses extensions to figure out what rules to apply to get from one to another. Remind me to post about make some time.)
  • The post archive may want to have its own git repository.
  • Templating and styling. My websites are starting to show their age; there's nothing really wrong with a retro look, but they also aren't responsive (to different screen sizes -- that's important when most people are reading websites on their phones), or accessible (screen-reader friendly and navigable by keyboard; having different font sizes helps here, too). Any respectable static site generator can do it -- you may remember this post on The Joy of Static Sites -- but the way I'm formatting my metadata will require some custom work. Blosxom and nanoblogger are probably the closest, but they're ancient. I probably ought to resist the temptation to roll my own.

Yeah. Right.

Another fine post from The Computer Curmudgeon.

Most Popular Tags

Style Credit

Page generated 2019-04-23 02:40 am
Powered by Dreamwidth Studios