Tag Archive for ‘Markdown’

Markdown Comes to Simplenote ➝

From the Simplenote weblog:

Today we’re excited to announce that Markdown support has been added to the latest update of Simplenote for iOS.

To enable Markdown for a note, just tap on the ‘Markdown’ button in the note info panel. You can then swipe on the note editor to view the Markdown preview. Once you’ve enabled Markdown for a note, all new notes you create in the future will have it enabled by default. We hope you enjoy this handy new feature!

I’ve been using Simplenote ever since I moved away from Vesper last year. It’s a great app, but unfortunately, this new Markdown support is far from robust. There’s no inline previews or shortcuts to help with the syntax, which I would consider to be essential features. I’ll continue using Simplenote as my notes app of choice, but I’ll keep my Markdown writing in Ulysses.

Push to WordPress Workflow

Push to WordPress (v1.1): A major update to my publishing workflow. The update makes use of my new writing template — originally discussed in Launch Ulysses Workflow — to incorporate post metadata into the Ulysses sheet.

Push to WordPress (v1.1) no longer asks for the URL slug, tags, post type, and custom field content. Instead, that information is obtained by Workflow with regular expressions on the exported text. The update also skips the WordPress dashboard and asks for a publish date from within Workflow.

If you’re interested in learning more about this workflow’s update, I’ve written about the changes in its own article. And if you’re interested in the original, links to that version and my initial write-up, explaining the thought process behind it, will remain below.

—July 7, 2016

 

For as long as the iPhone has existed, some portion of my writing took place on iOS, but it’s never been as easy as it is now. A few weeks ago, I shared the workflow I use to kickstart link publishing on Initial Charge. I’ve used it almost everyday for about a month and it continues to amaze me each time.

Between Workflow and Ulysses, my writing process has been greatly streamlined and the amount of time I’ve saved is beginning to add up. It may seem like just a few minutes here and there, but that’s slowly turned into a few extra hours that I can allocate elsewhere. There’s been multiple instances over the past week in which I’ve emptied all of my inboxes — Instapaper, Overcast, Reeder, Tweetbot, and Dispatch. Doing so before I started using Ulysses and Workflow was a rarity, but now it’s becoming commonplace and I’m starting to enjoy these unexpected breaks.

Workflow has done the majority of the heavy-lifting for me in that regard. Many of the tasks which used to require multiple steps and a lot of tapping can be performed in the action sheet. Since the last time I’ve written about the app I’ve built workflows for searching Initial Charge, converting text to title case, and displaying the word count of selected text on a web page. This is stuff I do a handful of times each week that are now much quicker to perform, thanks to Workflow.

But the workflow that’s made the largest impact has been Push to WordPress. As I’ve discussed previously, I used to use WordPress’ Press This bookmarklet for composing links, relying on a combination of CF Setter and Slugger+ for setting custom fields and URL slugs. For writing feature articles, I would start in Simplenote and eventually copy and paste into the WordPress dashboard when I was nearing a final draft.

This process was inefficient, at best, and has been supplanted by a more modern workflow that allows me to write entirely in Ulysses, regardless of what form that published work will take. This means I’ll have a familiar writing environment for everything I publish — going all-in on Markdown and building efficiencies from its consistency. It will also let me keep an archive of my writing in iCloud — accessible from Ulysses on all of my devices.

It’s worth mentioning that The Soulmen have announced that Ulysses will soon have native support for publishing to WordPress. I was initially worried that this would render my publishing workflow useless, but I’ve realized that there’s still a reason for its existence. Ulysses’ publishing mechanism might not have support for the features that I need if I’m going to use it full time. Support for custom fields, scheduled publishing, and custom URL slugs are all essential to me, but there’s no telling if they’ll exist at launch. And more importantly, we don’t know when the update will be released — I need to publish now.

The Workflow

This is, by far, the most complicated workflow I’ve ever built. But I’d be remiss if I didn’t credit Federico Viticci’s publishing workflow as an inspiration for my own. I originally designed two separate workflows — one for publishing links and another for publishing features articles. That is, until I came across Viticci’s. His asks which post type you’re publishing and performs a different set of actions based on the one you choose. This was a brilliant idea and allowed me to simplify Workflow’s action sheet without losing any functionality.

The workflow uses a few regular expressions to interact with text on the first and last line of the document. I wish I had the ability to write my own regular expressions, but it’s a little over my head at this point. I did manage to find the ones I needed in a Reddit thread and on Stephen Millard’s Thought Asylum. Without these, the workflow just wouldn’t be possible.

There’s several pieces of information that I needed to populate in the “Post to WordPress” action in Workflow — title, custom fields, post content, category, tags, and URL slug. The title, custom fields, and post content are saved as variables using the aforementioned regular expressions before being passed to the publishing action. The category is automatically set based on which post type is chosen at the beginning of the Workflow — Linked List or Feature.

Unfortunately, the current workflow asks for the URL slug and tags when it’s triggered. I would prefer those bits of information be automatically populated, but it wasn’t until a few days ago that I devised a way to do so. It’s all theory at this point — completely untested — but I hope I’ll be able to integrate it soon. The largest benefit to adding this feature is that both tags and URL slugs would be saved in Ulysses rather than only existing inside my WordPress database.

Push to WordPress is activated from the “Run Workflow” action extension, when viewing Ulysses’ export screen, and performs the following process:

  • The entire document is saved as the variable “Note,” the first line is capitalized with title case, and saved as the variable “Title.”
  • A menu appears asking whether your publishing a link or a feature article.
  • If Linked List is chosen:
    • The first line — title — and last line — URL — are stripped from the document and the result is saved as the variable “Content”.
    • Workflow asks you to choose which URL you’d like placed in the custom field.
    • The post content, title, and custom field URL are passed to the “Post to WordPress” action and Workflow asks for the URL slug and tags.
    • The post is saved as a draft in your WordPress Dashboard which is then opened in Safari.
  • If Feature is chosen:
    • The top line — title — is stripped from the document and passed to the “Post to WordPress” action.
    • Workflow asks for the URL slug and tags.
    • The post is saved as a draft in your WordPress Dashboard which is then opened in Safari.

I’ve only tested this Workflow in Ulysses, exporting HTML snippets — it does not work if you’re trying to export “full page”. I expect it will work with other text editors as well, as long as they’re able to export HTML. But there are a few more things to remember about the workflow:

  • Push to WordPress always assumes that the title is on the first line — if anything else is on the first line, it will be stripped from the post content and treated as the title.
  • If Linked List is chosen as the post type, the workflow assumes that the last line is the contents of your custom field.
  • The workflow doesn’t actually publish the post, it only saves it as a draft. That way it can be previewed in the site’s design and scheduled to publish at a later date — most of what I publish is written a day or two before it goes live.

While it’s unlikely that anyone has the same setup as I do for publishing, I suspect there are plenty with similar needs. With that in mind, I think Push to WordPress is a perfect starting point for anyone who wants to hack together their own publishing workflow.

Push to Ulysses Workflow

Push to Ulysses (v1.1): A minor update to my link composing workflow. The update features my new writing template — originally discussed in Launch Ulysses Workflow — that’s designed to work with my upcoming WordPress publishing workflow, which I plan to share in the coming weeks.

In short, the new template lets me save URL slug and tag information within a Ulysses sheet. And the new publishing workflow is able to grab that information and pass it to WordPress with minimal interaction. It’s a major improvement over my original Push to WordPress workflow.

Push to Ulysses (v1.1) no longer uses X-callback-URL to send information to Ulysses and, instead, incorporates Workflow’s Ulysses actions — introduced in version 1.5.

If you’re interested in learning more about this workflow, links to the original version and my initial write-up explaining the thought process behind it will remain below.

—June 24, 2016

 

As many of you know, I’ve just recently started using Workflow to automate various tasks. I’ve only built a few of my own workflows so far, but it’s quickly becoming my favorite iOS app. Not only does it help me improve my productivity, it’s also incredibly fun to use — who doesn’t love hacking together Rube Goldberg-like systems and seeing if they work?

My use of Workflow quickly accelerated when I made the decision to reorganize my bookmarks a couple weeks ago. I realized that I had all these bookmarklets that weren’t necessary anymore. Most of them had been replaced by native iOS apps with action extensions. And not only were these action extensions more intuitive to use than my old bookmarklets, but I could easily manage them on my iOS devices and add new ones to boot.

There was one glaring exception, though, WordPress’ Press This bookmarklet. This often-overlooked feature is what has fueled Initial Charge’s Linked List since it was first introduced in 2011. Nearly every link published to this site began by clicking (or tapping) the Press This bookmarklet in Safari’s Favorites bar.

But it’s finally time for a change. The Press This bookmarklet worked, but it was never really well suited for the task. I had to use a couple of WordPress plugins — CF Setter and Slugger+ by Justin Blanton, both of which are great — in order to bend the simplistic compose window to my will. But even then, it still wasn’t as smooth as I always wished it to be.

Every single link was an exercise in frustration. This is what I went through with every link I published to the site:

  • Delete all of the text automatically generated by the Press This bookmarklet.
  • Edit the title and run it through TitleCap.
  • Copy and paste whatever bits of text I was quoting.
  • Write my own thoughts about the topic.
  • Type out the CF Setter and Slugger+ tags — which was made easy with iOS’ Text Replacement feature.
  • Copy and paste the URL in between the CF Setter tags.
  • Write out the piece’s slug in between the Slugger+ tags.

This took a considerable amount of time and was just begging to be automated. At first, I considered hacking the Press This bookmarklet in an attempt to streamline the process. I tried a few different approaches, but could never quite get what I wanted out of it. That’s when I turned to Workflow.

I decided to abandon the Press This bookmarklet altogether and move to a more modern process — giving me an opportunity to start using Workflow for more serious tasks and write full time in Markdown with Ulysses.

It may be hard to believe, but I had only dipped my toes in the water with Markdown. I tried to implement it in my writing process last fall when I attempted to use Editorial for my longer-form writing. For whatever reason, the app never sat well with me. And to this day, I can’t put my finger on why. Markdown, on the other hand, was great. I just never had any use for it in WordPress’ editor.

More recently, I started slowly moving toward Ulysses for my longer-form, Feature Articles. I loved the app, especially since it was finally available for the iPhone. And this move away from the Press This bookmarklet was a great opportunity to cement The Soulmen’s text editor as my primary writing tool for the site — going all-in on Markdown along the way.

For the foreseeable future, everything published on Initial Charge will be written in Ulysses. And Workflow will be there to help streamline the entire process. Today, I’ll be sharing my Push to Ulysses workflow, which is used to transition from looking at an interesting webpage to writing about that webpage.

I’ve already started building a workflow for publishing to Initial Charge from Ulysses, but it’s very much a work-in-progress. It functions, but in the past day alone it’s undergone some pretty significant changes. I will be sharing it in the future, but I’d like to do some more testing and smooth out the rough edges before I release it to the world.

The Workflow

I need two pieces of information from a given webpage in order to get started writing a link — the page’s title and URL. The title typically ends up changing and often needs to be properly capitalized, but I use it as a starting point that I can then craft into my own. The URL will eventually end up in a custom field which the Daring Fireball-Style Linked List plugin uses to differentiate between links and articles.

I had considered adding the ability to transfer selected text from the webpage into Ulysses — most of the links I publish on the site include a quote from the originating article. But after doing some testing, I realized that I don’t usually find the block of text I want to quote until after I’ve already decided to link to it. Perhaps this will return in a future version, or maybe I’ll find a way to use Ulysses’ X-Callback-URL support to append the quote to an existing sheet (which was added in version 2.5), but for now I’ll let copy and paste do all the heavy lifting.

Push to Ulysses is activated from within the “Run Workflow” action extension, while viewing a webpage, and performs the following process:

  • Save the webpage’s URL to a variable called “Link”.
  • Get the name of the webpage from Safari, properly capitalize it with Workflow’s “Change Case” action, and set it as the variable “Title”.
  • Input the variables into my Markdown template with the title set as header 3.
  • URL encode the template and set it as the variable “Content”.
  • Input the encoded template into a Ulysses X-Callback-URL and open it.

This gives me a new sheet in Ulysses with the title, properly capitalized, on the top line and the webpage’s URL on the bottom. From there I can begin writing my commentary in the template’s white space. It’s important that I write in between the title and the URL because the publishing workflow I’ve built expects those two pieces of information to be at the beginning and end of the document.

I’ve been publishing links to Initial Charge all week with this workflow and it’s been an absolute joy to use. Even though I’ve been using the iPad Air 2 as my primary computer for over a year, it’s never felt more powerful than it does today. Using Workflow to string together multiple applications has felt revolutionary to me. I have plenty of experience with apps like Alfred and Automator — both of which are capable of incredibly powerful things — but I never managed to build the type of intricate systems like I have with Workflow.

And that’s not to ignore the importance of Ulysses and Markdown to my newly revamped writing process. It’s been a long time since I’ve had this much fun writing. Don’t get me wrong, I’ve always enjoyed it, but Ulysses’ beautiful user interface and the simplistic nature of Markdown’s syntax has made writing downright delightful again.