Skip to content
TOC

Template Variable

If you have already learned Template Syntax, then you can use the following variables at your leisure.

TIP

Metadata addon could import data from Zotero. You can use the data in template. Not yet officially released, you can test it from Github.

Variables

MindMap Cards

Variables Name
TypeDescription
idStringNote ID
url.pureStringNote URL
url.mdStringNote URL,add []()
url.htmlStringNote URL,add <a>
page.startStringStart page of notes in the document
page.endStringEnd page of notes in the document
page.real.startStringMetadata Required Calculate the start page number after the offset.
page.real.endStringMetadata Required Calculate the end page number after the offset.
time.creatStringNote created time
time.modifyStringNote Modified Time
time.nowStringNow
allTextPic.textStringAll text in the card, including the text in the Markdown addon.
allTextPic.ocrStringAll text in the card, picture excerpts will be automatically OCR, excluding picture comments.
allTextPic.mdStringAll text and images in the card. Images are encoded in base64 and add ![]()
allTextPic.htmlStringAll text and images in the card. Images are encoded in base64 and add <img src>
tagsString ArrayAll tags, no #
titlesString ArrayAll titles
excerpts.textString ArrayAll text excerpt
excerpts.ocrString ArrayAll excerpts. Image excerpts are OCR'd as text
excerpts.htmlString ArrayAll excerpts. Image excerpts are OCR'd as text, and add <img>
excerpts.mdString ArrayAll excerpts. Image excerpts are OCR'd as text, and add ![]()
comments.textString ArrayAll text comments. Includes text from Markdown addon
comments.htmlString ArrayAll comments. Images are encoded in base64 and add <img>
comments.mdString ArrayAll comments. Images are encoded in base64 and add ![]()

Document

The document to which the current card belongs

Variables Name
TypeDescription
doc.titleStringDocument title
doc.md5StringDocument md5
doc.pathStringDocument path
doc.url.pureStringOnly in Notebook Document URL, which jumps indirectly through the link of the last note in the document in the notebook.
doc.url.mdStringOnly in Notebook Document URL, add []()
doc.url.htmlStringOnly in Notebook Document URL, add <a>
doc.referenceStringMetadata Required Reference or Citation
doc.citeKeyStringMetadata Required Citation key
doc.pageOffsetStringMetadata Required Page offset
doc.metadataObjectMetadata Required All metadata imported from Zotero

Notebook

The notebook to which the current card belongs

Variables Name
TypeDescription
notebook.titleStringNotebook title
notebook.idStringNotebook ID
notebook.url.pureStringNotebook URL
notebook.url.mdStringNotebook URL, add []()
notebook.url.htmlStringNotebook URL, add <a>

Parent Card / Children Card

You can actually get all the above information about the current card's parent and child cards as well.

Variables NameTypeDescription
parentObjectparent.titles is the parent's titles
childrenObject Arraychildren.0.titles is the first child's titles

Functions

Function Name
Description
nohlRemove **, it's highlight symbol
blodModify **highlight** to <b>highlight</b>
clozeModify **highlight** to {{c1::highlight}}
clozeSyncModify **highlight** to {{c1::highlight}}, synchronous show answers
upperCapital letters
lowerLower case
joinMerge an array of strings into a new string using the specified prefix and suffix

The join function is a little more complicated, like {{#join}} %["1"]. {{titles}}\n {{/join}}. We know that titles is an array of strings, suppose its values are ["a" , "b", "c"]. With this function, it will become

1. a
2. b
3. c
1. a
2. b
3. c

%["1"] is a magic variable that can be automatically numbered, see syntax for details.

TIP

The last element will not be suffixed

The join function allows us to add a before-and-after modifier to each string in the array, eventually merging them into a single string.

Released under the MIT License.