Closed sdondley closed 1 year ago
@sdondley Thanks for opening this issue. It seems I made a mistake in the default config. Can you please change the following lines in your .taskopenrc file:
notes.regex = "^Notes\\.(.*)"
notes.command = "editnote ~/Notes/tasknotes/$UUID.$LAST_MATCH \"$TASK_DESCRIPTION\" $UUID"
into
notes.regex = "^Notes(\\..*)?"
notes.command = "editnote ~/Notes/tasknotes/$UUID$LAST_MATCH \"$TASK_DESCRIPTION\" $UUID"
Changing the notes.regex
value to your suggestion didn't actually work but this did:
notes.regex="^Notes$"
notes.command="editnote ~/notes/tasknotes/$UUID$LAST_MATCH \"$TASK_DESCRIPTION\" $UUID"
Thanks for the hand.
OK, I've been playing around with this a bit more to get a feel for how this might work. I would like the default notes to be recognized as a vimwiki/taskwiki file. So I add the following line to my vimwiki config:
{path = '~/Documents/notes/tasknotes', auto_toc = 1, syntax = 'markdown', ext = '.md', name = 'tasknotes'},
Now, I need the notes to be markdown files with an markdown extension of *.md to be recognized. So from the command line I do:
task 123 annotate Notes.md
To get this to work, I need the following config settings:
notes.regex="^Notes\\.(.*)?"
notes.command="editnote ~/Documents/notes/tasknotes/$UUID.$LAST_MATCH \"$TASK_DESCRIPTION\" $UUID"
So now when I do:
taskopen 123
It opens the file up as a markdown file with a filetype set to vimwiki
.
Is this how it's intended to be used?
Yes, that is the intended use.
With the modified regex that I posted above, it should be possible to omit the extension though. At least it does so on my Linux machine.
Is that regex used by bash or Nim?
I'm using zsh so maybe that's part of the problem?
Changing the regex to notes.regex="^Notes\\.?(.*)?"
seems to work well. Note the question mark after the first period, making the period optional.
It's used by Nim. Maybe there is a difference in the PCRE library on Mac.
I just tried your initial suggestion for the regex again and it worked this time. I must have had a typo in my first attempt.
At any rate, I'm going to default to using .md files. Is there any good reason that I might not want to?
I just tried your initial suggestion for the regex again and it worked this time. I must have had a typo in my first attempt.
Perfect. Thanks for re-testing.
At any rate, I'm going to default to using .md files. Is there any good reason that I might not want to?
I cannot think of any ;-)
I used version 1 of this software and it worked fine. I'm upgrading to version 2 but I'm having problems getting things to work. I'm not sure if the README is still accurate or if I have something misconfigured. Either way, I'm having a hard time following exactly how to get this configured so it works.
My first problem is trying to get default notes working with the instructions at https://github.com/jschlatow/taskopen#add-default-notes
When I do
task 1 annotate Notes
all it does it add a text annotation called "Notes. When I trytaskopen 1
, it says `No actions applicable." I'm not sure what this means or how to resolve it. Here's the diagnostic output:The path to
editnote
appears to be fine, it returns: Usage:/Users/steve/bin/editnote <file-path> <description> <uuid>
Thanks.