Template sets

This commit is contained in:
Zef Hemel
2023-11-15 14:56:34 +01:00
parent b26b7f4f0a
commit 663a15fe33
14 changed files with 121 additions and 16 deletions
+12
View File
@@ -0,0 +1,12 @@
---
tags: template
description: |
Renders its object value in a `key: value` format
usage: |
Can be used by passing in a YAML object in a template via `value` or in a `render` clause of a query
---
{{#each .}}
{{@key}}: {{.}}
{{/each}}
---
+4
View File
@@ -0,0 +1,4 @@
* [[{{ref}}|{{ref}}]] {{description}}
{{#if usage}}
* **Usage:** {{usage}}
{{/if}}
@@ -0,0 +1,9 @@
---
tags: template
description: Lists all pages with ".conflicted" in the name, created as a result of a synchronization conflict.
---
### Conflicting pages
```query
page where name =~ /\.conflicted/ render [[template/pages/page]]
```
+6
View File
@@ -0,0 +1,6 @@
---
tags: template
description: A page reference link as a list item
---
* [[{{name}}]]
+1 -1
View File
@@ -1,4 +1,4 @@
#template
```query
task where tags = "{{.}}" and done = false render [[template/task]]
task where tags = "{{.}}" and done = false render [[template/tasks/task]]
```
+10
View File
@@ -0,0 +1,10 @@
---
tags: template
description: |
Shows all tasks that reference (tag) the current page. For instance a task that references `[[John]]` in its name, would appear on the `John` page if it would use this [[sets/tasks/incoming]] template.
order: 2
---
```query
task where name =~ /\[\[{{escapeRegexp @page.name}}\]\]/ where done = false render [[template/tasks/task]]
```
+10
View File
@@ -0,0 +1,10 @@
---
tags: template
description: Queries all tasks tagged with a specific tag.
usage: Pass in the tag to filter on as the `value` of this template
order: 2
---
```query
task where tags = "{{.}}" and done = false render [[template/tasks/task]]
```
+7
View File
@@ -0,0 +1,7 @@
---
tags: template
description: generic task template that supports updating the status back in the origin page
order: 1
---
* [{{state}}] [[{{ref}}]] {{name}}