I'm sure I can figure this out, but if someone can...
# questions
k
I'm sure I can figure this out, but if someone can point me in the right direction that would help greatly. So, Ctrl+Shift+i opens a daily journal for the day. How would I go about creating a monthly journal for the month, and assign a shortcut to it? I would like a monthly journal because it is easier to look at my journal notes in one page per month since I may not journal everyday and don't have much to journal everyday, for work at least.
Now I'm not so sure I can figure this out ¯\_(ツ)_/¯ I think a shortcut pointing to the month section of the daily journal would suffice, and keep things simple. So, for e.g., Ctrl+Shift+O would take me to 'daily.journal.2022.04.md' instead of 'daily.journal.2022.04.07.md' as with Ctrl+Shift+i
h
You could create a note trait for monthly journal and use
Create Note With Custom Trait
to create a monthly journal.
quickstart for custom note traits: https://wiki.dendron.so/notes/EQoaBI8A0ZcswKQC3UMpO/
Here's a quick note trait I wrote. You can run
Dendron: Register Note Trait
and paste this into the file. I called the custom trait
monthly-journal
.
Copy code
js
/**
 * Note: you must reload your window after each file change for it to take into
 * effect. We are working to improve this behavior.
 */
module.exports = {
  /**
   * Specify behavior to modify the name of the note. If
   * promptUserForModification is true, the modified name will appear in a
   * lookup control to allow the user to further edit the note name before
   * confirming.
   */
  OnWillCreate: {
    setNameModifier(props) {
      const curDate = new Date();
      const year = curDate.getFullYear();
      const month = String(curDate.getMonth() + 1).padStart(2, "0");

      return {
        name: ["daily", "journal", year, month].join('.'),
        promptUserForModification: true
      };
    }
  },
  /**
   * Specify behavior for altering the title of the note when it is created.
   */
  OnCreate: {
    setTitle(props) {
      const curDate = new Date();
      const month = curDate.toLocaleString('default', { month: 'long' });
      return month;
    }
  }
}
Unfortunately VScode shortcuts can't resolve dynamic variables. So just passing something like $CURRENT_MONTH to a keybinding in
keybindings.json
doesn't work in VSCode.
k
That worked very well! I went ahead and created a shortcut for 'Dendron: Create Note with Custom Traits'. Thank you!!
2 Views