-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Create a new note in Inbox using template #14
Comments
So you want to be able to have a template for the filename and content of a note? How I understand the feature requestLets say I create a new command Now as I can tell from what you wrote, the Templater Plugin supports some placeholders (e.g. Zettelkasten/date) which will be replaced when creating a new note from a template. To have this functionality in Raycast I would need to implement these placeholders too. Some questionsCould you tell me which placeholders have to be added and what syntax is being used to mark placeholders? (e.g. Do you think this would come close to the templater experience? Anything to add/remove? Thank you for the feature request! |
Hi @baseliners, any thoughts on this? |
Hi @marcjulianschwarz - the way I was thinking about this is simpler (I think). i.e. your raycast plugin would invoke whatever mechanism Obisidian is using to create a new note using a Templater template. Not sure if the advanced URI plugin already handles templates, but if yes, it might be as simple as invoking a new note creation URI for a note in a certain folder, and if that folder has a template associated with it in Templater, that template gets used. Personally, I'd be OK losing the form functionality that you currently have and have the plugin just drop me directly into Obsidian. If you wanted to parameterize, I'd parameterize the folder where a new note is being created, and allow for keyboard shortcuts to be assigned to each folder. i.e. I can assign a keyboard shortcut to create a note in Inbox, and another shortcut to create a note in folder XYZ, etc. This would provide a lot of flexibility and you wouldn't have to duplicate the templater functionality in your plugin. Thx! |
Hi @baseliners, thank you for the clarifications. Now I understand how the Templater plugin works, didn't know about the folder-template-association. In the These folders will show up as actions in the command. Triggering them will add a new empty file in the corresponding folder. You can still override the path using the form or you could add a filename with the form. I think the notes content will be replaced with the template. Open for feedback :) |
Right now the shortcut for every action will be created automatically (counting from 0 to 9). I might need to change this behavior as some of these keyboard combinations are already in use by the OS. |
This sounds great! How can I try it out? |
You could download/clone this repository, then navigate to the folder and run |
@baseliners let me know when you were able to test it. |
Thanks. I was able to install and run it, but when I trigger the action for the Inbox folder, it tries to create a note with the filename Untitled.md instead of the filename that should be generated via the Templater template. Here's what my template looks like for the Inbox folder (i.e. the following line is what the template file associated w/ Inbox contains):
So in Obsidian, if I create a new note (I have Inbox as the default location for new notes), the filename generated would be something like I suppose the extension is bypassing the Templater somehow. Wonder if there's a way to have Templater still trigger even if the note creation is triggered by the Raycast extension? |
Templater will trigger. I tried some of the examples from Templaters website and they worked. Maybe the plugin isn't enabled or the template hasn't been selected in Templaters settings? |
This shows it working: 2022-04-24.23-54-47.mp4As you can see Obsidian will throw an error that the file doesn't exist because it got renamed (Raycast is trying to open the old file name, this can be disabled in the extensions settings). |
OK great, figured out the issue. I already had a file named Untitled.md in my Inbox so it was preserving that file. May be worth choosing another default name for the temp file? Also, noticed that if I use the Command+Shift+return shortcut to create the note, it does create the file but does not drop me into the note. If I hit Command-K and then select the action for Inbox, it does drop me into the note that was just created. Not sure if this is intended behavior? I have the checkbox checked for "Open note on Creation" so was expecting the note to be opened via the keyboard shortcut as well. Btw, is there a way to set a global shortcut for the action to create a new note in Inbox? I set a global shortcut to "Create Note" but would be nice to have a shortcut for creating a note in a specific folder as well.. but maybe this is something that Raycast needs to support? |
Which default name would you suggest? Can't reproduce this behavior. Both the shortcut and manually selecting the action from the list works for me. I don't think there is a way to set global shortcuts for actions. The only way this would work is to create commands for each folder. However I don't think that this would comply with Raycasts guidelines for extensions. For "non-tech people" this could be quite confusing. |
@baseliners any suggestions? I can add a preference where you can choose the default note name. |
Hi @baseliners, I just pushed a new version. You can now specify a default note name for the |
Hi @baseliners, |
Would be great to have a command to create a new note in Inbox that uses the template assigned to new notes in Inbox via the templater plugin (eg I have a template for any new note in Inbox that creates a prefix for the filename with today's date in almost-Zettel format). Thx for this plugin!
The text was updated successfully, but these errors were encountered: