Prompt file imported from Ebonsignori/obsidian-auto-journal (
.github/prompts/default.prompt.md). Fill in{{title}},{{date}},{{time}}before use. Copyright stays with the author.
This project is an Obsidian plugin that runs on the Obsidian Application.
It is written in TypeScript and uses the Obsidian API.
The reference for the Obsidian API can be found in the reference directory of this repository.
The most useful references will be the TypeScript API in the reference directory.
Projet overview
The core Daily notes plugin for Obsidian doesn't backfill notes for the days when Obsidian wasn't opened. This plugin does.
It uses an opinionated folder structure that isn't configurable:
- Daily Notes:
ROOT / YEAR / MONTH / DAY - - Monthly Notes:
ROOT / YEAR / {custom-name} / MONTH -
You can customize the date format of YEAR, MONTH, DAY, or set/remove the ROOT, but this plugin depends on organizing the filesystem by YEAR/MONTH/DAY.
The base of the filename in each folder should not be changed, e.g. DAY - for Daily Notes or MONTH - for Monthly Notes.
For instance, by default Daily Notes will be created like so,
Journal/2023/August/11 -
You can add whatever you'd like after the title,
Journal/2023/August/11 - Work, Dog Park, Climb with Friends & Grab Dinner
But make sure not to change the day part of the title, 11 -
Backfilling
When enabled, backfilling will create notes for previous days of the month/year when you didn't open the plugin.
For Daily Notes:
For yearbackfill will create a folder for each month before today and a note with the day prefix, e.g.11 -for each day of the month before todayFor monthbackfill will create a note with the day prefix, e.g.11 -for each day of the month before today
For Monthly Notes:
For yearbackfill will a note each month before today month prefix, e.g.January -for each month of the year before this month
Templating
You can include a configurable token (default {{auto-journal-date}}) in a template to be replaced by the date that the file would have been created in a backfill rather than the date it was actually created on.
By default, all variables from the core Templates plugin are supported using the settings from the core Templates plugin for date formatting e.g. {{title}}, {{date}}, {{time}}
However, {{date}} and {{time}} will use the day that you opened Obsidian and Auto Journal ran to create note files on, rather than the date that a backfilled note would have if it was created on the date the note represents.
Commands
Opening:
- Today's daily/monthly note
- The next/previous from today (if running a command from a non-note file)
- The next/previous from the current note (if running a command from a note file)
can be done via the command prompt with the following Auto Journal: commands:
Open today's daily noteOpen next daily noteOpen previous daily noteOpen today's monthly noteOpen next monthly noteOpen previous monthly note
You can assign hotkeys to any of these commands in the native Obsidian Settings -> Hotkeys tab.
Navigation buttons
You can add buttons to navigate to the next, previous or today's daily/monthly note via an auto-journal-navigation code block.
Inside the codeblock include the type of the button followed by a colon (:) and the button text you want it to display, like today-daily: Today's note.
For previous and next buttons in your daily notes, you could add the following code block:
```auto-journal-navigation
previous-daily: Previous Note
next-daily: Next note
```
and they'd look something like this,
The following button types are supported:
today-dailyprevious-dailynext-dailytoday-monthlyprevious-monthlynext-monthly
You can add CSS to the following classes to change the styling and/or positions of the buttons,
auto-journal-navigation-containerfor the containing<div>auto-journal-navigation-buttonfor all the<button>sauto-journal-dailyfor all thedailytype buttonsauto-journal-monthlyfor all themonthlytype buttonsauto-journal-todayfor all thetodaytype buttonsauto-journal-nextfor all thenexttype buttonsauto-journal-previousfor all theprevioustype buttons
Or you can adjust the CSS of a specific button using the button's id which is the same as its type. For instance a next-daily button has the id that can be accessed in CSS via #next-daily