KevinBatdorf / obsidian-raycast

Raycast extension with commands for the note taking app Obsidian.
MIT License
106 stars 19 forks source link

Add "Append to Daily Note" command #35

Closed iancanderson closed 1 year ago

iancanderson commented 1 year ago

Closes https://github.com/marcjulianschwarz/obsidian-raycast/issues/31

TODO:

I've been putting TODOs in my daily note, so I would use this with a template of - [ ] and a heading preference of TODO to append a task to my TODO heading.

I have this mapped to a td alias, so it's very quick to append:

iancanderson commented 1 year ago

Here's a little demo of how it's working for me:

https://user-images.githubusercontent.com/180798/198576008-88650b42-3546-4241-9caa-6f9b347dc954.mov

iancanderson commented 1 year ago

@marcjulianschwarz I reimplemented this as a "view" command in 932e1c9dcd0dfe16c736d34691dc582924850798, allowing it to reuse more code including the useObsidianVaults hook. Seems to work well, let me know what you think!

marcjulianschwarz commented 1 year ago

Looks good to me!

However I am getting an error that my vault doesn't exist. I tested a few different vaults and found out that it doesn't work with vaults made up of more than one word. For example a vault with the name Test would work where a vault with the name Test ABC would not.

Bildschirm­foto 2022-10-29 um 21 47 04

I have tried to uri encode the vault name but this didn't work as well. The normal daily note command works fine. Maybe this is an issue on the advanced-uri plugins side?

iancanderson commented 1 year ago

Ah, I think the issue is URLsearchparams instead of using encodeURIComponent for the vault name. I'll try to fix this soon 👍🏻

iancanderson commented 1 year ago

@marcjulianschwarz I think we're good now! I appreciate the testing, vaults (and heading names) with spaces seem to work fine now 👍

marcjulianschwarz commented 1 year ago

Thanks for your work!

Will work on some of the items in the "Progress" column of the roadmap and release this command together with those fixes.

marcjulianschwarz commented 1 year ago

Do you have a Raycast account? If so, can you please tell me your name so I can add you as a contributor?

iancanderson commented 1 year ago

@marcjulianschwarz I do! iancanderson on there as well. Thanks!

marcjulianschwarz commented 1 year ago

Hi @iancanderson I was finally able to release the version with your contribution.