Rachel Has Problems

Markdown support!

It's done! My blog now uses markdown for post formatting!

If you haven't seen my previous post (Hindsight is a wonderful thing) then I would recommend that you read that before continuing. In short I wasn't happy with how my blog system formatted the posts, and how my propriety post editor functioned.

Over my 2024 Christmas break, I sat down and implemented Markdown to my blogging system. 1 Thankfully these changes didn't require any modifications to the database and so it was actually reasonably straightforward to implement. The editor now is a lot simpler compared to the previous iteration, so much so that now it is a single text box. Perhaps it's a bit too simple, as there's no WYSIWYG editor, or any shortcut buttons to implement formatting. It's something to add to the to do list.

Screenshot of the new post editor using markdown formatting (it's just text boxes!)
Screenshot of the new post editor using markdown formatting (it's just text boxes!)

On the post page side of things I had to implement a parser to render the markdown accordingly, and also had to work out a way to take text summaries for the index page and RSS but this wasn't too difficult. Perhaps the most time consuming part was converting all the old posts from the legacy post format, to markdown. I could have written a script to carry out these conversions, and I kind of half did, but because I only had a few posts on my production server I decided that manually going through and re-saving the posts to a markdown format was reasonably acceptable. As I said, I did half implement a conversion script, so when I was re-saving the posts the system did do the legacy to markdown conversion for me, I just had to press the save button.

All in all the new editor is a lot more flexible and thus makes the rest of the blogging system a lot more flexible as markdown is a widely adopted formatting standard so if I wanted to feed posts into other software (such as a mailing list for example), it can take the raw post data and format accordingly, or I can create an interface to manipulate the post data in whichever way to make it understandable to that software. Failing all of that, raw markdown is actually reasonably straightforward to read.

Most markdown features are supported in accordance with the latest CommonMark specification at the time of writing (0.31.2) 2, and certainly all basic/essential formatting is implemented, such as headers, lists (unordered and ordered), horizontal rules, images, code blocks to name but a few. I have however included some additional "non-standard" tags to allow for easier embedding of web objects (YouTube and Spotify are only supported for now)

To embed that YouTube video, I simply use <#youtube:[video_id]> which I think is pretty neat!

So what's next? I don't plan on implementing any additional features for now as there is a level of functionality. I do need to do some quality of life updates to the code, remove duplications and generally tidy it up. As I found out whilst implementing these changes, some comments are also desperately needed. Once all the code base is in a better place, there are a couple of items I would like to address, one being the previously mentioned primitive editor (adding in some insert buttons for formatting tags for instance) and the other being increasing the functionality of the site library manager. These aren't urgent though, code tidy up first!

My intention for the blog was never for it to become a changelog, so hopefully there will be some more entertaining posts soon. I do have a couple of retro computing projects coming up so stay tuned for those!

Rachel x


  1. In case you weren't aware, this blogging system/software is custom written by myself including the CMS back end. The system/software doesn't yet have a name either. 

  2. CommonMark 0.31.2 Specification 

This post has been tagged with the follwing tags: