notaapp / talk

Issues and discussions for the notes app, Nota.
https://nota.md
59 stars 1 forks source link

Template for daily note #408

Open petrbouchal opened 11 months ago

petrbouchal commented 11 months ago

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:

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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.