Skip to content
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

Template for daily note #408

Open
petrbouchal opened this issue Aug 9, 2023 · 4 comments
Open

Template for daily note #408

petrbouchal opened this issue Aug 9, 2023 · 4 comments

Comments

@petrbouchal
Copy link

It would be great to be able to create a template for daily notes (Today/Tomorrow). Currently this can only be done by having a separate folder for daily notes, but this cannot be linked to the "Today/Tomorrow" note commands. It also requires me to date-name the newly created files manually.

My ideal workflow:

  • once: create template e.g. _daily.md
  • daily: use Today/Tomorrow command
    => note is created named with date, in Root folder
    => note content corresponds to template

To extend this, one could imagine having several templates in the root folder for different "genres" of documents, with commands autogenerated for creating documents from these various templates.

@astoilkov
Copy link
Member

Do I understand correctly that you want to put your daily and other notes in one folder? However, this doesn't work because _template.md captures non-daily notes as well?

@petrbouchal
Copy link
Author

Ah yes, that is right - I hadn't tried the combo of setting the destination folder in settings to one with a _template.md in it.

That is solved then - having it stored alongside other notes is not crucial for me (I do prefer one large root folder holding different types of notes, but daily notes in a separate folder is OK).

That is where the second point comes in but is a separate issue/more general feature: multiple templates for one folder, or perhaps at top level to serve different folders, that would appear as commands. I imagine a template with a YAML header with a title field, where the title would determine how it shows up in the command menu, e.g. a _reading.md doc with the following header:

---
title: New reading note
name: reading_{{date}}.md
directory: reading-notes
---

would appear as "New reading note" and running the command would create a reading_2023-08-14.md document in the reading-notes directory.

It would make the task of creating different kinds of notes smoother and quicker (create from the command bar, name set automatically) but most of it can be serviced now using multiple folders.

@petrbouchal
Copy link
Author

Just FYI to your question: when the destination folder for daily notes is set to root and I use the Today command, no template is applied to the daily note.

@astoilkov
Copy link
Member

That is where the second point comes in but is a separate issue/more general feature: multiple templates for one folder, or perhaps at top level to serve different folders, that would appear as commands. I imagine a template with a YAML header with a title field, where the title would determine how it shows up in the command menu, e.g. a _reading.md doc with the following header:

I like that. Seems like a possible approach to v2 of templates.

Just FYI to your question: when the destination folder for daily notes is set to root and I use the Today command, no template is applied to the daily note.

Hmm, seems like a bug. I will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants