You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TEMPLATE renderer currently requires the full template to be written inline in every code block. Users who have multiple queries with similar table layouts (e.g. task lists with external/internal links, status columns) must duplicate the entire template in each block. This leads to:
Significant boilerplate in notes with multiple queries
Difficult maintenance when the template design changes (must update every copy)
No way to share templates across notes
Proposed Solution
Allow the TEMPLATE renderer to resolve {% include %} and {% from ... import %} directives against .njk files stored in the Obsidian vault.
Usage examples
Include a full template:
```sqlsealTEMPLATE{% include "_templates/task-table.njk" %}SELECT task_id, title, state FROM files WHERE ...```
Import macros for composable templates:
```sqlsealTEMPLATE{% from "_templates/macros.njk" import extLink, intLink %}<table>{% for row in data %}<tr> <td>{{ extLink(row.url, row.id) }}</td> <td>{{ intLink(row.title) }}</td></tr>{% endfor %}</table>SELECT ... FROM files WHERE ...```
Implementation
This feature is implemented across two stacked PRs:
Problem
The TEMPLATE renderer currently requires the full template to be written inline in every code block. Users who have multiple queries with similar table layouts (e.g. task lists with external/internal links, status columns) must duplicate the entire template in each block. This leads to:
Proposed Solution
Allow the TEMPLATE renderer to resolve
{% include %}and{% from ... import %}directives against.njkfiles stored in the Obsidian vault.Usage examples
Include a full template:
Import macros for composable templates:
Implementation
This feature is implemented across two stacked PRs:
.njkvault files