Giter Club home page Giter Club logo

Comments (9)

jschlatow avatar jschlatow commented on June 26, 2024

@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"

from taskopen.

sdondley avatar sdondley commented on June 26, 2024

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.

from taskopen.

sdondley avatar sdondley commented on June 26, 2024

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?

from taskopen.

jschlatow avatar jschlatow commented on June 26, 2024

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.

from taskopen.

sdondley avatar sdondley commented on June 26, 2024

Is that regex used by bash or Nim?

I'm using zsh so maybe that's part of the problem?

from taskopen.

sdondley avatar sdondley commented on June 26, 2024

Changing the regex to notes.regex="^Notes\\.?(.*)?" seems to work well. Note the question mark after the first period, making the period optional.

from taskopen.

jschlatow avatar jschlatow commented on June 26, 2024

It's used by Nim. Maybe there is a difference in the PCRE library on Mac.

from taskopen.

sdondley avatar sdondley commented on June 26, 2024

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?

from taskopen.

jschlatow avatar jschlatow commented on June 26, 2024

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 ;-)

from taskopen.

Related Issues (20)

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.