naggie / dstask

Git powered terminal-based todo/note manager -- markdown note page per task. Single binary!
https://calbryant.uk/blog/dstask-a-taskwarrior-alternative/
MIT License
804 stars 47 forks source link

feature request? add file links #74

Closed rhaynes74 closed 4 years ago

rhaynes74 commented 4 years ago

Hi folks, it would be great (maybe it exists) to have a command which allows me to add file attachments to a task - something like:

dstask addfile ./filename.txt ./file.pdf taskid

And then be able to open the files with dstask open

naggie commented 4 years ago

Hi @rhaynes74 -- thnaks for the suggestion. I think this is probably beyond the scope of dstask. Plus there would be issues if the file was externally modified; dstask would not know when to commit the changes or how to handle merges.

Is you use case with mutable or immutable files?

rhaynes74 commented 4 years ago

Likely a mix of the two in my use case.

Sincerely,

Dr. Ronald D. Haynes

Professor, Department of Mathematics and Statistics Chair, MSc and PhD Scientific Computing Programs Memorial University of Newfoundland

We acknowledge that the lands on which Memorial University’s campuses are situated are in the traditional territories of diverse Indigenous groups, and we acknowledge with respect the diverse histories and cultures of the Beothuk, Mi’kmaq, Innu, and Inuit of this province. On Nov 12, 2020, 5:13 AM -0330, Callan Bryant notifications@github.com, wrote:

Hi @rhaynes74 -- thnaks for the suggestion. I think this is probably beyond the scope of dstask. Plus there would be issues if the file was externally modified; dstask would not know when to commit the changes or how to handle merges. Is you use case with mutable or immutable files? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

naggie commented 4 years ago

I see -- actually, thinking about it, if the files were outside the dstask repository there isn't a problem and it's already supported; the possible downside is the dfiles won't be synced automatically across computers. You could do that with syncthing or dropbox, however.

Given dstask looks for anything that looks like a URL for the open command, you could use file URLs, for instance:

$ dstask add foo bar file:///home/naggie/test.jpg

Active context: +work

Added 10: test file:///home/naggie/test.jpg
[master 1b247bdb8] Added 10: test file:///home/naggie/test.jpg
 1 file changed, 12 insertions(+)
 create mode 100644 pending/870e6b71-f842-4ff6-bf67-5bcba24466f9.yml

$ dstask open 10

test.jpg then opens in your default image viewer.

rhaynes74 commented 4 years ago

Thanks for the additional response.  Anyway to simply the command so that your file:/// syntax is allowed or  you just specify a path (or filename if you are in the directory) and the url gets formed in the note/annotation?

Sincerely,

Dr. Ronald D. Haynes

Professor, Department of Mathematics and Statistics Chair, MSc and PhD Scientific Computing Programs Memorial University of Newfoundland

We acknowledge that the lands on which Memorial University’s campuses are situated are in the traditional territories of diverse Indigenous groups, and we acknowledge with respect the diverse histories and cultures of the Beothuk, Mi’kmaq, Innu, and Inuit of this province. On Nov 12, 2020, 3:52 PM -0330, Callan Bryant notifications@github.com, wrote:

I see -- actually, thinking about it, if the files were outside the dstask repository there isn't a problem and it's already supported; the possible downside is the dfiles won't be synced automatically across computers. You could do that with syncthing or dropbox, however. Given dstask looks for anything that looks like a URL for the open command, you could use file URLs, for instance: $ dstask add foo bar file:///home/naggie/test.jpg

Active context: +work

Added 10: test file:///home/naggie/test.jpg [master 1b247bdb8] Added 10: test file:///home/naggie/test.jpg 1 file changed, 12 insertions(+) create mode 100644 pending/870e6b71-f842-4ff6-bf67-5bcba24466f9.yml

$ dstask open 10 test.jpg then opens in your default image viewer. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

naggie commented 4 years ago

I assume this is so you can do completions or use relative file paths. Unfortunately there isn't -- I don't want to add it either as I think that's outside the scope.

naggie commented 4 years ago

I'll close the issue now as there's a partial solution at least