Constant tpnote_lib::config::TMPL_ANNOTATE_FILE_CONTENT
source · pub const TMPL_ANNOTATE_FILE_CONTENT: &str = "\
{%- set body_text = stdin ~ clipboard -%}
{%- if body_text != '' -%}
{%- set lang_test_text = body_text | cut -%}
{%- else -%}
{%- set lang_test_text = path | file_stem -%}
{%- endif -%}
---
title: {{ path | trim_file_sort_tag | json_encode }}
{% if body_text | link_text !='' and
body_text | heading == body_text -%}
subtitle: {{ 'URL' | json_encode -}}
{%- else -%}
subtitle: {{ 'Note' | json_encode -}}
{%- endif %}
author: {{ username | capitalize | json_encode }}
date: {{ now() | date(format='%Y-%m-%d') | json_encode }}
lang: {{ lang_test_text | get_lang | map_lang(default=lang) | json_encode }}
---
[{{ path | file_name }}](<{{ path | file_name }}>)
{% if body_text != '' -%}
{%- if body_text != body_text | heading %}
---
{% endif %}
{{ body_text }}
{% endif %}
";Expand description
Default template used when the command line <path> parameter points to an
existing - to be annotated - non-.md-file. {{ path}} points to that
file, {{ dir_path }} to the directory where it is located.