A sort of funny thing happened when I was posting my last post, AsciiDokken, about how I’ve been writing and (not)blogging in AsciiDoc, and piping posts up into WordPress via blogpost.py.
The dang post wouldn’t upload!
I retried it, several times, and eventually it worked. I’m wondering if the issue I experienced has something to do with the recent WordPress 3.6.1 update.
Anyhow, it occurred to me that one thing WordPress does pretty well is accept pasted HTML content, and more or less, accurately suck in the HTML formatting.
I mentioned in my post that I was using this live preview trick suggested on the AsciiDoctor web site to do my live-previewing. Well, I’ve come across a simpler way to live preview, using a Chrome extension for the purpose. There’s also a Firefox plugin.
I installed the Asciidoctor.js Live Preview plugin, right-clicked on the red “A” that then appeared on my toolbar, and clicked the check box next to “Allow access to file URLs.”
I browsed, in Chrome, to the directory where I keep my in-progress writings, and used the “Create Application Shortcuts” function under “Tools” to convert my directory listing tab into its own app launcher.
Then, I hit the command line and visited my “~/.local/share/applications/” directory in search of the launcher file Chrome created (it begins with “chrome-“).
I tacked “–allow-file-access –enable-apps” onto the end of the line beginning “Exec=”, changed the line beginning “Name=” to include a suitable name, and changed the line beginning “Icon=” to point to a suitable icon for my app:
Then, when I want to write, I pop open my text editor of choice, open up my new live preview Web app, write, and see my words appear in all their AsciiDoc-formatted glory:
When it’s time to publish, I can either use blogpost.py (which, as I’ve mentioned in the past, handily handles image uploading, but, as I’ve mentioned today, is caught up in some amount of brokenness), or just highlight what’s in my live preview and dump it into WordPress, before manually uploading the images.