Journal and integrations
I’ve made some changes to Journal (I didn’t mess with the data format this time) that add some functionality and will maybe help with integrating with some apps like Obisidian.
First, you can now define a date
type. Date entries will be parsed from natural language into date objects, so on the command line you can enter something like “yesterday 5pm” or “july 20 12pm” and get a proper date object added to your JSON and Markdown entries. Great for things like logging book review dates, workout days, etc.
You can also now define a dictionary
type for a question, which along with a key
definition creates a nested data set with any dot notation keys that match. So you can define the following:
mood:
sections:
- title: "Status"
key: status
questions:
- key: health
type: dictionary
- key: health.rating
type: numeric
prompt: Health Rating
min: 1
max: 10
- key: health.notes
type: multiline
prompt: Health Notes
The data that gets output will include this format in the JSON:
{
"mood": {
"status": {
"health": {
"rating": 5,
"notes": "Just some notes on my health"
}
}
}
}
This allows for more control over the structured data. It won’t be a big deal for most people as answers were already nested within section keys and could be grouped using dot syntax, this just allows the structure to go one level deeper which may help with building analytics tools.
The big change that will allow more integrations with apps like Obsidian is that all numeric and date answers are now included as YAML front matter in any individual Markdown files created. This will allow integration with existing tools like Obsidian Dataview, which allows you to create data views based on YAML data in your Obsidian notes. By pointing Journal to your Vault folder, you can have journal entries added to your vault and queryable with Dataview. I haven’t tested this, I just noted that it should be possible with the addition of the YAML data. For the time being I’m not including any string responses in the YAML, as that seems redundant since they’re also included in the body text and available to search.
This update won’t affect data saved to single Markdown files or added to Day One. If you have any ideas about how this could be made more useful, please let me know! Either via the Discussions or by contacting me directly.
Version 1.0.19 is out now, just install or upgrade with gem install journal-cli
. See the project page for more details.