Writing WordPress blog posts with WordStar and Ulysses
Tags: rust, programming, showdev, macos
Published: 2023-08-26 02:59:23

The WordPress editor sucks. I'll wait for the audience to applaud before I continue.

So: the WordPress editor sucks. The fact that Automattic tries to define the really bad ["Gutenberg" editor](https://www.wp-tweaks.com/reasons-switch-gutenberg-wordpress-editor/), which is undoubtedly aimed at designers and not writers, as the _new default_ instead of the existing (admittedly: somewhat boring) text field, with which one could _just write_, in no way diminishes this judgement.

As someone who _just wants_ to write, I can do little with this exhausting lack of understanding of _how to write_. No, to _write_ I don't need _content creator_ tools, to _write_ I need a _writing_ tool.

For a long time I have been using [Ulysses](https://ulysses.app) on macOS to be able to write longer blog articles without completely losing the desire. Ulysses is essentially a Markdown editor that also provides a "Publish to WordPress" functionality; so I write my texts in Markdown, then press a button and have them formatted halfway reasonably in the WordPress editor field in front of me. This could also be done with GNU Emacs, but GNU Emacs doesn't work so well on the smartphone on which I sometimes maintain text drafts.

Unfortunately, while Ulysses provides a _less poor_ writing environment than WordPress itself, Markdown is not exactly the holy grail of word processing. How nice it would be if even bloggers could make use of a _real_ word processor!

Good word processors, however, are hardly common. In _my_ circles it is common to use either [the sham dead](https://blog.documentfoundation.org/blog/2023/08/21/libreoffice-7-6-community/) LibreOffice or the horrible Microsoft Office, but my understanding of a good word processor does not include horrible "innovations" like context-sensitive (i.e. non-intuitive) toolbars. This brings us to WordStar, the word-processing software that George R. R. Martin uses to write incredibly boring fantasy novels. WordStar - more precisely: the free [WordTsar](http://wordtsar.ca) - would _actually_ be a suitable candidate for such a _real_ word processor. But WordPress can't do anything with WordStar files (and fortunately not with RTF either), so I'm glad that I "can" code.

So I spent some time studying the [WordStar file format.](http://justsolve.archiveteam.org/wiki/WordStar) It quickly became clear: I _could_ just run regular expressions over the code, but a parser would be more elegant. The result is [`ws2markdown`](https://code.rosaelefanten.org/ws2markdown) (I'm really not good at making up application names, but the name can be changed at will), which is written in Rust because I wanted to give [Pest](http://pest.rs) a try ([worked well](https://code.rosaelefanten.org/ws2markdown/file?name=src/wordstar.pest&ci=tip)). The _grammar_ is certainly not yet to be considered complete, but it covers the capabilities of Markdown in my opinion. Additions - preferably with real examples - are welcome. So far I have tested `ws2markdown` only with WordTsar 0.3.719, it cannot be excluded that other versions of WordStar have other file formats.

So a new possible workflow looks like this: The text is written (minus links and images, neither of which is supported by the WordStar format) with WordTsar, converted with `ws2markdown`, then formatted in Ulysses (or any other markdown editor that "can do" WordPress) and uploaded.

While this sounds incredibly cumbersome, it is still less of a pain in the ass than the WordPress editor and can theoretically even be used for static blogs that rely natively on Markdown. Maybe someone will need it some day.

----

*(Originally posted in German on [my blog](https://tuxproject.de/blog/2023/08/in-eigener-sache-aus-wordstar-in-markdown-konvertieren/).)*

Note that the local staff still does not allow me to post comments here. I will gladly accept feedback here, you can find further contact channels [here.](https://keyoxide.org/tux0r@rosaelefanten.org)