My Markdown-with-frontmatter-YAML-to-Tumblr-NPF (and then `pytumblr2` to the Tumblr API) code is now wrapped in a very minimal CLI, and I have written Emacs glue for calling that CLI.
I am using `docopt`, which I reach for first when I need a Python CLI MVP, because it reduces boilerplate almost entirely down to just writing the `--help` text string.
(Naturally this post was created and updated through it. Basically ":w" to save changes in my text editor, two keys to switch from this file in my editor to my shell, then rerun the publish command from history to push updates. For the initial posting, I just had to tab-complete the file path and type out my blog name.)
Edit: I have now also added
CLI to get/set my two Tumblr-specific frontmatter fields,
Emacs code to prompt me interactively to pick from one of my blog names (I use Vertico+Orderless for `fzf`-like narrowing/search in all such prompts).
Emacs function to get the target Tumblr blog from the frontmatter (or prompt if it's not in there) and then call the publish CLI.
Emacs function to call the post deleting CLI.
Code within the above two functions to automatically reload the file from the file system if it had no unsaved changes before the publish/delete (to pick up the frontmatter change made by my Tumblr CLI, since that bypasses Emacs and edits the file itself).
(Naturally these latest edits were made by calling that function from within Emacs.)
Final edit: and now, finally, I can publish/update/delete posts with just three key presses (from vi command mode, when on the post's local Markdown file in my Emacs). Naturally, this final triumphant edit was published that way.















