Drafts 20 Released - Cross-linking Drafts + Typewriter Scrolling

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