Giter VIP home page Giter VIP logo

thingy's Introduction

Thingy: A Things Parser for Drafts 5

Installation

An action group is available for download in the Drafts Action Directory. If you wish to customize, run npm run build to generate the bundled script to import into Drafts.

Overview

Like most parsers, multiple tasks can be specified, one task per line:

Vacuum the rug
Paint the lawn
Mow the hedge
Shave the chickens

If you select text in a draft, only that text will be processed. Properties can be defined by prefacing the value with an emoji. Keyboard actions are provided to facilitate easy entry.

Property Note
๐Ÿท Tags One or more, separated by commas
๐Ÿ“ List Must be exact project or area name or ID
๐Ÿ“† When Can be fuzzy date; including a time will set a reminder
โฐ Reminder Time only; can also be appended to "when" value
โš ๏ธ Deadline Date only, time will be ignored
๐Ÿ“Œ Heading Heading name (exact; ignored if doesn't exist)
๐Ÿ”˜ Checklist item Can include multiple item definitions
๐Ÿ—’ Notes Ironically, no notes about this

So now our tasks can have tags, be assigned to lists, and given notes, dates, and checklist items:

Vacuum the rug ๐Ÿท Home ๐Ÿ“ Chores โฐ 3:00
Paint the lawn ๐Ÿท Home ๐Ÿ“ Landscaping
Mow the hedge ๐Ÿท Home ๐Ÿ“ Landscaping
Shave the chickens ๐Ÿท Farm ๐Ÿ“ Livestock ๐Ÿ“† Tonight 7pm

Adding whitespace makes things a bit more readable. The keyboard actions included in the bundle automatically format properties on a new line, with indentation:

Vacuum the rug
  ๐Ÿ“ Chores
  ๐Ÿท Home
  โฐ 3:30

Paint the lawn
  ๐Ÿ“ Landscaping
  ๐Ÿท Home
  ๐Ÿ“† Next Saturday
  ๐Ÿ”˜ Wash brushes and rollers
  ๐Ÿ”˜ Lay down tarp to protect sidewalk
  ๐Ÿ”˜ Make sure paint can lids are closed tightly!

Mow the hedge
  ๐Ÿ“ Landscaping
  ๐Ÿท Home
  โš ๏ธ 2 weeks

Shave the chickens
  ๐Ÿ“ Livestock
  ๐Ÿท Farm
  ๐Ÿ“† Tonight 7pm
  ๐Ÿ—’ Remember to use a fresh razor blade!

Dates

While Things does an admirable job parsing natural language dates, I opted to employ DateJS to allow for additional flexibility. Some examples of valid dates:

  • Tonight
  • Next Saturday
  • in 3 weeks
  • +4d
  • July
  • Someday

Any date can be offset by appending +4 or -7 to the string. This will add 4 days, or subtract 7 days, from the parsed date. (It may not seem very useful, but it comes in handy when processing template tags. Keep reading.)

A few things to note:

  • If only a time is specified, today's date will be assumed
  • If a time associated with today's date is after 5pm, the task will be automatically categorized in the "this evening" section.
  • If a specified time is before 7:00 and lacks an am/pm suffix, it will be assumed to be in the evening. We don't want accidental reminders at 5am.

Autotagger

Tags and other properties can be automatically applied to tasks based on pattern-based rules. When you first run the "Add Things Tasks" action, a new "Thingy Autotagger Rules" draft note will be placed in your inbox. This note will contain a handful of default autotagger rule definitions:

# Thingy Autotagger Rules

Starts with "Call"   ๐Ÿท Calls
Starts with "Email"  ๐Ÿท Email
Contains "Mom"       ๐Ÿท Mom
Contains "Dad"       ๐Ÿท Dad

Starts with "Waiting For|WF"
  ๐Ÿท Waiting For
  ๐Ÿ“† Tomorrow
  โš ๏ธ 1 week

Starts with "Drop off|Pick up|Deliver"
  ๐Ÿท Errands

You can edit or add to these rules as you see fit. Feel free to archive the draft if you don't want it cluttering up your inbox... just don't change the title. (Side note: You can have multiple config files if you want. Just make sure the title starts with "# Thingy Autotagger Rules".)

Autotagger rules are defined just like tasks, but follow a specific notation:

Syntax Description
Starts with "Call" Task must start with "Call"
Ends with "ASAP" Task must end with "ASAP"
Contains "groceries" Task must contain the word "groceries"
Matches "^Bug( #\d+)?:" Task must match the regular expression
All tasks Match all tasks

All rules are case-insensitive, and all but regular expression rules must be anchored against word boundaries. For example, Starts with "Call" will match "Call Bob", but not "Callously berate Bob for constantly being late".

Multiple options can be referenced, separated by the | character. For example, Contains "groceries|grocery store|Whole Foods" will match tasks that contain "groceries", "grocery store", or "Whole Foods".

Projects

When you give your document a title that begins with a hash mark, your tasks will be created as a part of a new project. Any headings referenced in task properties will be created. For example:

# Trip to Maui

Pack luggage
  ๐Ÿท Home
  ๐Ÿ“Œ Packing
  ๐Ÿ”˜ Swimsuit
  ๐Ÿ”˜ Flip-flops
  ๐Ÿ”˜ Sunscreen

Pack carry-on bag
  ๐Ÿท Home
  ๐Ÿ“Œ Packing
  ๐Ÿ”˜ Kindle
  ๐Ÿ”˜ iPad
  ๐Ÿ”˜ Chargers

Take out the trash
  ๐Ÿท Home
  ๐Ÿ“Œ Before Leaving

Drop dog off at sitter
  ๐Ÿท Home
  ๐Ÿ“Œ Before Leaving

Make sure you have your tickets and passport!
  ๐Ÿท Home
  ๐Ÿ“Œ Before Leaving

Template Tags

Thingy will scan your document for template tags, and prompt you for values before processing. This comes in handy when combined with project templates and date offsets:

# Pack for trip to [[City]]

Pack luggage for trip to [[City]]
  ๐Ÿท Home
  ๐Ÿ“† [[Departure Date]] -3
  โš ๏ธ [[Departure Date]] -1

Take out the trash before leaving for [[City]]
  ๐Ÿท Home
  ๐Ÿ“† [[Departure Date]]
  โš ๏ธ [[Departure Date]]

Note that template tag names are case sensitive, and can only contain letters, numbers, spaces, and underscores. Thingy will not prompt you for values for any built-in Drafts template tags your document contains.

thingy's People

Contributors

dansays avatar

Stargazers

Roman avatar vancaem avatar

Watchers

vancaem avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.