tno-terminology-design / tev2-tools

The Terminology Engine (v2) is a set of specifications and tools that caters for the creation and maintenance (i.e. curation) of terminologies. This repository contains the sources for the tools.
Apache License 2.0
2 stars 3 forks source link

TRRT error converter does no conversion (but it does execute on an error) #43

Closed RieksJ closed 7 months ago

RieksJ commented 8 months ago

I have specified the following TRRT configuration:

## Term Reference Resolution Tool
trrt:
  interpreter: default 
  converter: html-hovertext-link
  converter[error]: "{{showtext}}{{log 'TRRT error converter:' err.dir '/' err.file '@' err.line ':' err.pos '[' ref.showtext ']' level='warn'}}"

I would expect that this configuration would have the following effect for any TermRef for which it could not find a corresponding MRG-entry:

The idea of the converter[error] is that the TermRef will actually be replaced by what it says.

Ca5e commented 8 months ago

Interesting, I didn't know log was an option within Handlebars. The TRRT currently doesn't perform a replacement step if the replacement string is empty, in the case of the current error converter it is empty because the use of {{showtext}} instead of {{ref.showtext}}.

RieksJ commented 8 months ago

Yes, it is. In the (new) TEv2-page on handlebar helper functions, I have included the list of helpers that are available by default (which refer to their documentation). Knowing about them - particularly #each - was instrumental for imlementing the feature for having definitions be associated with notes, which many glossaries have (and which TEv2 now also does).

Ok for your explanation. Can you make the TRRT (and HRGT) replace the TermRef/MRGRef (in case of an error) with the output of the err.converter if that is not the empty string?

RieksJ commented 7 months ago

is this issue related to #45 ?

Ca5e commented 7 months ago

is this issue related to #45 ?

They are related in the sense that {{showtext}} was still being used instead of {{ref.showtext}}. I've changed that in this commit. I believe this issue is now resolved with the publication of verson 1.1.2 of the tools.