geolexica / geolexica-server

Generalized backend for Geolexica sites
2 stars 1 forks source link

Humanize concept data outside of Liquid templates #90

Open skalee opened 4 years ago

skalee commented 4 years ago

Background

TC211&OSGeo have something like:

<p class="definition localized">{{ localized_term.definition | escape }}</p>

Whereas IEV has:

<p class="definition localized">{{ localized_term.definition | escape | asciidocify | asciimath | termlink }}</p>

And in some other place it's without termlink, probably for purpose:

<h3 class="localized">{{ entry.designation | escape | asciidocify | asciimath }}</h3>

Problem

Differences between templates in these sites are mostly about which filters are applied. It is a poor idea to override whole templates just because of that. These filters should be combined into one filter (think of jsonify) so that merely a different chain of filters (or filter arguments) does not require overriding the whole template.

This is only a sketch of a plan. I don't know yet what should be done exactly.

ronaldtse commented 4 years ago

The reason is IEV data contains asciidoc formatting to indicate inline math (i.e. stem:[xxx], latexmath:[xxx]), where the TC211 and OSGeo data don’t (yet).

TC 211 will soon contain math (the math wasn’t integrated before because we didn’t support).

So there should be a unified template.

skalee commented 4 years ago

There are also term links, which may look a little different for every site. Also I'm thinking about future sites which may have some features enabled and some not. Also repeating a long list of filters (possibly longer in future) is error-prone.