Apple • Gadgets • Synths • Electronics • Math • Mostly German

iPad, Software

Editorial workflow for inserting markdown image links interactively

Editorial IconOle Zorn’s Editorial App for iPad is pure awesomeness and if you’re a Markdown (and iPad) fan you probably know that already. One of my (few) New Year’s resolutions is to learn (more) Python and to learn how to write Editorial workflows. Because the markdown documents I write contain usually a few images from web sites I research (not from my iPad image library) and because Editorial includes its own web browser I asked myself: why can’t I just somehow insert a markdown image link in my document to an image that’s on the web page I see in Editorial’s browser? Either I’m missing something or it just isn’t there (yet). Well, because I’m always eager to learn I started to implement exactly that.

The thing is: currently there’s no elegant way to preset the user a number of images (the ones from the web page you’re reading in the Editorial browser) and let him choose one interactively. With kind help from Ole (thanks so much, dude, you rock!) I was able to workaround this. The result are actually two workflows:

  1. The first workflow („InsertImageURL„) is the one you invoke directly. Prerequisites are that you have a web page open in the browser that contains images. If you have selected some text in your document when you invoke this workflow this text will be placed inside the [ ] brackets afterwards.
    This workflow scans the web page for all the image URLs and builds a simple web page of its own that gets presented to the user with the „Show HTML“ action. Each image on that page can be tapped. You tap on the one whose link you want to have inserted into your markdown document as an inline image link. The trick is: the link behind the image uses the Editorial URL scheme and invokes the second workflow.
  2. The second workflow („InsImgUrlB„) just takes the image URL from the first workflow, builds the correct markdown syntax, inserts the selected text (if any) into the brackets and adds the URL into the parenthesis. That’s it. So you never invoke this second workflow by yourself. Always invoke just the first workflow, „InsertImageURL“.

It’s a first version and there maybe bugs. Also, it’s just inline image links for now. I do like reference style links more but it’s a bit more complicated to add those. And the page that presents the web page’s images could be fancier. I’ll be working on it. 😉

Please report bugs, suggestions, praise, hate etc. in the comments section below.

Thanks again to Ole for his kind help and thanks to Brett Terpstra, Federico Viticci, David Sparks, John Gruber, Fletcher Penney for being a constant inspiration in the fields of apps, workflows, tools, markdown and more! 🙂

  1. Alan

    Thanks so much for producing this excellent workflow. It works brilliantly and is just what I needed but thought was not possible, Great job.

    • Kommentar des Beitrags-Autors

      Oh, you’re welcome. Glad you liked it! 🙂
      It’s still a bit of a workaround because Editorial doesn’t have user interface elements in it’s current version. But I think Ole is up to something and we can expect more in this area in an upcoming release. 😉

Schreibe eine Antwort

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.