How do you migrate or upgrade templates for your common notes? #1606
Replies: 1 comment
-
|
Hey there, I'm also sniffing around the same problem. I've written a python script that externally updates all my notes with the latest template version, but the issue I've discovered is that parts of the template that contain Javascript (I have a dynamic link to a fastmail IMAP label based on the note name for example) won't apply without manually running "Template: Replace templates in current file". So it's a teeny bit messy. I agree that some sort of functionality to manage updating templates would be a great addition to the plugin, although I'm at the limits of my skillset at this point so will have to hope some smarter folk take a swing at it! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Templates evolve over time. I heavily use templates to define structures and metadata on specific "note types" such as meetings, thoughts, etc.
Please find below an example of a template I use for a paper (staring point was a kit of bryan jenkins) . I often find out new stuff (like getting more familiar with the dataview plugin) and update my templates accordingly. In the paper case, I for example created an export macro from my citavi notes to my paper notes and wanted additional fields to be added automatically.
I'm wondering if someone of you has stumbled across the same issues like my common use cases:
In the example below, I switched a datatype and increased the version. Today I realized that I was pretty stupid as I also didn't add a property
template-nameor directly atemplate-scheme. This, and additional properties are not handled by command "Templater: Replace templates in the active file". I then migrate manually for the needed files only as follows:I recently introduced myself to database migrations with liquibase. It allows to define a changelog with some kind of changesets to apply specific changes for a version. This would be great, even if I would need to define each migration in e.g. a python script doing the manipulations (e.g. in steps like 1) apply to notes with criteria, 2) apply these changes to metadata, structure, etc.
Similar issues
I found similar issues. E.g. this reddit thread described a similar issue with bulk editing metadata, that may be solved with the obisidian-metadata. I'll give it a try for metadata migrations.
As I sparesely find well-working solutions and a user in this reddit thread said it would be a great feature, I wonder if someone started working on these kind of topics more automatically. Maybe I'm also just abusing templates or am unaware of tooling. Maybe there are some great samples for Markdown migrations.
Example Template: Paper
template-version: "5"
tags:
publish: true
aliases:
type:
status: open
created: <%tp.date.now()%>
updated: <%tp.date.now()%>
Author:
DOI:
author-keywords:
publisher:
journal:
conference:
publish-date:
reviewed-on-date: <%tp.date.now()%>
Title: <%tp.file.title%>
Citation
Hypothesis / Research Questions:
Methodology:
Definitions
Result(s):
Summary of key points:
Notes
Context:
How this article relates to other work in the field; how it ties in with key issues and findings by others, including yourself
Significance:
to the field; in relation to your own work
Important Figures and/or Tables:
brief description; page number
Other Comments:
Cited References
to follow up on (cite those obviously related to your topic AND any papers frequently cited by others because those works may well prove to be essential as you develop your own work
Beta Was this translation helpful? Give feedback.
All reactions