TIP: Publish a Workspace to Files with Shortcuts

In iOS 15 (and macOS 12), Shortcuts added file actions which make it easy to work with files and folders. Combined with Drafts extensive ability to query your drafts, it is easy to create publishing shortcuts - so we thought we’d provide a basic example that might be useful as a starting point for some of your own workflows.

The “Publish Workspace” example shortcut does the following:

  • Prompts you to select one of your Drafts workspaces.
  • Fetches drafts in the inbox of that workspace.
  • Prompts you to select a destination folder.
  • For each draft found, saves a Markdown file in the selected folder with the content of the draft, named using the first line of the draft (e.g. Title.md).

To use this example you must be running iOS 15 or greater, or macOS 12 or greater.

Install the Shortcut: Publish Workspace

Once installed, it is easy to modify this shortcut to suit your needs. You can pre-select the workspace, for example, or modify the file-naming scheme to your liking.

6 Likes

Very nice! The one variant I’d actually use is if there were a list of the drafts and you can select which one(s) get(s) published…

… My workflow for blogging is to write a post in Drafts and save as Markdown to a directory and convert that to HTML. Usually one draft at a time.

Just putting in a choose from list action with multiple select set to on should get you that, I think.

2 Likes

How do you save a draft as markdown? Might sound dumb, but I’ve been unable to do that.

Markdown is a plain text format that you can write in. If you save any plain text file from Drafts where the draft is written in Markdown, it is a Markdown file. By convention, giving the file a ‘.md’ file extension would indicate it is a Markdown file.

While you can use the standard export feature to export in plain text, using the export action step provides more automated control (e.g. set file extension), or the FileManager scripting class for even greater control.

Technically you could even use shell or AppleScript to also accomplish this, but Drafts’ file-related action steps are as far as you should need to go.

So where does this lead? Well, the easiest starting point is probably the ‘Save to Files’ action references as an example for the Export step.

Write your Markdown content, and run a version if this action, but with the .txt file extension replaced with a .md file extension.

Thanks that was very useful. Once I’ve saved it on my iPad, which is easiest way of opening an .md file on my iPad?

There are probably hundreds of apps available on iPadOS that are capable of opening Markdown files. Some will allow you to edit them. Some will also have syntax highlighting. Some will allow you to open a Markdown file from a variety of locations, some will not. Some will probably give you a rendered (e.g. into HTML and shown as a web page) or read only view. Some also offer both editing and a rendered preview. Some will even allow you to link between files using a wiki style linking, just like Drafts.

The easiest way for you of opening a .md file is based entirely on what apps you have available to work with Markdown files. If you don’t have any apps (text editors, Markdown editors, PKM tools, etc.) capable of doing this, then you would need to identify what you require the app to do and find one that is suitable.

You have identified a requirement to get a Markdown file out of Drafts and into the file system, so based on this question of how to ‘open’ it once it is in a file, I am left wondering what is driving your need to output it to a file in the first place.

That’s a very, very good question. So, here is my ‘process’. I read a fair bit and it’s all on the kindle iOS app. I highlight some parts. Then I set up a project using the ‘examples cross linking’ action group. Then I export my highlights chapter wise using the ‘insert linked draft’ action in that group. Then I merge the drafts for the book. Now I need to ‘contextualize’ my highlights. Hence, I need to export them to Roam, and I’m currently experimenting with NotePlan. Without contextualizing them the book notes are useless. Once they are contextualized, I can use them in a variety of ways, pattern recognition being one. It’s all kind of Zettlecasting, building a latticework of mental models or whatever you may want to call it. Feel free to critique my process, no issues.

Unless there has been a massive change in infrastructure recently, Roam doesn’t use local Markdown files. So exporting to files is not directly applicable for Roam without some additional sort of process bridge to get the files into Roam.

Noteplan does use such files, so I can see the relevance there, except that Noteplan then is THE way you would be opening your Markdown files, making the question about the “easiest” method somewhat redundant, I think :man_shrugging:t2:

Correct, Roam has limitations. Zettlecasting sounds and reads as easy-peesy. I haven’t been able to implement it to my satisfaction. Hence, NP. But, if there is a better tool, why not experiment? So far so good as far as NP is concerned and the developer is also keen on using the Zettlecasting approach. It’s easy to write a blog on what Nicklas Luhmann achieved, but digitizing it hasn’t been mastered, to the beat of my knowledge. Hence, the question!

Not to divert you from NotePlan, but if you need an app separate from Drafts to help manage your exported Kindle highlights and associated notes as Markdown files, and you’re in the market for a Roam-like, have you already experimented with Obsidian or Logseq? Both have iOS clients (Logseq is beta-testing via TestFlight). There are a few Obsidian workflows detailed here in the forum.

There’s also a bit of conversation here around Zettelkasten in Drafts.

Curious to know which aspects of Zettelkasten you feel haven’t been appropriately implemented digitally. While I appreciate the methodology, I never did implement it in any canonical way. Always open to learning more.

Standard disclaimer: I realise I’m joining this conversation mid-way through so please forgive if there’s something in your thinking that I’ve misunderstood.

There is no mid-way man! To the best of my knowledge these two don’t have iOS options. I many be wrong, not to sure, but I’ll investigate. The iPad is such a powerful device ( I use a mini), and it doesn’t beat the Mac, it’s close. An iPad mini with a Mac is unbeatable. Hence, NP. But, thanks for the suggestions. Obsidian iOS is available, but it doesn’t have cloud sync is my guess. Let me check.

About Zettlecasting, in Roam it’s tough to go to the second level. Primarily linking via context is a breeze in Roam. But sub-contextual cross linking is something I’ve yet to master or get my head around. That is the challenge with all these apps.

PS: Logseq iOS is also released, my bad. Thanks

They do. Obsidian has had it for a while now (I use it regularly), and as noted by @jsamlarose Logseq is in beta.

iPad power: yep— I pretty much live on one! I’ve got a couple of legacy Macs lying around, but the most I’ve booted them up for in the past 12 months or so is the couple of times I’ve needed to update the keymap on my mechanical keyboard. I’m a 12.9" mostly, though I do make good use of a Mini when I’m mobile.

Obsidian: when I trialled the iOS app, I went for syncing via iCloud (IIRC). For obvious reasons, I didn’t really test how well that might work with a macOS device, but I doubt there’d be any issues there. And I believe Obsidian’s own paid for sync service is up and running?

Not sure I’m quite clear on what you mean by sub-contextual cross-linking. Example?

I thought I’d throw a completely different take into this discussion. Like others, I read a lot in the Kindle app on my IPad Mini and have a subscription to Readwise. Readwise is SO easy to use. With practically no effort I highlight like a maniac, sending dozens and dozens of highlights exactly where I want them in Obsidian (formerly in Roam). Readwise is exceptionally efficient.

But, once in Obsidian the dozens and dozens of highlights die the slow death of neglect because the chore of dealing with them is so tedious that I’d rather read something different and leave processing the highlights I have already made for another day - that doesn’t ever come.

Recognizing the futility of this arrangement I made a change. I still read on my IPad Mini and I still highlight. But, whenever I highlight I immediately copy the highlighted text to the clipboard (a built-in Kindle option) and take advantage of the Universal Clipboard to immediately paste the highlight into a pinned draft in Drafts on my iPhone. This process involves a sort of two-handed reading – one hand for the Mini and one for the iPhone.

This process is definitely more awkward than the Readwise method, which is a good thing because it makes my highlighting more intentional. Moreover, dealing with highlights in Drafts is somehow easier for me than doing the same job in Obsidian or (formerly) in Roam.

When I have finished whatever I’m going to do with the highlighted text in Drafts I move it to where it will live in Obsidian (which btw, syncs via iCloud to my phone, IPad, and Mac without difficulty).

This is a case where adding friction made my system work better.

2 Likes

This is smart! Similarly, having trialled a range of different highlighting tools, I very often simply copy a “highlight” to Drafts via the share extension. Never thought of using the universal clipboard to do this, though. Might well give that a go…

Ok. So, in Roam I have some text that is linked and contextualised to [[Mindset]]. Now, I read something and I can relate it to Mindset, but within Mindset, there are many sub-contexts; so Mindset and Habits, or MIndset when I place a bet, or I want everything that Buffett has said that relates to Mindset, I can’t filter that in Roam. And, I am struggling to do that in NP as well. But in NP the developer is on the same path as I am, that matters. If I just key in MIndset, I get 150 references, and then I have to read through ALL of them and filter what I want. I hope I have been able to explain myself.

There is a limit on the amount of text that you can copy. It doesn’t always matter, but in SOME cases the books are such classics that one just can’t get enough 'copy bandwidth. Now, I can overcome that with the latest iOS features of taking a photo and then copying the text from the photo. So, yes works in a roundabout manner.

In Obsidian it is easy to write a query that would return the intersection of Mindset and Buffett, assuming they were different tags. Or, if they were different links or different “properties” such as you might find in YAML - or embedded in notes themselves. Searches of this type can make use of the core Search function or the very powerful Dataview plugin.

It is also possible to assign hierarchical tags. For example, you could have tags that were of the form: Mindset/Buffet, Mindset/Gates, Mindset/Einstein – or any other Mindset sub-category that you wanted to tag more specifically. You could layer this hierarchy further: Scientist/Physicist/Einstein vs Scientist/Physicist/Bohr. I don’t do that, but it is possible to do so.

I assign hierarchical tags in Obsidian (or in Drafts for drafts that will later be moved to Obsidian) using Keyboard Maestro macros that allow me to choose one or more tags from different categories – a methodology that is faster, eliminates typos, and makes it less likely that the tagging job will omit a relevant tag.

I had the locating problem you describe in Roam, but not in Obsidian. That is particularly the case if I use Drafts to format and otherwise structure notes/files before moving them to their permanent home in Obsidian.

2 Likes

Very helpful. Thanks. Which plan is this, in terms of the pricing?