Tuesday April 12, 2022; 9:42 AM EDT
- TL/DR; Dave's post today about giving writers choices got me thinking about publishing from Drummer in that context. What follows is my thought process, and I currently conclude that a step to make Electric Drummer closer to modeling this choice is additional scripting verbs for git pull, commit, and push. #
- Publishing choices already exist for writers who want to use their markdown editor of choice. Just pick one of the many static site generators that take markdown files as input to publish your site. As an example, I've written several items using either Drafts or Ulysses that are published using Jekyll via Github and Netlify. I own the domain and I have the source files of my writing on my hard drive so I could easily transfer from Netlify to another provider like Digital Ocean. I could as easily use Drummer for such writing if only there was an easy way for Drummer to produce markdown files. Heck, someone already tried Drummer with Gatsby. #
- Now, I agree that the process for using Drafts and publishing to Netlify requires too much work for the average person and what would better is something as simple as a File, Publish To menu option that lists a number of different publishing destinations, but you know what, I think someone nearly figured this out and he is Manton Reece with micro.blog. Shortly after Drummer was released Manton provided a script that I use to publish posts I write in an outline to my blog, and guess what? The blogs on micro.blog are published using a static site generator called Hugo! What makes the process between Drummer and my blog easier? An API called micropub. #
- How Drummer, and for that matter Drafts, works with micro.blog is not perfect because the flow is one way. For example, if I first write a post in Drummer or Drafts, publish it to micro.blog and then edit that post using micro.blog's editor, the changes I make to the post do not flow back to Drummer or Drafts and the result is that if I forget and then edit the original post I will overwrite the changes I made using the micro.blog editor. For now I have to remember to only edit a post using the tool I used to first write it, but that is a lot for a user to have to remember. #
- Ironically, the "manual" Drafts, Github, and Netlify workflow addresses the two-way flow of edits via Github's push/pull methodology, but that too is an API rather than a specific file format although the process requires text source files. The problem is that the Github workflow was developed for developers and thus is integrated in developer tools like VS Code more than general editors like Drafts. I thought Dave was heading in the direction of adding the Github workflow to Drumer when the github verbs were added, but I think to get to what we want the storage "container" that Drummer uses needs to be a local repository. #
- As I think about this further I realize one could use Electric Drummer in the manner I describe above and it would work well if Electric Drummer could write directly to markdown or have a good conversion tool. What I would do is create a repo connected to Netlify on my Github account, clone that repo to my PC, then use Electric Drummer to create and edit files in the directory on my computer that is the local repo. The problem then would be that I have to manage the pull/push workflow outside of Electric Drummer, which could be fixed if it had full support for Github repos like one finds in VS Code.#
- To summarize then that if the Github push/pull workflow is the best we currently have we have three levels of abstraction that loosely couple the editing tool and the publishing tool. First is the git API that centrally stores text files and manages changes to them. The Git API is used by the editor to push files and changes to storage and used by the publisher, like Netlify, to pull changes and publish them to a web server. The next level of abstraction is the text file format that is broadly readable a tremendous number of tools, and the final level of abstraction is markdown that controls how writing is displayed. Note that you could replace markdown with HTML. Finally, the storage hub of the workflow is Github, and while Github is the most widely known git resource on Internet there are alternatives.#
- Coming back then to the editor, like Drummer, it must read/write text files to a local git repository, which I observe Electric Drummer can do today. Drummer could probably do the same but would require change to it's server storage model. To make Electric Drummer better it would support markdown within the editor, which one can do manually and simplify by writing scripts, and write to markdown files, which I believe is available due to the Logseq integration done in the past, and then have built-in or scriptable support for the Github pull/push workflow like VS Code. The last part is what I see as missing in Electric Drummer, right now I have to jump out to the terminal on my computer and exec the git pull, add, commit, and push commands. #