Gallery of patterns? #43
Replies: 2 comments 2 replies
-
@benhamilton, thank you for writing this up! I agree that sharing patterns like this could be of use for other users. I actually wrote Apply Patterns specifically to enable for myself the type of todo management you described above -- I also previously used, and have been heavily influenced by, org-mode's approach! Sharing patterns is something that I would prefer not to write into the plugin itself, in favor of offloading it to some existing platform. I also will say that I'm not in a position currently to curate such a collection myself, though I'd welcome help with that! With that in mind, I was first thinking that the Obsidian forum might be a natural place to share snippets, similar to this long-running stickied thread for CSS snippets. Alternatively, I also just now realized that GitHub's built-in Discussions "Category" feature might be well-suited to this -- So I just now renamed the "Show and Tell" discussion category in this Repo to "Example Patterns". Does that sort of approach -- a central discussion area centered in GitHub Discussions -- seem like it would be responsive to your idea? If so, I'd be happy to call it out / link to it in the Readme, so that it shows up when users are installing the plugin. I could also add a link in the Settings tab. |
Beta Was this translation helpful? Give feedback.
-
Rule example to add checkbox (in my case {
"name": "checkbox: cancelled",
"rules": [
{
"from": "- \\[.\\]",
"to": "- [-]",
"caseInsensitive": false,
"global": false,
"multiline": false,
"sticky": false,
"disabled": false
},
{
"from": "^([ \\t]*)- ([^\\[])",
"to": "$1- [-] $2",
"caseInsensitive": false,
"global": false,
"multiline": false,
"sticky": false,
"disabled": false
},
{
"from": "^([ \\t]*)- \\[(.[^\\]])",
"to": "$1- [-] [$2",
"caseInsensitive": false,
"global": false,
"multiline": false,
"sticky": false,
"disabled": false
}
],
"collapsed": false,
"cursorRegexStart": "$",
"cursorRegexEnd": "^"
}, |
Beta Was this translation helpful? Give feedback.
-
Could we have a gallery of pattern/command snippets? Thanks for this plugin, it's finally allowed me to do something I've wanted for a long time.
It took me some time to figure out how to get what I wanted, which was to be able to easily move tasks through a set of hashtags. I'm sure others would benefit, and the sharing of patterns might help others solve their particular problems too.
I'll insert my pattern export below, which lets me move tasks through a specific set of statuses. Back when I used Logseq, I asked for a feature to do essentially this which was based on org-mode functionality. This solution, using Apply Patterns doesn't enforce the sequencing, but allows for the fast and easy transition of tasks through the set of hashtags to signify statuses that I use.
I've mapped ⌘⌃⌥⇧ to my CapsLock key ⇪ using BetterTouchTool on macOS, then I've mapped ⇪R to Apply Patterns: Apply Pattern to whole lines in Obsidian → Settings → Hotkeys
Which means that when on a line, or with a number of lines selected, I can now press ⇪R and get the following:
Which will mark the task appropriately and replace the hashtag with the tag I've asked for.
For example, tasks If I select #wip from the list, it'll transform
- [ ] this task here #todo
into
- [/] this task here #wip
or if I select #pending from the list, it'll transform
- [/] this task here #wip
into
- [>] this task here #pending
or if I select #done from the list, it'll transform
- [/] this task here #wip
into
- [x] this task here #done
and so forth for the various statuses.
Apply Patterns v2.0.0, pattern export as JSON:
The eagle-eyed will notice a status of
in progress
in the JSON above, which is a leftover vestige from previous attempts, but no longer use, and I've still got some of these around, so when I meet them, these patterns will convert those to the new status set I've configured.Beta Was this translation helpful? Give feedback.
All reactions