After prototyping a way to automatically integrate Roam Research into WordPress, I concluded that it’s not the best course of action.
The issue primarily lies in Roam’s default mode of expression through outlines and nested trees. This works exceptionally well for note-taking, but it doesn’t map well to final documents or web pages.
There’s also an issue of not having an extra ‘metadata’ space on individual pages. It’s possible to use Attributes in Roam to work around this. It’s still not pretty, and you’re now left with various attributes on the top or bottom of each individual page.
On getting the data out of Roam
The second option was parsing JSON export of whole roam database backup. The data structure isn’t too hard to parse. It’s still a bit annoying. You need to assemble the nodes together into a document and run it through the markdown parser. The main issue I have with this approach is that data upload workflow uploads your whole personal database to your WordPress blog. That’s a potential privacy issue, and it’s something that I would like to avoid.
Another option would be to write a local application that parses Roam JSON export and uploads only pages or blocks with allowed attributes. That’s probably the path I’ll attempt if I ever return back to this project.
Maybe copy/paste is enough
The more I thought about how to work around all of these issues, the more it became clear that my main issue is not how to publish content but the fact that it needs to get written. My workflow also evolved in the last few weeks.
I used to write directly into a text editor. I now outline, write the first draft, edit, run it through Grammarly and then somehow format it for publishing. Publishing from roaming directly into WordPress makes less sense as I would lose all of these in-between steps.
What I learned
Working on this project as a spike/prototype was a good approach. I learned about the Roam Research ecosystem, WordPress Plugin authoring ecosystem and reflected on my writing and publishing process.
Writing a short summary on my blog after each coding session also provided me with a more apparent scope that helped me to focus. Reflecting on work done and collecting links that I investigated feels like a valuable artifact that I’ll probably refer to in the future.