Closed mandarvaze closed 1 year ago
Hi! Thanks for filing an issue.
From what you're describing, it sounds to me like this is what templates are supposed to do.
If you write an entry, then the template is ignored in favor of that entry.
Maybe they could work a bit differently, but I'm unclear what a template would be expected to do is there's already an entry.
Can you please explain in more detail where you expect a template to go if you've already entered jrnl diary yesterday at 10pm: backdated entry
in the terminal? Currently, that means your entry is "backdated entry" and we don't know where the template would go.
When you put it like that, it makes sense 😄
So is there a way to add older timestamp and add the entry via an editor ?
e.g. When I just enter jrnl diary
- an editor is launched and I start typing. The editor already contains the text from the template. The current timestamp is then added when saving the file. (I assume)
I want similar behavior except I specify older timestamp
Is that possible ?
My current workaround :
diary.txt
directly in an editorBut this kinda defeats the purpose of using jrnl
altogether.
Ah, I think I see what you're saying.
So, adding new entries in an editor works the same way as adding entries via the command line (only without your shell getting in the way). So, on new entries, jrnl
looks for a timestamp as the very first part of the entry for a timestamp.
How this would work in your example is this:
jrnl diary
That's it! jrnl
will look for a timestamp as the first part of your entry the same way it does on the command line. There are some examples in the documentation, but the gist of it is that you if you add a timestamp on the first line followed by a colon (e.g. yesterday: rest of first line
), jrnl
will find it and use that (if it doesn't find one, then it defaults to now
, which is the behavior you are describing in your comment).
To clarify, this is what if would look like after editing your entry:
timestamp goes here: Template Title
Some text here or anything else in your template.
So, the timestamp should be the very first thing in your entry.
@wren The documentation always refers to the timestamp only when the entry is entered on the command line.
It did not occur to me that in editor, I can use timestamp on the first line (I understand that the first line is title. But I never used timestamp: title
format. Just title
My workaround was similar but when I manually edit diary.txt
- I use to copy the timestamp from previous entry and make changes (So that timestamp format is not broken)
Using timestamp format like yesterday at 10pm
in an editor is going to make my life easier.
@mandarvaze You're absolutely right.
To resolve this ticket, we'll need to update the docs to clarify how new entries in an editor are or aren't different from cli entries.
Thank you for pointing this out!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Bug Report
Environment
Jrnl
--diagnostic
output:Install method:
brew install jrnl
Current Behavior
I have multiple journals configured, like
work
anddiary
.I've defined a template in my
~/.config/jrnl/jrnl.yaml
fordiary
work
does not use template.Whenever I create an entry like
jrnl diary
the template is copied just fine, as expected. But when I create a backdated entry likejrnl diary yesterday at 10pm: backdated entry here
the entry starts out blank i.e. without the contents of the template.Expected Behavior
Template should be used for normal entry as well as for backdated entry.
Repro Steps
Other Information
None.