Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
daliboris opened this issue Sep 13, 2024 · 0 comments

Comments

@daliboris
Copy link
Contributor

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant