scheme_sync_default = "default"
[base_scheme]
name = "base_scheme"
[base_scheme.filename]
sort_tag.extra_chars = ".-_="
sort_tag.separator = "-"
sort_tag.extra_separator = "'"
sort_tag.letters_in_succession_max = 2
sort_tag.sequential.digits_in_succession_max = 3
copy_counter.extra_separator = "-"
copy_counter.opening_brackets = "("
copy_counter.closing_brackets = ")"
extension_default = "md"
extensions = [
["txt", "ToMarkdown", "Markdown"],
["md", "ToMarkdown", "Markdown"],
["rst", "Disabled", "ReStructuredText"],
["htmlnote", "PassThrough", "Html"],
["txtnote", "Disabled", "PlainText"],
["adoc", "Disabled", "PlainText"],
["text", "ToMarkdown", "Markdown"],
["markdn", "ToMarkdown", "Markdown"],
["markdown", "ToMarkdown", "Markdown"],
["mdown", "ToMarkdown", "Markdown"],
["mdtext", "ToMarkdown", "Markdown"],
["mdtxt", "ToMarkdown", "Markdown"],
["mdwn", "ToMarkdown", "Markdown"],
["mkd", "ToMarkdown", "Markdown"],
["rest", "Disabled", "ReStructuredText"],
["asciidoc", "Disabled", "PlainText"],
["mediawiki", "Disabled", "RendererDisabled"],
["mw", "Disabled", "RendererDisabled"],
["t2t", "Disabled", "RendererDisabled"],
]
[base_scheme.tmpl]
fm_var.localization = [
["fm_title", "title"],
["fm_subtitle", "subtitle"],
["fm_author", "author"],
["fm_date", "date"],
["fm_lang", "lang"],
["fm_languages", "languages"],
["fm_sort_tag", "sort_tag"],
["fm_file_ext", "file_ext"],
["fm_no_filename_sync", "no_filename_sync"],
["fm_filename_sync", "filename_sync"],
["fm_scheme", "scheme"],
]
fm_var.assertions = [
["fm_title", ["IsDefined", "IsString", "IsNotEmptyString", "IsNotCompound"]],
["fm_subtitle", ["IsString", "IsNotCompound"]],
["fm_author", ["IsString"]],
["fm_lang", ["IsString", "IsNotCompound"]],
["fm_languages", ["IsString"]],
["fm_sort_tag", ["IsNotCompound", "IsValidSortTag"]],
["fm_file_ext", ["IsString", "IsNotCompound", "IsTpnoteExtension"]],
["fm_no_filename_sync", ["IsBool", "IsNotCompound"]],
["fm_filename_sync", ["IsBool", "IsNotCompound"]],
["fm_scheme", ["IsString", "IsConfiguredScheme"]],
]
filter.get_lang.mode = "Multilingual"
filter.get_lang.language_candidates = []
filter.get_lang.relative_distance_min = 0.3
filter.get_lang.consecutive_words_min = 7
filter.get_lang.words_total_percentage_min = 10
filter.map_lang = [
[ "de", "de-DE", ],
[ "et", "et-ET", ],
]
filter.to_yaml_tab = 14
from_dir_content = """
{%- set stdin = stdin.body |default(value = '') -%}
{%- set html_clipboard = html_clipboard.body |default(value = '') -%}
{%- set txt_clipboard = txt_clipboard.body |default(value = '') -%}
{%- set title_text = fm.fm_title | default(value = '')
| replace_empty(with = stdin | html_heading )
| replace_empty(with = stdin | link_text_picky )
| replace_empty(with = stdin | link_text )
| replace_empty(with = stdin | heading )
| replace_empty(with = html_clipboard | html_heading )
| replace_empty(with = html_clipboard | link_text_picky )
| replace_empty(with = txt_clipboard | link_text_picky )
| replace_empty(with = html_clipboard | link_text )
| replace_empty(with = txt_clipboard | link_text )
| replace_empty(with = txt_clipboard | heading )
| replace_empty(with = path | trim_file_sort_tag )
| trim -%}
{%- set stdin = stdin
| html_to_markup(extension=extension_default, default=stdin)
| append(newline=true) -%}
{%- set clipboard = html_clipboard
| html_to_markup(extension=extension_default, default=txt_clipboard) -%}
{%- set input = stdin ~ clipboard | trim -%}
{%- set languages = fm.fm_languages
| default(value = [force_lang])
| replace_empty(with = input | replace_empty(with = path | trim_file_sort_tag )
| get_lang | map_lang(default=lang) ) -%}
{%- set lang = fm.fm_lang | default(value = languages | first ) -%}
---
{{ title_text | trunc | to_yaml(key='fm_title') }}
{{ fm.fm_subtitle | default(value = 'Note') | trunc | to_yaml(key='fm_subtitle') }}
{{ fm.fm_author | default(value=username | capitalize) | to_yaml(key='fm_author') }}
{{ fm.fm_date | default(value = now()|date(format='%Y-%m-%d')) | to_yaml(key='fm_date') }}
{{ lang | to_yaml(key='fm_lang') }}
{% if languages | length > 1 -%}
{{ languages | to_yaml(key='fm_languages') | append(newline=true) }}
{%- endif -%}
{#- We deliberately ignore `fm.fm_scheme` from clipboards -#}
{% if scheme_sync_default != current_scheme -%}
{{ current_scheme | to_yaml(key='fm_scheme') | append(newline=true) }}
{%- endif -%}
{% if fm.fm_sort_tag -%}
{{ fm.fm_sort_tag | to_yaml(key='fm_sort_tag') | append(newline=true) }}
{%- endif -%}
{%- if fm -%}
{{- fm
| remove(key='fm_title')
| remove(key='fm_subtitle')
| remove(key='fm_author')
| remove(key='fm_date')
| remove(key='fm_lang')
| remove(key='fm_languages')
| remove(key='fm_scheme')
| remove(key='fm_sort_tag')
| to_yaml
| prepend(newline=true)
| append(newline=true) -}}
{%- endif -%}
---
{{ input | append(newline=true) }}
"""
from_dir_filename = """
{%- if fm.fm_sort_tag -%}
{%- set tag = fm.fm_sort_tag | as_str -%}
{%- else -%}
{%- set tag = dir_path | find_last_created_file
| incr_sort_tag(default=now() | date(format='%Y%m%d')) -%}
{%- endif -%}
{{ fm.fm_title | sanit | prepend(with_sort_tag=tag) }}\
{{ fm.fm_subtitle | sanit | prepend(with='--') }}\
{{ fm.fm_file_ext | default(value = extension_default ) | prepend(with='.') }}"""
from_text_file_content = """
{%- set languages = [force_lang]
| replace_empty(with = doc.body | get_lang | map_lang(default=lang)) -%}
{%- set lang = languages | first -%}
---
{{ path | file_stem | split(pat='--') | first | trunc | to_yaml(key='fm_title') }}
{{ path | file_stem | split(pat='--') | nth(n=1) | trunc
| to_yaml(key='fm_subtitle') }}
{{ username | capitalize | to_yaml(key='fm_author') }}
{{ doc_file_date | default(value=now()) | date(format='%Y-%m-%d') | to_yaml(key='fm_date') }}
{{ lang | to_yaml(key='fm_lang') }}
{% if languages | length > 1 -%}
{{ languages | to_yaml(key='fm_languages') | append(newline=true) }}
{%- endif -%}
# {{ path | file_name | to_yaml(key='fm_orig_name', tab=12) }}
{% if scheme_sync_default != current_scheme -%}
{{ current_scheme | to_yaml(key='fm_scheme') | append(newline=true) }}
{%- endif -%}
---
{{ doc.body }}
"""
from_text_file_filename = """
{%- if path | file_sort_tag != '' -%}
{%- set tag = path | file_sort_tag -%}
{%- else -%}
{%- set tag = doc_file_date | default(value=now()) | date(format='%Y%m%d') -%}
{%- endif -%}
{{ fm.fm_title | sanit | prepend(with_sort_tag=tag) }}\
{{ fm.fm_subtitle | default(value='') | sanit | prepend(with='--') }}\
{{ path | file_ext | prepend(with='.') }}"""
annotate_file_content = """
{%- set stdin = stdin.body |default(value = '') -%}
{%- set html_clipboard = html_clipboard.body |default(value = '') -%}
{%- set txt_clipboard = txt_clipboard.body |default(value = '') -%}
{%- set stdin = stdin | html_to_markup(extension=extension_default, default=stdin) | append(newline=true) -%}
{%- set clipboard = html_clipboard
| html_to_markup(extension=extension_default, default=txt_clipboard) -%}
{%- set input = stdin ~ clipboard | trim_end -%}
{%- set languages = [force_lang]
| replace_empty(with = input | replace_empty(with = path | file_stem) | get_lang | map_lang(default=lang)) -%}
{%- set lang = languages | first -%}
{%- set fname = path | file_name -%}
{%- if extension_default != 'rst' -%}
{%- set link = '[' ~ fname ~ '](<' ~ fname ~ '>)' -%}
{%- else -%}
{%- set link = '`<' ~ fname ~ '>`_' -%}
{%- endif -%}
---
{{ path | trim_file_sort_tag | to_yaml(key='fm_title') }}
{{ 'Note' | to_yaml(key='fm_subtitle') }}
{{ username | capitalize | to_yaml(key='fm_author') }}
{{ now() | date(format='%Y-%m-%d') | to_yaml(key='fm_date') }}
{{ lang | to_yaml(key='fm_lang') }}
{% if languages | length > 1 -%}
{{ languages | to_yaml(key='fm_languages') | append(newline=true) }}
{%- endif -%}
{% if scheme_sync_default != current_scheme -%}
{{ current_scheme | to_yaml(key='fm_scheme') | append(newline=true) }}
{%- endif -%}
---
{{ link }}
{{- input | prepend(with='\n____\n\n')}}
"""
annotate_file_filename = """
{%- set tag = path | file_sort_tag -%}
{{ fm.fm_title | sanit | prepend(with_sort_tag=tag) }}\
{{ fm.fm_subtitle | default(value='') | sanit | prepend(with='--') }}\
{{ extension_default | prepend(with='.') }}"""
sync_filename = """
{%- set tag = fm.fm_sort_tag | default(value = path | file_sort_tag) | as_str -%}
{{ fm.fm_title | default(value='No title') | sanit | prepend(with_sort_tag=tag) }}\
{{ fm.fm_subtitle | default(value='') | sanit | prepend(with='--') }}\
{{ fm.fm_file_ext | default(value = path | file_ext) | prepend(with='.') }}
"""
[[scheme]]
name = "default"
[[scheme]]
name = "zettel"
[scheme.filename]
sort_tag.separator = "--"
[scheme.tmpl]
from_dir_content = """
{%- set stdin = stdin.body |default(value = '') -%}
{%- set html_clipboard = html_clipboard.body |default(value = '') -%}
{%- set txt_clipboard = txt_clipboard.body |default(value = '') -%}
{%- set title_text = fm.fm_title | default(value = '')
| replace_empty(with = stdin | html_heading )
| replace_empty(with = stdin | link_text_picky )
| replace_empty(with = stdin | link_text )
| replace_empty(with = stdin | heading )
| replace_empty(with = html_clipboard | html_heading )
| replace_empty(with = html_clipboard | link_text_picky )
| replace_empty(with = txt_clipboard | link_text_picky )
| replace_empty(with = html_clipboard | link_text )
| replace_empty(with = txt_clipboard | link_text )
| replace_empty(with = txt_clipboard | heading )
| replace_empty(with = path | trim_file_sort_tag )
| trim -%}
{%- set stdin = stdin
| html_to_markup(extension=extension_default, default=stdin)
| append(newline=true) -%}
{%- set clipboard = html_clipboard
| html_to_markup(extension=extension_default, default=txt_clipboard) -%}
{%- set input = stdin ~ clipboard | trim -%}
{%- set languages = fm.fm_languages
| default(value = [force_lang])
| replace_empty(with = input
| replace_empty(with = path | trim_file_sort_tag )
| get_lang
| map_lang(default=lang) ) -%}
{%- set lang = fm.fm_lang | default(value=languages | first ) -%}
{%- if fm.fm_sort_tag -%}
{%- set tag = fm.fm_sort_tag -%}
{%- else -%}
{%- set tag_default = now() | date(format='%Y%m%d') -%}
{%- set tag = dir_path
| find_last_created_file
| incr_sort_tag(default=tag_default) -%}
{%- endif -%}
---
{{ title_text | trunc | to_yaml(key='fm_title') }}
{{ fm.fm_keywords | default(value = ['note']) | to_yaml(key='fm_keywords') }}
{{ fm.fm_author | default(value=username | capitalize) | to_yaml(key='fm_author') }}
{{ fm.fm_date | default(value = now()|date(format='%Y-%m-%d')) | to_yaml(key='fm_date') }}
{{ lang | to_yaml(key='fm_lang') }}
{% if languages | length > 1 -%}
{{ languages | to_yaml(key='fm_languages') | append(newline=true) }}
{%- endif -%}
{#- We deliberately ignore `fm.fm_scheme` from clipboards -#}
{{ 'zettel' | to_yaml(key='fm_scheme') }}
{{ tag | to_yaml(key='fm_sort_tag') }}
{% if fm -%}
{{- fm
| remove(key='fm_title')
| remove(key='fm_keywords')
| remove(key='fm_author')
| remove(key='fm_date')
| remove(key='fm_lang')
| remove(key='fm_languages')
| remove(key='fm_scheme')
| remove(key='fm_sort_tag')
| to_yaml
| prepend(newline=true)
| append(newline=true) -}}
{%- endif -%}
---
{{ input | append(newline=true) }}
"""
from_dir_filename = """
{%- set keywords = '' -%}
{%- for sub in fm.fm_keywords | default(value=[]) -%}
{%- set_global keywords = keywords~sub~'_' -%}
{%- endfor -%}
{%- if fm.fm_sort_tag -%}
{%- set tag = fm.fm_sort_tag | as_str -%}
{%- else -%}
{%- set tag_default = now() | date(format='%Y%m%d') -%}
{%- set tag = dir_path
| find_last_created_file
| incr_sort_tag(default=tag_default) -%}
{%- endif -%}
{{ fm.fm_title | sanit | prepend(with_sort_tag=tag) }}\
{{ keywords | default(value='') | sanit | prepend(with='__') }}\
{{ fm.fm_file_ext | default(value = extension_default ) | prepend(with='.') }}"""
from_text_file_content = """
{%- set file = path | file_name -%}
{%- if file is containing('==')-%}
{%- set file = file | split(pat='==') | nth(n=1) -%}
{%- endif -%}
{%- if path | file_sort_tag != '' -%}
{%- set tag = path | file_sort_tag -%}
{%- else -%}
{%- set tag = doc_file_date | default(value=now()) | date(format='%Y%m%d') -%}
{%- endif -%}
{%- set file = file | file_stem -%}
{%- set title = file | split(pat='__') | first -%}
{%- set keywords = file | split(pat='__') | nth(n=1) -%}
{%- set languages = [force_lang]
| replace_empty(with = doc.body | get_lang | map_lang(default=lang)) -%}
{%- set lang = languages | first -%}
---
{{ title | trunc | to_yaml(key='fm_title') }}
{{ keywords | split(pat='_') | to_yaml(key='fm_keywords') }}
{{ username | capitalize | to_yaml(key='fm_author') }}
{{ doc_file_date | default(value=now()) | date(format='%Y-%m-%d') | to_yaml(key='fm_date') }}
{{ lang | to_yaml(key='fm_lang') }}
{% if languages | length > 1 -%}
{{ languages | to_yaml(key='fm_languages') | append(newline=true) }}
{%- endif -%}
{{ 'zettel' | to_yaml(key='fm_scheme') }}
{{ tag | to_yaml(key='fm_sort_tag') }}
# {{ path | file_name | to_yaml(key='fm_orig_name', tab=12) }}
---
{{ doc.body }}
"""
from_text_file_filename = """
{%- if fm.fm_sort_tag -%}
{%- set tag = fm.fm_sort_tag -%}
{%- else -%}
{%- if path | file_sort_tag != '' -%}
{%- set tag = path | file_sort_tag -%}
{%- else -%}
{%- set tag = doc_file_date | default(value=now()) | date(format='%Y%m%d') -%}
{%- endif -%}
{%- endif -%}
{%- set keywords = '' -%}
{%- if fm.fm_keywords | as_str == fm.fm_keywords -%}
{%- set keywords = fm.fm_keywords -%}
{%- else -%}
{%- for sub in fm.fm_keywords | default(value=[]) -%}
{%- set_global keywords = keywords~sub~'_' -%}
{%- endfor -%}
{%- endif -%}
{{ fm.fm_title | sanit | prepend(with_sort_tag=tag) }}\
{{ keywords | sanit | prepend(with='__') }}\
{{ path | file_ext | prepend(with='.') }}"""
annotate_file_content = """
{%- set stdin = stdin.body |default(value = '') -%}
{%- set html_clipboard = html_clipboard.body |default(value = '') -%}
{%- set txt_clipboard = txt_clipboard.body |default(value = '') -%}
{%- set stdin = stdin
| html_to_markup(extension=extension_default, default=stdin)
| append(newline=true) -%}
{%- set clipboard = html_clipboard
| html_to_markup(extension=extension_default, default=txt_clipboard) -%}
{%- set input = stdin ~ clipboard | trim_end -%}
{%- set languages = [force_lang]
| replace_empty(with = input | replace_empty(with = path | file_stem) | get_lang | map_lang(default=lang)) -%}
{%- set lang = languages | first -%}
{%- set fname = path | file_name -%}
{%- if extension_default != 'rst' -%}
{%- set link = '[' ~ fname ~ '](<' ~ fname ~ '>)' -%}
{%- else -%}
{%- set link = '`<' ~ fname ~ '>`_' -%}
{%- endif -%}
---
{{ path | trim_file_sort_tag | to_yaml(key='fm_title') }}
{{ ['note'] | to_yaml(key='fm_keywords') }}
{{ username | capitalize | to_yaml(key='fm_author') }}
{{ now() | date(format='%Y-%m-%d') | to_yaml(key='fm_date') }}
{{ lang | to_yaml(key='fm_lang') }}
{% if languages | length > 1 -%}
{{ languages | to_yaml(key='fm_languages') | append(newline=true) }}
{%- endif -%}
{{ 'zettel' | to_yaml(key='fm_scheme') }}
{{ path | file_sort_tag | to_yaml(key='fm_sort_tag') }}
---
{{ link }}
{{- input | prepend(with='\n____\n\n')}}
"""
annotate_file_filename = """
{%- set keywords = '' -%}
{%- for sub in fm.fm_keywords | default(value=[]) -%}
{%- set_global keywords = keywords~sub~'_' -%}
{%- endfor -%}
{%- if fm.fm_sort_tag -%}
{%- set tag = fm.fm_sort_tag -%}
{%- else -%}
{%- set tag = path | file_sort_tag -%}
{%- endif -%}
{{ fm.fm_title | sanit | prepend(with_sort_tag=tag) }}\
{{ keywords | default(value='') | sanit | prepend(with='__') }}\
{{ extension_default | prepend(with='.') }}"""
sync_filename = """
{%- set keywords = '' -%}
{%- set fm_keywords = fm.fm_keywords | default(value='') -%}
{%- if fm_keywords | as_str == fm_keywords -%}
{%- set_global keywords = fm_keywords -%}
{%- else -%}
{%- for sub in fm.fm_keywords -%}
{%- set_global keywords = keywords~sub~'_' -%}
{%- endfor -%}
{%- endif -%}
{%- set tag = fm.fm_sort_tag | default(value = path | file_sort_tag) | as_str -%}
{{ fm.fm_title | default(value='No title') | sanit | prepend(with_sort_tag=tag) }}\
{{ keywords | sanit | prepend(with='__') }}\
{{ fm.fm_file_ext | default(value = path | file_ext) | prepend(with='.') }}"""
[tmpl_html]
viewer = '''
{%- set ext = fm.fm_file_ext | default(value=path|file_ext) -%}
<!DOCTYPE html>
<html lang="{{ fm.fm_lang | default(value='en') }}">
<head>
<meta charset="UTF-8">
<title>{{ fm.fm_title }}</title>
<link rel="stylesheet" href="{{ viewer_doc_css_path | safe}}">
<link rel="stylesheet" href="{{ viewer_highlighting_css_path |safe }}">
<style type="text/css">
/* Customize the viewer CSS here */
</style>
</head>
<body>
<table class="fm">
<tr>
<th class="fmkey">{{'fm_title' | name}}:</th>
<th class="fmval"><b>{{ fm.fm_title | default(value='') | to_html | safe }}</b></th>
</tr>
{% if fm.fm_subtitle %}
<tr>
<th class="fmkey">{{'fm_subtitle' | name}}:</th>
<th class="fmval">{{ fm.fm_subtitle | default(value='') | to_html | safe }}</th>
</tr>
{% endif %}
{% if fm.fm_keywords %}
<tr>
<th class="fmkeygrey">{{'fm_keywords' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_keywords | default(value='') | to_html | safe }}</th>
</tr>
{% endif %}
<tr>
<th class="fmkeygrey">{{'fm_author' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_author | default(value='') | to_html | safe }}</th>
</tr>
<tr>
<th class="fmkeygrey">{{'fm_date' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_date | default(value='') | to_html | safe }}</th>
</tr>
<tr>
<th class="fmkeygrey">{{'fm_lang' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_lang | default(value='') |to_html | safe }}</th>
</tr>
{% if fm.fm_languages %}
<tr>
<th class="fmkeygrey">{{'fm_languages' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_languages | default(value='') | to_html | safe }}</th>
</tr>
{% endif %}
{% if fm.fm_scheme %}
<tr>
<th class="fmkeygrey">{{'fm_scheme' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_scheme | default(value='') | to_html | safe }}</th>
</tr>
{% endif %}
{% if fm.fm_sort_tag %}
<tr>
<th class="fmkeygrey">{{'fm_sort_tag' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_sort_tag | default(value='') | to_html | safe }}</th>
</tr>
{% endif %}
{% set extra_fm = fm
| remove(key='fm_title')
| remove(key='fm_subtitle')
| remove(key='fm_keywords')
| remove(key='fm_author')
| remove(key='fm_date')
| remove(key='fm_lang')
| remove(key='fm_languages')
| remove(key='fm_scheme')
| remove(key='fm_sort_tag')
%}
{% if extra_fm | length > 0 %}
<tr><th colspan=2;\"/> <th/</tr>
{% endif %}
{% for k, v in extra_fm %}
<tr>
<th class="fmkeygrey">{{ k | name }}:</th>
<th class="fmvalgrey">{{ v | to_html | safe }}</th>
</tr>
{% endfor %}
</table>
<div class="doc-body">{{ doc.body | markup_to_html(extension=ext) | safe }}
</div>
<script>{{ viewer_doc_js | safe }}</script>
</body>
</html>
'''
viewer_error = """
<!DOCTYPE html>
<html lang=\"en\">
<head>
<meta charset=\"UTF-8\">
<title>Syntax error</title>
<style type="text/css">
@media (prefers-color-scheme: dark) {
.note-error { color: #e5948d; }
h1, h2, h3, h4, h5, h6 { color: #8db2e5; }
a { color: #8de594; }
body {
background: #292929;
color: #eeeeee;
}
}
@media (prefers-color-scheme: light) {
.note-error { color: #523626; }
h1, h2, h3, h4, h5, h6 { color: #263292; }
a { color: #316128; }
body {
background: #ffffff;
color: #000000;
}
}
pre { white-space: pre-wrap; }
h1, h2, h3, h4, h5, h6 { font-family:sans-serif; }
</style>
</head>
<body>
<h3>Syntax error</h3>
<p> in note file: <pre>{{ path }}</pre><p>
<div class=\"note-error\">
<hr>
<pre>{{ doc_error }}</pre>
<hr>
</div>
{{ doc_text | markup_to_html | safe }}
<script>{{ viewer_doc_js | safe }}</script>
</body>
</html>
"""
viewer_doc_css = """
/* Tp-Note's viewer document CSS */
@media (prefers-color-scheme: dark) {
h1, h2, h3 { font-weight: normal; color: #fad566; }
h4, h5, h6 { font-weight: bold; color: #fad566; }
em { color: #cfba8b; }
a { color: #72a59e; }
body {
background: #232323;
color: #f3f2db;
}
table.fm { background-color: #303030; }
th.fmkey{ color: #cfba8b; }
th.fmval{ color: #99be70; }
th.fmkeygrey{ color: #999999; }
th.fmvalgrey{ color: #999999; }
}
@media (prefers-color-scheme: light) {
h1, h2, h3, h4, h5, h6 { color: #263292; }
em { color: #523626; }
a { color: #316128; }
body {
background: #ffffff;
color: #000000;
}
table.fm { background-color: #f3f2e4; }
th.fmkey{ color: #444444; }
th.fmval{ color: #316128; }
th.fmkeygrey{ color: grey; }
th.fmvalgrey{ color: grey; }
}
table.fm {
font-weight: normal;
margin-left: auto;
margin-right: auto;
padding: 4px;
border:1px solid grey;
}
th.fmkey, th.fmkeygrey {
font-weight: normal;
padding-left:20px;
padding-right:10px;
}
th.fmval, th.fmvalgrey {
font-weight: normal;
padding-left:10px;
padding-right:20px;
}
th.fmkey{ text-align:right; vertical-align:top;}
th.fmval{
text-align:left;
font-family:sans-serif;
}
th.fmkeygrey{ text-align:right; vertical-align:top;}
th.fmvalgrey{ text-align:left; }
ul.fm {
padding-left: 15px;
margin: 0px;
}
li.fm {
padding-bottom: 0px;
}
blockquote.fm {
margin: 0px;
padding-left: 15px
}
pre { white-space: pre-wrap; }
h1 { font-size: 150% }
h2 { font-size: 132% }
h3 { font-size: 115% }
h4, h5, h6 { font-size: 100% }
h1, h2, h3, h4, h5, h6 { font-family:sans-serif; }
"""
viewer_highlighting_theme = "Solarized (light)"
viewer_highlighting_css = ""
exporter = '''
{%- set ext = fm.fm_file_ext | default(value=path|file_ext) -%}
<!DOCTYPE html>
<html lang="{{ fm.fm_lang | default(value='en') }}">
<head>
<meta charset="utf-8">
<title>{{ fm.fm_title }}</title>
<style type="text/css">
{{ exporter_doc_css | safe }}
{{ exporter_highlighting_css | safe }}
/* Customize the viewer CSS here */
</style>
</head>
<body>
<table class="fm">
<tr>
<th class="fmkey">{{'fm_title' | name}}:</th>
<th class="fmval"><b>{{ fm.fm_title | default(value='') | to_html | safe }}</b></th>
</tr>
{% if fm.fm_subtitle %}
<tr>
<th class="fmkey">{{'fm_subtitle' | name}}:</th>
<th class="fmval">{{ fm.fm_subtitle | default(value='') | to_html | safe }}</th>
</tr>
{% endif %}
{% if fm.fm_keywords %}
<tr>
<th class="fmkeygrey">{{'fm_keywords' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_keywords | default(value='') | to_html | safe }}</th>
</tr>
{% endif %}
<tr>
<th class="fmkeygrey">{{'fm_author' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_author | default(value='') | to_html | safe }}</th>
</tr>
<tr>
<th class="fmkeygrey">{{'fm_date' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_date | default(value='') | to_html | safe }}</th>
</tr>
<tr>
<th class="fmkeygrey">{{'fm_lang' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_lang | default(value='') | to_html | safe }}</th>
</tr>
{% if fm.fm_languages %}
<tr>
<th class="fmkeygrey">{{'fm_languages' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_languages | default(value='') | to_html | safe }}</th>
</tr>
{% endif %}
{% if fm.fm_scheme %}
<tr>
<th class="fmkeygrey">{{'fm_scheme' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_scheme | default(value='') | to_html | safe }}</th>
</tr>
{% endif %}
{% if fm.fm_sort_tag %}
<tr>
<th class="fmkeygrey">{{'fm_sort_tag' | name}}:</th>
<th class="fmvalgrey">{{ fm.fm_sort_tag | default(value='') | to_html | safe }}</th>
</tr>
{% endif %}
{% set extra_fm = fm
| remove(key='fm_title')
| remove(key='fm_subtitle')
| remove(key='fm_keywords')
| remove(key='fm_author')
| remove(key='fm_date')
| remove(key='fm_lang')
| remove(key='fm_languages')
| remove(key='fm_scheme')
| remove(key='fm_sort_tag')
%}
{% if extra_fm | length > 0 %}
<tr><th colspan=2;\"/> <th/</tr>
{% endif %}
{% for k, v in extra_fm %}
<tr>
<th class="fmkeygrey">{{ k | name }}:</th>
<th class="fmvalgrey">{{ v | to_html | safe }}</th>
</tr>
{% endfor %}
</table>
<div class="doc-body">{{ doc.body | markup_to_html(extension=ext) | safe }}
</div>
</body>
</html>
'''
exporter_highlighting_theme = "Solarized (light)"
exporter_highlighting_css = ""
exporter_doc_css = """
/* Tp-Note's exporter document CSS */
@page {
@bottom-center {
content: counter(page) "/" counter(pages);
}
size: A4 portrait;
}
.custom-options input[type=checkbox]{
margin-left: 5px;
margin-right: 10px;
margin-bottom: 5px;
}
input:before{content:attr(value)}
select:before{content:attr(value)}
label {
display: block;
}
input[type=checkbox] {
background-clip: content-box;
background-color: white;
border: 1px solid;
border-radius: 2px;
display: inline-block;
height: 0.5em;
margin: 0.5em 0.5em 0 0.5em;
padding: 2px;
width: 0.5em;
}
input[type=checkbox][checked] {
background-color: gray;
}
table.fm {
font-weight: normal;
margin-left: auto;
margin-right: auto;
padding: 4px;
background-color: #f3f2e4;
border:1px solid grey;
}
th.fmkey, th.fmkeygrey {
font-weight: normal;
padding-left:20px;
padding-right:10px;
}
th.fmval, th.fmvalgrey {
font-weight: normal;
padding-left:10px;
padding-right:20px;
}
th.fmkey{ color:#444444; text-align:right; vertical-align:top;}
th.fmval{
color:#316128;
text-align:left;
font-family:sans-serif;
}
th.fmkeygrey{ color:grey; text-align:right; vertical-align:top;}
th.fmvalgrey{ color:grey; text-align:left; }
ul.fm {
padding-left: 15px;
margin: 0px;
}
li.fm {
padding-bottom: 0px;
}
blockquote.fm {
margin: 0px;
padding-left: 15px
}
pre { white-space: pre-wrap; }
em { color: #523626; }
a { color: #316128; }
h1 { font-size: 150% }
h2 { font-size: 132% }
h3 { font-size: 115% }
h4, h5, h6 { font-size: 100% }
h1, h2, h3, h4, h5, h6 { color: #263292; font-family:sans-serif; }
"""