8 August 2021

Weekly Project Update 5

I think writing these updates are helping me stay disciplined to work on this project. There have been times during the last few weeks when I felt like working on something else, and there has been a day or two that I’ve done just that, or have not worked on anything at all. But I think the unwillingness to arrive at this scheduled post time on Sunday with nothing to write about is motivating enough to actually get some work done.

On to this week’s update.

Day One Sync

Slightly shorter post this week as the details of what I worked on this week would be slightly tedious to write about (and probably read about). I spent the week working on the UI a bit, mainly on finalising the layout of the feed configuration details view. I’ve converted the UI from springs-and-structs to a constraint-based layout. Getting this working took a bit of effort, and I’m a little concerned about how easy it would be to maintain and modify this UI going forward, but for the moment I’m reasonably happy with this layout.

Day One Sync window with the new layoutDay One Sync window with the new layout

The engineering behind the UI is still outstanding. At present, only the feed URL, journal name and tags controls work. The checkbox to download images is being save for the feed, but the actual value is currently being ignored. The rest of the controls do nothing, and getting them working will probably be the last things I do for the UI, just because of the fiddly details involved in updating them dynamically. I think the libraries I’m using for HTTP and events would help here. As you can see, I haven’t made any changes to the sidebar yet.

I said I wouldn’t work on the core last week, but after dealing with the UI layout, I needed to work on something that felt a bit more like coding. The HTML-to-Markdown converter needs a fair bit of work. At present, the tool is parsing the HTML content from the RSS feed, and converting it directly into a Markdown string on the spot. This sort of works, but it’s a bit of a hack job and maintaining it going forward would be difficult. It’s also inflexible: if I wanted to change the generated Markdown in some way, I’d have to hack it up in the generator, making it even harder to maintain.

So I spent some time last week working on an intermediate representation of the generated Markdown that can be built from the HTML parser. This intermediate representation of the generated Markdown is just an object graph, making it relatively easy to modify one it is built, and it itself can be used to generate the Markdown string. This essentially changes the processing flow from HTML → Markdown, to HTMLIR → Markdown. Already this is producing a more correct version of Markdown with support for things like ordered lists, something that the existing Markdown generator does not handle. This is not quite finished, and I need to integrate it with the HTML parser, but I’m reasonably confident that this wouldn’t be too involved.

Along with the work done above, I’m doing a bit of dog-fooding by importing posts from the various feeds I publish into Day One. Now with the IFTTT integration disabled, this is the only way that I can get my blog posts into Day One, so I have an incentive to make sure this tool works. The posts are just going into a test journal at this stage, and I’m manually moving the posts I’d like to keep to the production” journals once they’re imported. I’m not really stressing it at this stage, but so far no major issues apart from the lack of full Markdown support for things like lists.

That’s all for this week. Until next week.


Projects


Previous post
🔗 How Shopify Uses WebAssembly Outside of the Browser A fascinating post on how Shopify is using WebAssembly as a runtime container on the server
Next post
Weekly Project Update 6 Oh dear. I wish I had a decent update to write this week. The truth is that not a lot of what I’ll call “deep work” was done. I’ve been spending