Skip to content

Commit

Permalink
Add docs on template includes
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmeyers committed Apr 23, 2022
1 parent 6199f91 commit 692355d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
22 changes: 19 additions & 3 deletions docs/Templating.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ And a basic annotation template:

Please see the [Nunjucks docs](https://mozilla.github.io/nunjucks/templating.html#variables) for more detail on templating.

## Where do I store my templates?

Templates can reside anywhere in your Obsidian vault. The path to the template is supplied in the import settings.

![](Screen%20Shot%202022-04-23%20at%2010.54.56%20AM.png)


## How do I format lists of data?

In the data explorer, you'll notice that annotations, tags, creators, and other values look something like:
Expand Down Expand Up @@ -139,12 +146,21 @@ You can also use this to import only the annotations that were added since the l

This would then allow you to add block IDs to annotations, edit annotations or annotation comments, and add additional notes to annotations.

## How do I include content from other markdown files

## Where do I store my templates?
Templates can be split into multiple files if that makes organization easier for you. You can include those files in your main template using obsidian links:

Templates can reside anywhere in your Obsidian vault. The path to the template is supplied in the import settings.
```markdown
{% include "[[link to markdown file]]" %}
```

![](Screen%20Shot%202022-04-23%20at%2010.54.56%20AM.png)
**Note:** if you want to include other markdown files in a `for` loop, you need to use `asyncEach` instead of `for`:

```
{% asyncEach a in annotations %}
{% include "[[annotation template]]" %}
{% endeach %}
```

## What custom nunjucks filters are available?

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-zotero-desktop-connector",
"name": "Zotero Desktop Connector",
"version": "2.0.0",
"version": "2.0.1",
"minAppVersion": "0.12.0",
"description": "Insert citations, bibliographies, and notes directly from Zotero desktop.",
"author": "mgmeyers",
Expand Down
2 changes: 1 addition & 1 deletion src/DataExplorerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function TemplatePreview({

setTemplate(output ? output : null);
} catch (e) {
setTemplateError(e);
setTemplateError(e.message);
}
};

Expand Down

0 comments on commit 692355d

Please sign in to comment.