quartz-research-note/content/templates/zotero_template.md

3.0 KiB

cssclass: research-note type: "{{itemType}}"{% for type, creators in creators | groupby("creatorType") -%}{% if loop.first %} {% endif %}{{type | replace("interviewee", "author") | replace("director", "author") | replace("presenter", "author") | replace("podcaster", "author") | replace("programmer", "author") | replace("cartographer", "author") | replace("inventor", "author") | replace("sponsor", "author") | replace("performer", "author") | replace("artist", "author")}}: "{%- for creator in creators -%}{%- if creator.name %}{{creator.name}}{%- else %}{{creator.lastName}}, {{creator.firstName}}{%- endif %}{% if not loop.last %}; {% endif %}{% endfor %}"{% if not loop.last %} {% endif %}{%- endfor %}{% if title %} title: "{{title}}"{% endif %}{% if publicationTitle %} publication: "{{publicationTitle}}"{% endif %}{% if date %} date: {{date | format("YYYY-MM-DD")}}{% endif %}{% if archive %} archive: "{{archive}}"{% endif %}{% if archiveLocation %} archive-location: "{{archiveLocation}}"{% endif %} citekey: {{citekey}} tags: - research - paper

{{bibliography}} online local {%- for attachment in attachments | filterby("path", "endswith", ".pdf") %} [pdf](file://{{attachment.path | replace(" ", "%20")}}) {% if loop.last %} {% endif %}{%- endfor %}

{% if tags.length > 0 -%}{% for t in tags -%}#{% if t.tag == "secondary" %}source/secondary{% if not loop.last %}{% endif %}{% elif t.tag == "primary" %}source/primary{% if not loop.last %}{% endif %}{% elif "-project" in t.tag %}project/{{t.tag | lower | replace(" ", "-") | replace("-project", "")}}{% else %}subject/{{t.tag | lower | replace(" ", "-")}}{% endif %}{% if not loop.last %} {% endif %}{%- endfor %}{%- endif %}

Index

start-date:: {% if date %}{{date | format("YYYY-MM-DD")}}{% endif %} end-date:: page-no:: {% for annotation in annotations %}{% if loop.first %}{{annotation.pageLabel}}{% endif %}{% endfor %}

Connections

comment::

Note

{% macro calloutHeader(color) -%} {%- if color == "#ff6666" -%} Important {%- endif -%} {%- if color == "#5fb236" -%} Reference {%- endif -%} {%- if color == "#2ea8e5" -%} Undefined - Blue {%- endif -%} {%- if color == "#a28ae5" -%} Undefined - Purple {%- endif -%} {%- endmacro -%}

{% persist "annotations" %} {% set annotations = annotations | filterby("date", "dateafter", lastImportDate) -%} {% if annotations.length > 0 %}

Imported on {{importDate | format("YYYY-MM-DD h:mm a")}}

{%- for annotation in annotations %} {% if annotation.color !== "#ffd400" %}

[!quote{% if annotation.color %}|{{annotation.color}}{% endif %}] {{calloutHeader(annotation.color)}} {%- endif -%}{% if annotation.imageRelativePath %} !{{annotation.imageRelativePath}} {% endif %}{% if annotation.annotatedText %} {{annotation.annotatedText}} (p. {{annotation.pageLabel}}){%- endif %}{%- if annotation.comment%} %%{{annotation.comment}}%%{%- endif %}{%- endfor %}{% endif %} {% endpersist %}