Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dwertheimer.TaskSorting/CHANGELOG.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,13 +4,18 @@

See Plugin [README](https://github.com/NotePlan/plugins/blob/main/dwertheimer.TaskSorting/README.md) for details on available commands and use case.

## [1.2.1] - 2024-10-13 (@jgclark) _unreleased_
- added basic sortTasksViaExternalCall() as an exported command
- added ability for "Sort tasks under heading" to be called externally with a passed heading parameter
- removed code for openTasksToTop() which didn't work and wasn't exposed as a command
- code tidy up, and fix the flow errors I was confident about

## [1.2.0] - 2025-01-25 (@dwertheimer)

- Added sortTasksUnderHeading command to sort tasks under a heading.
- Added /cnt command

## [1.1.0] - 2024-05-26 (@aaronpoweruser)

- Added /cnt command to copy **all** noteTags to **all** tasks in a note.
- Added an onSave trigger command for cnt.

Expand Down
76 changes: 49 additions & 27 deletions dwertheimer.TaskSorting/plugin.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,14 +3,10 @@
"noteplan.minAppVersion": "3.4.0",
"plugin.id": "dwertheimer.TaskSorting",
"plugin.name": "🥷 Task Sorting & Tools",
"plugin.version": "1.2.0",
"plugin.lastUpdateInfo": "1.2.0: Added heading and sortOrder as params that can be passed. Added \\cnt copy noteTags command.\nInitial release of commands moved from the Task Automations plugin to the TaskSorter plugin.",
"plugin.version": "1.2.1",
"plugin.lastUpdateInfo": "1.2.1: Added 'sortTasksViaExternalCall' hidden command for external calls or other plugins.\n1.2.0: Added heading and sortOrder as params that can be passed. Added \\cnt copy noteTags command.\nInitial release of commands moved from the Task Automations plugin to the TaskSorter plugin.",
"plugin.description": "Commands for sorting tasks in a note",
"plugin.author": "dwertheimer",
"plugin.requiredFiles-EDIT_ME": [
"html-plugin-comms.js"
],
"plugin.requiredFiles-NOTE": "If you want to use HTML windows, remove the '-EDIT_ME' ABOVE",
"plugin.dependencies": [],
"plugin.script": "script.js",
"plugin.url": "https://github.com/NotePlan/plugins/blob/main/dwertheimer.TaskSorting/README.md",
Expand All@@ -34,8 +30,8 @@
]
},
{
"name": "Sort tasks under heading (choose)",
"description": "sth",
"name": "Sort tasks under heading",
"description": "Sort tasks under heading",
"jsFunction": "sortTasksUnderHeading",
"alias": [
"tsh"
Expand All@@ -47,55 +43,55 @@
},
{
"name": "Tasks Sort by User Default (in settings)",
"description": "tsd",
"description": "Tasks Sort by User Default (in settings)",
"jsFunction": "sortTasksDefault",
"alias": [
"tsd"
]
},
{
"name": "Tasks Sort by calendar due date",
"description": "tsc",
"description": "Tasks Sort by calendar due date",
"jsFunction": "sortTasksByDue",
"alias": [
"tsc"
]
},
{
"name": "Tasks Sort by @Mention/person",
"description": "tsm",
"description": "Tasks Sort by @Mention/person",
"jsFunction": "sortTasksByPerson",
"alias": [
"tsm"
]
},
{
"name": "Tasks Sort by #Tag",
"description": "tst",
"description": "Tasks Sort by #Tag",
"jsFunction": "sortTasksByTag",
"alias": [
"tst"
]
},
{
"name": "Tasks Sort by #Tag + @Mention",
"description": "tstm",
"description": "Tasks Sort by #Tag + @Mention",
"jsFunction": "sortTasksTagMention",
"alias": [
"tstm"
]
},
{
"name": "Tasks to Top - Bring all tasks in note to top",
"description": "tt",
"description": "Tasks to Top - Bring all tasks in note to top",
"jsFunction": "tasksToTop",
"alias": [
"tt"
]
},
{
"name": "Mark All Tasks on Page (open or complete)",
"description": "mat",
"description": "Mark All Tasks on Page (open or complete)",
"jsFunction": "markTasks",
"alias": [
"mat"
Expand All@@ -104,67 +100,93 @@
{
"name": "cta - Copy tags from previous line",
"description": "Copy #tags and @mentions from previous line",
"jsFunction": "copyTagsFromLineAbove"
"jsFunction": "copyTagsFromLineAbove",
"alias": [
"cta"
]
},
{
"name": "cth - Copy tags from heading above",
"description": "Copy #tags/@mentions from heading to all lines between",
"jsFunction": "copyTagsFromHeadingAbove"
"jsFunction": "copyTagsFromHeadingAbove",
"alias": [
"cth"
]
},
{
"name": "ctm - Copy line for each mention",
"description": "Copy line for each @mention, listing it first",
"jsFunction": "copyLineForEachMention"
"jsFunction": "copyLineForEachMention",
"alias": [
"ctm"
]
},
{
"name": "ctt - Copy line for each hashtag",
"description": "Copy line for each #hashtag, listing it first",
"jsFunction": "copyLineForEachHashtag"
"jsFunction": "copyLineForEachHashtag",
"alias": [
"ctt"
]
},
{
"name": "cnt - Copy tags from noteTags",
"description": "Copies all noteTags to all tasks in note",
"jsFunction": "addNoteTagsToAllTask"
"jsFunction": "addNoteTagsToAllTask",
"alias": [
"cnt"
]
},
{
"name": "Add a onSave trigger to copy noteTags to all tasks",
"description": "Copies all noteTags to all tasks in note",
"name": "Add an onSave trigger to copy noteTags to all tasks",
"description": "Add an onSave trigger to copy noteTags to all tasks",
"jsFunction": "addNoteTagsTriggerToFm"
},
{
"name": "sortTasksViaExternalCall",
"description": "entry point to sortTasks from x-callback etc.",
"jsFunction": "sortTasksViaExternalCall",
"arguments": [
"JSON5 paramater string (withUserInput (boolean), sortFields (Array<string>), withHeadings (boolean), subHeadingCategory (boolean)"
],
"hidden": true
},
{
"name": "triggerCopyNoteTags",
"description": "onEditorWillSave",
"jsFunction": "triggerCopyNoteTags",
"hidden": true
},
{
"NOTE": "DO NOT EDIT THIS COMMAND/TRIGGER",
"name": "Task Sorting: Version",
"NOTE": "DO NOT EDIT THIS COMMAND/TRIGGER",
"description": "Update + Check Version",
"jsFunction": "versionCheck"
},
{
"description": "DO NOT EDIT THIS COMMAND/TRIGGER",
"name": "onOpen",
"NOTE": "DO NOT EDIT THIS COMMAND/TRIGGER",
"description": "entry point for onOpen trigger",
"jsFunction": "onOpen",
"hidden": true
},
{
"description": "DO NOT EDIT THIS COMMAND/TRIGGER",
"name": "onEditorWillSave",
"NOTE": "DO NOT EDIT THIS COMMAND/TRIGGER",
"description": "entry point for onEditorWillSave trigger",
"jsFunction": "onEditorWillSave",
"hidden": true
},
{
"NOTE": "DO NOT EDIT THIS COMMAND/TRIGGER",
"name": "onMessageFromHTMLView",
"NOTE": "DO NOT EDIT THIS COMMAND/TRIGGER",
"description": "dwertheimer.TaskSorting: Callback function to receive messages from HTML view",
"jsFunction": "onMessageFromHTMLView",
"hidden": true
},
{
"NOTE": "DO NOT EDIT THIS COMMAND/TRIGGER",
"name": "Task Sorting: Update Plugin Settings",
"NOTE": "DO NOT EDIT THIS COMMAND/TRIGGER",
"description": "Preferences",
"jsFunction": "editSettings"
}
Expand Down
31 changes: 8 additions & 23 deletions dwertheimer.TaskSorting/src/index.js
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
// @flow
// Last updated: 2024-10-13 for v1.1.1 by @jgclark
import pluginJson from '../plugin.json'
import { clo, logDebug, logError } from '@helpers/dev'

/**
* Imports
*/
// import pluginJson from '../plugin.json'
// import { clo } from '@helpers/dev'

// FETCH mocking for offline testing
// If you want to use external server calls in your plugin, it can be useful to mock the server responses
// while you are developing the plugin. This allows you to test the plugin without having to
// have a server running or having to have a network connection (or wait/pay for the server calls)
// Comment the following import line out if you want to use live fetch/server endpoints (normal operation)
// Uncomment it for using server mocks (fake/canned responses) you define in support/fetchOverrides.js
// import './support/fetchOverrides'
export { editSettings } from '@helpers/NPSettings'
export { onUpdateOrInstall, init, onSettingsUpdated, triggerCopyNoteTags, versionCheck } from './NPTriggers-Hooks'
export { onOpen, onEditorWillSave } from './NPTriggers-Hooks'

/**
* Command Exports
Expand All@@ -23,19 +16,11 @@ export {
sortTasksByTag,
sortTasksByDue,
tasksToTop,
openTasksToTop,
sortTasksViaTemplate,
// openTasksToTop,
sortTasksViaExternalCall,
sortTasksTagMention,
sortTasksDefault,
sortTasksUnderHeading,
} from './sortTasks'
export { addNoteTagsToAllTask, addNoteTagsTriggerToFm, copyTagsFromLineAbove, copyTagsFromHeadingAbove, copyLineForEachMention, copyLineForEachHashtag } from './tagTasks'
export { default as markTasks } from './markTasks'

/**
* Other imports/exports - you will normally not need to edit these
*/
// eslint-disable-next-line import/order
export { editSettings } from '@helpers/NPSettings'
export { onUpdateOrInstall, init, onSettingsUpdated, triggerCopyNoteTags, versionCheck } from './NPTriggers-Hooks'
export { onOpen, onEditorWillSave } from './NPTriggers-Hooks'
Loading