pajoma / vscode-journal

Lightweight journal and simple notes support for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=pajoma.vscode-journal
GNU General Public License v3.0
232 stars 40 forks source link

Add support to create note for specific journal entry #149

Open Neutrino-Sunset opened 1 year ago

Neutrino-Sunset commented 1 year ago

It's possible to create a task for a specific day, although it's a bit bugged.

If you press CTRL+SHIFT+J then type task mond <taskname> it will add a task to the entry for Monday. The minor bug is that task mon <taskname> will add the task to today's journal instead of Monday's (note the missing d), and when using task mond <taskname> it will add the d from the task mond to the start of the task, which is annoying.

I don't need a Journal entry every day, so I use one per week which I create on Monday.

Currently if I use CTRL+SHIFT+J Select/Create a Note it will automatically create a new journal entry for the current day, and link the note from there. If I do this on any day other than Monday this creates a journal entry I will never use and makes finding my notes a pain.

I would like the ability to create a note for a specific day in exactly the same way as I can create a task for a specific day, so as to avoid creating redundant journal entries and to make it easier to organise my notes.

E.g. Pressing CTRL+SHIFT+J and typing note mon SecurityCodeReview should create a note SecurityCodeReview.md linked from my existing Journal for Monday.

edthedev commented 1 year ago

I don't have an exact solution, but I worked around this challenge by configuring my notes to all store with only the year and month in their path.

"journal.patterns": {
        "notes": {
            "path": "${base}/${year}/",
            "file": "${month}-${input}.${ext}"
        },

This allows me to run Journal: New Journal Note, and type, for example mentorship, and in June of 2023, it will create or open a file named 2023/06-mentorship.md.

In July, doing the same will start a new file called 2023/07-mentorship.md.

This doesn't give me weekly granularity, and I don't see 'week of the year' as an option here, https://github.com/pajoma/vscode-journal/blob/HEAD/docs/settings.md#notes .

But I've found monthly to be close enough for my purposes.

Neutrino-Sunset commented 1 year ago

Thanks for the suggestion, but I really wanted the notes I create during the week to be both linked into my journal page for the week, and stored with it on the drive too.

I've forked the repo and modified the logic so that whenever you create a note it is attached to the journal entry for the Monday.

If I get around to adding a config setting for this or adding the support to create the note on any day you like, as described in my OP, then I'll create a PR, but for now if anyone wants this or similar functionality feel free to fork or clone my repo.

https://github.com/Neutrino-Sunset/vscode-journal

pajoma commented 1 year ago

If you press CTRL+SHIFT+J then type task mond it will add a task to the entry for Monday. The minor bug is that task mon will add the task to today's journal instead of Monday's (note the missing d), and when using task mond it will add the d from the task mond to the start of the task, which is annoying.

Interesting, it was supposed to be "mon". Well, I always use the offset, I will check it out.

I don't need a Journal entry every day, so I use one per week which I create on Monday.

You could also use the weekly entries then (just enter "w" or "w12" for week 12 of this year)

Currently if I use CTRL+SHIFT+J Select/Create a Note it will automatically create a new journal entry for the current day, and link the note from there. If I do this on any day other than Monday this creates a journal entry I will never use and makes finding my notes a pain.

The path patterns are described here. Does the week number (1-52) already help you here?

E.g. Pressing CTRL+SHIFT+J and typing note mon SecurityCodeReview should create a note SecurityCodeReview.md linked from my existing Journal for Monday.

I would rather prefer to keep it simple once you are in the notes input. If we could stick to the weekly entries, we can collect all notes created in one particular week there.

Neutrino-Sunset commented 1 year ago

It might be possible to do what I want with the week funtionality, but finding out about it, how it works and how to configure it is not obvious. I've been using this Journal extension for years and I never knew it had support for week entries, I don't see it mentioned in the documentation.

Using the week functionality to open a journal for the week could be useful, but the week numbers themselves aren't particularly meaningful to me. Our sprints run from a start date to an end date, so if I need to find my notes for a particular sprint having them dated makes this really easy. So if I were to use the week entries I would still like them to be named and stored using the date.

This documentation here shows how to configure the paths for notes and entries, but I don't see how to configure the pattern for week entries vs normal entries. It's not clear where this configuration should go, I would guess straight into the VsCode settings json, but extensions that put configuration directly into the VsCode settings JSON normally prefix their configuration with the extension name, as in this extension's other configuration, journal.templates and journal.scopes.

If I were able to configure the week entries to use the date in the path and the name, it seems there would be some adjustments needed to the logic to link notes to the week entries instead of creating a new daily entry. If you plan to make any changes in this area I'll be interested to see what you come up with. I'd love to help but I can't promise much as I'm seriously under the hammer at work atm, but I'm certainly happy to test anything and give you some feedback if it helps.