Yetenol / Obsidian-CLI

4 stars 0 forks source link

Update all dataview queries created from templates to most recent version of their template #10

Open Yetenol opened 11 months ago

Yetenol commented 11 months ago

Dataview queries created from a template reference their template at the end of the query:

FLATTEN "This is a Map of Extensions"

You can find all occurrences of queries created from a specific template as follows using regular expressions:

`{3}dataview(\n[^`\n]*)*?
FLATTEN "This is a Map of Extensions"
`{3}

The corresponding templates are located in templates.

Using an external application like VS Code to do the find and replace corrupts the index of the Digital Garden plugin and thus break the frontmatter parsing and therefore the url, links and notes of many published notes.

To avoid this, use the advanced-uri plugins and its regexreplace features. This way a replaces are done within Obsidian and should break the Digital Garden plugin.

Yetenol commented 11 months ago

Probably a good idea to replace FLATTEN "This is a Map of Extensions" with something more meaningful as

FLATTEN "This query uses the template Map of Extensions"
Yetenol commented 11 months ago

Add command to Obsidian to apply the currently open template note across the vault using advanced-uri regexreplace