Skip to content

Introduce new mode value for generated HTML version of entities (for annotations) #235

@daliboris

Description

@daliboris

I suggest to introduce new mode value (within $parameters variable) to control HTML generated (in the tooltip, for example) for annotated elements.

Suggested parameter's value, for instance register-entry should be used in reapi:register-entry() function in the registers.xql module.

On the line 435 change

"details": <div>{$pm-config:web-transform($entry, map {}, "annotations.odd")}</div>

to

"details": <div>{$pm-config:web-transform($entry, map {"mode" : "register-entry"}, "annotations.odd")}</div>

With this new value you can control how elements in the tooltip are rendered.

If the entity is part of the list (for example list of glosses),

<list type="glossary">
<item xml:id="kalendy">
  <label type="main">Kalendy</label>
  <gloss xml:lang="cs">název prvního dne v měsíci v římském kalendáři. <hi rendition="italic">Jani Calendae </hi>jsou tedy lednové Kalendy, začátek roku.</gloss>
  <gloss xml:lang="en">the name of the first day of the month in the Roman calendar. <hi rendition="italic">Jani Calendae</hi> is thus the January Calendae, the beginning of the year.</gloss>
  <note />
</item>
</list>

the <item> element can be rendered as the block element:

<elementSpec ident="item" mode="change">
    <model predicate="$parameters?mode='register-entry' and parent::list" behaviour="block" />
    <model behaviour="listItem"/>
</elementSpec>

Another example: if the <hi> element is part of the anotation, it can be rendered with desired rendition but not as an annotation:

<elementSpec ident="hi" mode="change">
    <model predicate="$parameters?mode='register-entry'" behaviour="inline" useSourceRendition="true"/> 
    <model behaviour="inline" cssClass="annotation annotation-hi" useSourceRendition="true"/>
</elementSpec>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions