Posts tagged with "markdown"

Matching URLs In Editorial with John Gruber’s Regex Pattern

Editorial for iPad

Editorial for iPad

When I'm writing in Editorial, I often need to make sure I'm dealing with a valid URL in the system clipboard, the document editor, or in a variable. To do so, I've long employed John Gruber's liberal, accurate regex pattern for matching URLs, which has reliably allowed me to confirm that a workflow is about to handle a proper URL rather than a string of text that contains something else. Gruber recently improved the regex pattern again, and that seemed like a good opportunity to briefly detail how I've integrated his pattern in my workflows.

The key to match URLs and provide error-handling features in Editorial is to use a conditional block based on a regular expression pattern. Editorial comes with this functionality built-in: given a regex pattern, a block of actions can be run only if a value (plain text or variable) matches the pattern. In this way, you can run a set of actions if you have a URL, and another set if you don't have a valid URL.

I've created a simple workflow that can be installed and reused as a preset in other workflows. The workflow, called Match and Open URL, consists of a single If block that checks for a URL contained in the clipboard. If you have a URL that matches Gruber's pattern, the URL will be extracted from the clipboard and launched in the browser; if you don't have a URL…it's up to you to provide an alternative.

Editorial makes it extremely easy to build this kind of advanced workflow with just a few built-in actions. Gruber's single-line version of the regex pattern can be pasted in Editorial's If action with no modifications; inside the If block, the text in the clipboard is passed to a Find action that extracts a URL using the same, untouched single-line regex pattern. The extracted URL is opened in the browser and a HUD alert is displayed.

Combining Gruber's regex pattern and Editorial's workflow system can yield interesting results. You could use a variable instead of the system clipboard to match URLs; you could implement the pattern in a Repeat block that performs a set of actions for every matched URL found in the target text; instead of having my workflow inside an If block, you could match a URL among other bits of text, extract it, and do something with it. Editorial is a text automation playground and your imagination's the limit.

You can download the workflow on Editorial Workflows' website, and check out John Gruber's regex pattern here.

Note: The screenshot above shows a beta version of Editorial, currently in testing.

MultiMarkdown 4.5

Fletcher Penney released version 4.5 of MultiMarkdown today, which brings several improvements and some great new features. MultiMarkdown has become the standard for many of the best text editors on iOS and OS X, and Fletcher is constantly updating it (alongside his app, MultiMardown Composer) to keep up with the times.

The new version comes with support for what he calls “File Transclusion”. MultiMarkdown can now include the contents of a file inside another file – think of document hyperlinks, done in plain text. From the docs:

Transclusion is recursive, so the file being inserted will be scanned to see if it references any other files.

Metadata in the file being inserted will be ignored. This means that the file can contain certain metadata when viewed alone that will not be included when the file is transcluded by another file.

This is a powerful addition for writers who have been looking for an easy way to reference files and group their contents together – now Transclusion happens directly before the processing step, with MMD taking care of scanning files and even additional links within those files. The obvious implementation would be to write a book or academic paper in plain text, keeping chapters as separate files in a folder and referencing their file names in the Table of Contents. There are many possibilities and I can't wait to see this being included in some iOS text editors.

You can download the latest MultiMarkdown here.


Insert Markdown Image Links Interactively with Editorial

Stefan Wolfrum:

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.

One of the most clever workflows I've seen in a while. I'm using a similar trick in my Feed Wrangler workflows, and Stefan's idea can be easily repurposed for other scenarios. Well done.


Marked 2 Tips for Long-Form Reading

Brett Terpstra:

Marked 2 is great for live previews while you write Markdown, but it’s also very handy for reading long form articles. There are a variety of themes and many features for quickly navigating through long pieces.

I use Brett's Marked when I'm writing on my Mac. With Sublime Text, it's easy to run a custom build command (preview) for Marked and I love that the app (unlike many others) supports header IDs when it converts Markdown to HTML. When I was working on my Editorial review, Marked was essential in the editing process to preview images, code blocks, and navigate through the final 25,000-word document.

Nothing beats Marked's Markdown preview tools. It turns out, it's pretty great at enhancing long-form web reading too. Who else thinks this would be fantastic on an iPad?


Marked 2.1 Improves Word Repetition Visualization and Text Statistics

Marked 2′s first point release has landed, and it’s chock full of great improvements. If you haven’t purchased Marked yet, think of it as fancy document preview tool that helps you catch formatting mistakes, catches overused words, and highlights cliché phrases. It’s a mini-editor for your text documents, especially useful for those who write in Markdown and publish text on the web. For those who already have Marked, download the latest update to grab bug fixes and notable feature improvements such as background calculation for text statistics.


Marked 2 Review

One of the most indispensable pieces of software currently on my Mac is Marked. Paired with TextEdit, I write in plain text and format words in Markdown, letting Marked transform working documents into live previews complete with clickable links and footnotes. At the end of my session, I can convert everything into HTML that I can copy and paste into WordPress. It’s a brilliant little tool that I don’t utilize the full capabilities of, but it makes my life significantly easier when it comes to just writing stuff. For most writers, these few features alone are enough.

For writers willing to put in the work, Marked can display previews that match your website’s style and theme by creating a custom CSS template. There’s handy keyboard shortcuts, like Command-U for viewing source code and Shift-Command-C for saving HTML to the clipboard. You’ll additionally find things like a viewable table of contents built in that let you jump to specific sections for documents with multiple headings. Plus, Marked happily works with the text editor you’re already using.

Yet there’s so much more underneath the hood. For screenwriters, Marked works with apps like Scrivener and markup languages like Fountain. Those who have to write and publish formulas can do so with MathJax. And old Markdown hands can specify their own custom processors… something that’s possibly over my head. Marked is a labor of love, catering to geeks while remaining accessible for writers like me who want easy previews and invaluable features like the ability to process Markdown within source code.

Considering all that Marked already does, Marked 2 is a huge release that adds a ton of new features for editor, bloggers, and people who would rather write in Markdown than open Microsoft Word. Instead of running through every new feature, I’d rather focus on the two that have the greatest impact on me. Keyword highlighting makes self editing much easier, while new searching features let me skip past the results I don’t need to see.

Read more

Reinventing iOS Automation: Editorial Review

Editorial for iPad

Editorial for iPad

Update: I have turned this review into an interactive book with additional & exclusive content. You can find it on iTunes, on sale for a limited time. More information is available here.

Ole Zorn knows how to push the boundaries of iOS. His latest app, Editorial for iPad, redefines the market of text editors for iOS, and, in many ways, sets a new standard for iOS automation and desktop-class apps. Editorial makes me want to work from my iPad.

Before I get to the details, allow me to offer some backstory to properly contextualize Editorial and the process that led me to its launch today. I have been testing Editorial for the past eight months (since late November 2012, when I received the first beta build), and I’ve seen the app go through numerous iterations and changes. At one point I wasn’t even sure Editorial would come out anymore. Editorial has become the essential part of my iOS workflow, and it only seems fair to have a proper introduction.

Read more

Markdown for Keyboard Maestro 2

One of my favorite tools for more efficient writing was recently updated to version 2, which is available for download on GitHub. As Andreas Zeitler explains, the main focus for version 2 was “speed optimization, interaction, accessibility for non-English speakers, and usability”. There’s also a screencast on YouTube showing the new features.

I use Markdown for Keyboard Maestro on a daily basis to speed up my writing in Sublime Text. In fact, many of the workflows that I’ll share when Editorial for iPad will come out have been inspired by Andreas’ work.


Editorial for iPad

Ole Zorn is finally talking about his upcoming new app, Editorial, publicly on his website:

I tweeted earlier today that I’ve registered the name for a new app in iTunes Connect. It’s called Editorial, and I’ve actually been working on this for over a year now.

At its core, it’s a Markdown editor for iPad, but you can also think of it as a Pythonista spinoff, or a workflow automation tool, not unlike Automator.

I say “finally” because I have been testing Editorial since November 2012. All my reviews have been written and edited with Editorial; I have built workflows that, for me, make working with text on the iPad better than using Sublime Text 2 on my MacBook Air. When I’m on my Mac, I miss Editorial’s automation and editing features. And if I haven’t posted a screenshot of my iPad’s Home screen in a while, it’s because I had Editorial in my dock and I couldn’t share it.

Ole Zorn is the developer of Pythonista, which I have written extensively about. I can’t wait to share more about Editorial.