glossarist / iev-document

Auto-generated IEV document from ConceptYAML
1 stars 0 forks source link

Broken Metanorma smart terms referencing #10

Closed ronaldtse closed 2 years ago

ronaldtse commented 2 years ago

Original source:

==== degradation

detrimental change in ability to meet requirements

SEE: degraded state ({{<<IEV:192-02-25>>,192-02-25}}).

NOTE: Degradation may occur with storage or use, brought about by internal processes or effects of the environment.

NOTE: Degradation beyond specified limits may constitute a degraded state or failure.

NOTE: In a system context, degradation may also be caused by failures within the system.

The syntax is correct.

Rendered:

Screenshot 2021-11-16 at 1 03 01 PM
ronaldtse commented 2 years ago

Will be fixed in https://github.com/metanorma/metanorma-iec/issues/113.

opoudjis commented 2 years ago

This is ... kind of fixed; what we get now is:

sub item ({{<<IEV:192-01-02>>,192-01-02}})

sub item (192-01-02 (192-01-02))

Which I'm going to emend to

sub item ({{<<IEV:192-01-02>>}})

sub item (192-01-02)

What this should be rendered as is

({{<<IEV:192-01-02>>, sub item}})

(sub item (192-01-02))

But that is going to require markup which presumably is not in the source YAML.

opoudjis commented 2 years ago

I'm going to assign this to you @ronaldtse because the needed intervention in IEV source is beyond me.

ronaldtse commented 2 years ago

@opoudjis your example seems rather different from mine...? What is the correct syntax?

I just want 192-01-02. The IEV content will always have a referential text, whether it is the IEV number or some text.

opoudjis commented 2 years ago

I just want 192-01-02. The IEV content will always have a referential text, whether it is the IEV number or some text.

You're already getting "just 192-01-02", with the existing markup:

SEE: degraded state {{<<IEV:192-02-25>>}}.

{{<<IEV:192-02-25>>}} is defaulting to the referential text of the number, because we are not providing an additional rendered text.

However, the CORRECT markup, which is intended by the authors, but not marked up as such, is to indicate that the preceding text "degraded state" is the rendered text:

SEE: {{<<IEV:192-02-25>>, degraded state}}.

which is reflected in the lack of italics for degraded state.

In fact, in this instance we can detect that this is a related term, and mark it up correctly. I'm going to go ahead and do so.

But in general we can't. That is a fault of the YAML having insufficient markup.

ronaldtse commented 2 years ago

When the Glossarist YAML format was born, Metanorma did not have terms referencing. This is simply a task to back propagate this syntax to the IEV cleaner at the "iev-data" gem.