Constant tpnote_lib::config::TMPL_FROM_CLIPBOARD_YAML_CONTENT
source · pub const TMPL_FROM_CLIPBOARD_YAML_CONTENT: &str = "\
---
title: {{ fm_title | default(value = path|trim_file_sort_tag) | cut | json_encode }}
subtitle: {{ fm_subtitle | default(value = 'Note') | cut | json_encode }}
author: {{ fm_author | default(value=username | capitalize) | json_encode }}
date: {{ fm_date | default(value = now()|date(format='%Y-%m-%d')) | json_encode }}
{% for k, v in fm_all|\
remove(var='fm_title')|\
remove(var='fm_subtitle')|\
remove(var='fm_author')|\
remove(var='fm_date')|\
remove(var='fm_lang')\
%}{{ k }}:\t\t{{ v | json_encode }}
{% endfor -%}
lang: {{ fm_lang | default(value = fm_title| \
default(value=stdin~clipboard|heading)| \
get_lang | map_lang(default=lang) ) | json_encode }}
---
{{ stdin ~ clipboard }}
";Expand description
Default template used, when the clipboard or the input stream stdin
contains a string and one the of these strings contains a valid YAML front
matter section. The clipboards body is in {{ clipboard }}, the header
is in {{ clipboard_header }}. The stdin’s body is in {{ stdin }},
the header is in {{ stdin_header }}. First all variables defined in the
clipboard’s front matter are registered, the ones defined in the input
stream stdin. The latter can overwrite the former. One of the front
matters must define the title variable, which is then available in this
template as {{ fm_title }}.
When placed in YAML front matter, the filter | json_encode must be
appended to each variable.