Drafts 20 Released - Cross-linking Drafts + Typewriter Scrolling

Drafts 20 has been released:

Details below. For complete history of updates, visit:

8 Likes

Drafts 20 (iOS) Release Notes

What’s New

  • Wiki-style markup for cross-linking between drafts, and executing basic Drafts commands. Useful for linking research notes, creating a table of content of other related drafts and more. When embedded in a draft, these become tappable links that open URLs as described below:
    • [[Title of Draft]] : Creates a link which will open a draft by title (first line) when clicked/tapped. Will create a draft with the title if it does not exist. This default syntax can also be expressed simply as [[d:Title of Draft]] if necessary to avoid conflicts. Title matching is loose to allow partial matches for text in the first line of draft, so [[My Title]] would also match a draft with the first line [[# My Title]].
    • [[u:UUID-OF-DRAFT]] : creates a link for a specific draft by UUID to allow exact linking. Will not create a draft, it must exist.
    • [[s:Search Term]] : creates a link which will open a quick search to the specified search
    • [[w:Workspace Name]] : creates a link which will load the named workspace
    • [[google:Search term]] : Opens a Google search for “Search term” when clicked/tapped.
    • [[wikipedia:Search term]] : Opens a Wikipedia page for “Search term” when clicked/tapped.
    • [[bear:Title of Bear Note]] : Opens a note titled “Title of Bear Note” in Bear, if it exists. This utilizes the Bear /open-note URL scheme.
    • These link markers are only available when using Markdown, MultiMarkdown or GitHub Markdown syntax definitions.
    • See Linking Drafts article for additional details.
    • The Examples: Cross-Linking action group also provides example actions to facilitate cross-linking drafts in a project.
  • "Typewriter Scrolling" option fixes the cursor position in the middle of the editor, moving the text as you type. Feature can be enabled/disabled in the “Aa” editor settings, or via contextual menu (tap and hold) on the “Aa” button. Details
  • Contextual (tap and hold) menu improvements:
    • Menus (tap and hold) on Inbox/Archive/Flagged/All folder buttons in the draft list to change sort options.
    • Updates to the navigation contextual menu, including “Last Draft”, “Next-previous draft in list” and access to recent drafts. Also the navigation menu is now attached to next/previous buttons at bottom of the screen.
    • Quick search button now has a contextual menu including “Find in Draft…” option.
    • Draft results in quick search now have contextual menus allowing opening in a new window and other common commands.
    • Contextual menu on arrange button, allows selection of initial arrange mode (block/line/sentence).
  • Scripting additions:
    • Most JavaScript objects now support the new keyword. So new Draft() now works in lieu of Draft.create() (old syntax still works).
    • Draft object additions and changes: Docs
    • title property now strictly returns the first line of draft
    • displayTitle property returns cleaned up the title as it would be displayed in the draft list, removing Markdown header characters, etc.
    • lines property returns content as an array of string split on line feeds.
    • editor.recentDrafts property returns an array of recent drafts loaded in the editor, with the most recent previous draft as the first index. Useful for navigation in actions. Docs
    • app.openInNewWindow(draft) script method. (iPad/Mac). Pretty self explainatory I think. Docs
    • Scripting access to editor navigation markers, as displayed in the Navigation window/menu. Allows for the creation of actions that navigate within the current document. Docs
    • editor.navigationMarkers: Array of navigation markers available in the document. Docs
    • editor.navigationMarkerAfter(location: number) and editor.navigationMarkerBefore(location: number) convenience methods to get the next/previous navigation markers relative to a location in the text.
    • Example actions:
      • Previous Marker: Move cursor to the previous marker (Header, etc.) in the draft.
      • Next Marker: Move cursor to the next marker (Header, etc.) in the draft
    • navigationMarkers are objects with the following properties:
      • location: start location of the range
      • length: length of the range
      • prefix: Identifying prefix for the marker (like H1, H2 in Markdown syntax) as defined by syntax
      • label: Identifying label for the marker.
    • level: indentation level of the marker.
    • FileManager has new getCreationDate(path), getModificationDate(path), and setCreationDate(path, date) and setModificationDate(path, date) functions. Docs
  • File action step has a new “Maintain dates” option which will set the creation/modification date of the newly created file to match those of the current draft. When the action creates a new file, creation and modification will be set - if it is appending/prepending, only modification date will be updated. Docs
  • Add the option to copy the title to the clipboard in locations where there are copy options.

Other Changes and Updates

  • Fix: Better routing of internal URLs in multiple windows.
  • Change: Add horizontal rule match to Markdown syntax definitions (***, —).
  • Fix: Editing templates in actions should default to smart quote/dashes disabled.
  • Fix: “Insert Text” action steps could convert quotes and dashes to “smart” ones even when the feature is disabled.
  • Fix: “Edit action in new window” contextual menu command not working properly.
  • Fix: Setting new range with editor.setSelectedRange might not always scroll that range to be visible.
  • Change: Tighten up display in some of the widgets.
  • New: Added shift-command-L “Toggle flag” keyboard shortcut to match Mac shortcut.
  • Change: Audited reserved keyboard shortcut list to include some additional shortcuts that create conflicts on Mac.
  • Fix: Changing current draft syntax via script would not re-render the text in the new syntax immediately.
  • Fix: Better handling of empty state in arrange mode.
  • Fix: Avoid case where text did not scroll to fully visibility when editing on the iPad in slideover.
  • Change: Some changes to the way swipe gestures interact with pinning.
  • Fix: Focus mode not selecting next draft after success properly
  • Change: Allow previews to open non-http links.
  • Fix: Submitting invalid data to FileManager.writeJSON could crash the app.
  • Change: Opening a draft via /open URL should restore the last selected position in the draft.
  • Fix: Tapping task marks should be undoable.
  • Change: Make {== highlight ==} CriticMarkup syntax in MultiMarkdown more prominent in some of the themes.
  • Fix: “Export” action step should only add .txt file extension if the filename template did not already provide an extension.
  • Change: Add command-L keyboard shortcut for “Find in List”
5 Likes

Drafts 20 (Mac) Release Notes

What’s New

  • Wiki-style markup for cross-linking between drafts, and executing basic Drafts commands. Useful for linking research notes, creating a table of content of other related drafts and more. When embedded in a draft, these become clickable links that open URLs as described below:
    • [[Title of Draft]] : Creates a link which will open a draft by title (first line) when clicked/tapped. Will create a draft with the title if it does not exist. This default syntax can also be expressed simply as [[d:Title of Draft]] if necessary to avoid conflicts. Title matching is loose to allow partial matches for text in the first line of draft, so [[My Title]] would also match a draft with the first line [[# My Title]].
    • [[u:UUID-OF-DRAFT]] : creates a link for the specific draft by UUID to allow exact linking. Will not create a draft, it must exist.
    • [[s:Search Term]] : creates a link which will open a quick search to the specified search
    • [[w:Workspace Name]] : creates a link which will load the named workspace
    • [[google:Search term]] : Opens a Google search for “Search term” when clicked/tapped.
    • [[wikipedia:Search term]] : Opens a Wikipedia page for “Search term” when clicked/tapped.
    • [[bear:Title of Bear Note]] : Opens a note titled “Title of Bear Note” in Bear, if it exists. This utilizes the Bear /open-note URL scheme.
    • These link markers are only available when using Markdown, MultiMarkdown or GitHub Markdown syntax definitions.
    • See Linking Drafts article for additional details.
    • The Examples: Cross-Linking action group also provides example actions to facilitate cross-linking drafts in a project.
  • "Typewriter Scrolling" option fixes the cursor position in the middle of the editor, moving the text as you type. Feature can be enabled/disabled in the “Aa” editor settings, or via contextual menu (tap and hold) on the “Aa” button. Details
  • Navigate menu (down-arrow in top right) now has additional options for navigating to recent drafts.
  • “Last Draft” < toolbar button to go back to the last draft loaded in the editor.
  • Scripting additions:
    • Most JavaScript objects now support new keyword. So new Draft() now works in lieu of Draft.create() (old syntax still works).
    • Draft object additions and changes: Docs
    • title property now strictly returns the first line of draft
    • displayTitle property returns cleaned up title as it would be displayed in the draft list, removing Markdown header characters, etc.
    • lines property returns content as an array of string split on line feeds.
    • editor.recentDrafts property returns an array of recent drafts loaded in the editor, with the most recent previous draft as the first index. Useful for navigation in actions. Docs
    • app.openInNewWindow(draft) script method. (iPad/Mac). Pretty self explainatory I think. Docs
    • Scripting access to editor navigation markers, as displayed in the Navigation window/menu. Allows for the creation of actions that navigate within the current document. Docs
    • editor.navigationMarkers: An array of navigation markers available in the document. Docs
    • editor.navigationMarkerAfter(location: number) and editor.navigationMarkerBefore(location: number) convenience methods to get the next/previous navigation markers relative to a location in the text.
    • Example actions:
      • Previous Marker: Move cursor to the previous marker (Header, etc.) in the draft.
      • Next Marker: Move cursor to the next marker (Header, etc.) in the draft.
    • navigationMarkers are objects with the following properties:
      • location: start location of the range
      • length: length of the range
      • prefix: Identifying prefix for the marker (like H1, H2 in Markdown syntax) as defined by syntax
      • label: Identifying label for the marker.
      • level: indentation level of the marker.
    • FileManager has new getCreationDate(path), getModificationDate(path), and setCreationDate(path, date) and setModificationDate(path, date) functions. Docs
  • File action step has a new “Maintain dates” option which will set the creation/modification date of the newly created file to match those of the current draft. When the action creates a new file, creation and modification will be set - if it is appending/prepending, only modification date will be updated. Docs
  • Add the option to copy title to the clipboard in locations where there are copy options.
  • Contextual menus on drafts in Quick Search results.

Other Changes and Updates

  • Fix: Better routing of URLs in multiple windows to support new links better.
  • Change: Add horizontal rule match to Markdown syntax definitions (***, —).
  • Fix: Editing templates in actions should default to smart quote/dashes disabled.
  • Change: Audited reserved keyboard shortcut list to include some additional shortcuts that create conflicts on Mac.
  • New: Drafts in quick search results have contextual menus with common commands.
  • Change: Allow previews to open non-http links.
  • Fix: Submitting invalid data to FileManager.writeJSON could crash the app.
  • Fix: State of options in the main menu Editor menu not always correct when viewing drafts in secondary windows.
  • Fix: Crash clicking in empty space in manage actions window.
  • Fix: Editing templates in actions should default to smart quote/dashes disabled.
  • New: Context menu in drafts in the draft list and quick search add “Open in New Window” option.
  • Fix: Specifying locale when calling editor.dictate() did not set the requested locale properly.
  • Fix: Clipping issue in editor preferences.
  • Fix: Change the current draft’s syntax in a script would not update syntax selection dropdown menu.
  • Fix: Better handling of empty state in arrange mode.
  • Change: Add command-L keyboard shortcut for “Find in List”
  • Change: Opening a draft via /open URL should restore the last selected position in the draft.
  • /open URL scheme now supports additional “title” and “allowCreate” parameters that allow drafts to be found and opened by title - and, optionally created as a new draft if a matching title is not found.
  • Arrange mode now supports expand/collapse modes like iOS version.
  • Fix: “Export” action step should only add .txt file extension if the filename template did not already provide an extension.
  • Change: Make {== highlight ==} CriticMarkup syntax in MultiMarkdown more prominent.
3 Likes

This is fantastic! I’d been reading up about Zettelkasten, fretting about which tool to use, and now I can do it all in Drafts.

Thank you!!

Euan

2 Likes

This reminds me of an old saying:

– Who is the greatest physicist of the 20th century?
– Albert Einstein.

– Who is the second greatest physicist of the 20th century?
– Albert Einstein (for all the other things he has done).

Time will tell but with this release I get the feeling that Drafts is not only my greatest app but also my second greatest app for “all the other things” it can do (s.a. project management, reminders, document repository to mention a few).

Thank you Greg!

3 Likes

:tada: Typewriter scrolling! :tada: Thanks so much.

Excellent. Thanks a bunch for all the regular updates and new useful features. I have been using Drafts for many years and it’s a total standout in terms of usefulness, quality, speed and everything else. Also, by complete coincidence, I was thinking the other day that typewriter scrolling would be a great addition, and…it suddenly appears!

1 Like

When the release notes for a single version look like the release notes for an entire feature set of another app.

Sterling work Mr Pierce!

1 Like

Thanks for the update. The issue I was just getting ready to report is gone with the 2.0 release. Of course now the pain to delete beta and install final release.

I know 1st world problem.

Fantastic update, many solid features I can put to uise right away. Many thanks, Greg.

A question… that might reflect my lack of understanding on the release doc. Is there (or could there be) a way to see jump links in the text? The navigation as it stands is first class but there are times when I ned to do it with one hand and jab an anchor link while keeping eye contact with an audience.

Thanks again for such a quality piece of work (and I don’t just mean the update!)

SO EXCITED!!! I requested double bracket link functionality in Feb 19. Super pleased to see it fleshed out so thoughtfully!!

Just to clarify my question:

Navigation markers are defined by the syntax highlighting in use for the draft, and may vary by syntax, but in the case of Markdown drafts, markers are generated for all headings (## Heading).

So how do I get the navigation marker for a Markdown heading into the draft (like part of a TOC)?

I can’t see a way of copying the markers in the nav. drop-down

I can see the functionality is all there, but I can’t yet see how to use it within the text.

I updated my Link Helpers Actions Group to use the new [[wiki-style]] linking capability — so much easier to read + use drafts with this format, thank you!!

1 Like

Greg: Amazing.

I use a small fraction of Drafts capability, with heavy-lifting done in org mode. Nevertheless, I’m happy to subscribe to your app if only to see this killer app flourish.

2 Likes

I’m wondering what I would need to do to use DuckDuckGo as my search engine of preference rather than Google? I tried [[duckduckgo: Search Term]] but that didn’t work. TIA, Andy

That’s not something implemented in the current release. When custom syntax definitions become available (later this year, hopefully) it would be something that could be added for use in your installation. You can, of course, already use actions to search DuckDuckGo for a text selection, see examples in directory.

Is there a way to search for something like „- [ ] do asap“? I tried [[s:- [ ] do asap]] and all variations like url-escaping, using different „“ versions and alike but can‘t get it running.