-
Notifications
You must be signed in to change notification settings - Fork 25
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
HTML visualization #80
Comments
A more detailed suggestion: The style sheet should have three columns specifying the triggering condition, what element/styling to produce and what text to produce within that element. The triggering condition can be the presence of an annotation name, value or name+value combination. As text within the element, it should be possible to choose the annotation name, value, namespace, or an arbitrary string determined in the style sheet. Rules apply in the order in which they appear in the style sheet. The element specified is produced at the beginning of the annotation span (left token) and closed at the end (right token). If several rules apply to the same annotation or multiple annotations with the same token area, the first rule is applied to produce its opening tag, then the second rule produces its opening tag etc. When multiple closing tags are applied, they are generated in reverse order. Some examples:
|
Using metadata in the visualization: a further expansion requested by the Coptologists is the ability to integrate some of the metadata into the document view (selectively and without clicking on the 'i' button). If we allow the HTML visualization to access metadata as well we can answer this request at the same time. The inspiration for this visualization is something like papyri.info, for example here: Notice the metadata at the top and the entire text of the document at the bottom. |
Yet another suggestion: we should allow regex based matching to trigger HTML generation, not just exact match. For example, to correctly display TEI rend attributes written in plain English, if the rend description contains the word "red", we make the font red: rend=/(^|.* )[Rr]ed( |$).*/ span; style="color: red" This is triggered by an annotation like: rend="large illuminated red capital" |
An experimental version of the HTML visualization was added in revision a828238 |
There should be a whole document visualization (not just the hit) taking one text (in case of parallel corpora), which produces the running text of the document from some segmentation level (tokens or otherwise), configured via mappings. It should be possible to format the document based on a mapping between annotation levels and HTML elements or CSS styles. For example, a
element could be introduced whenever a 'p' annotation name or value is present. This requires a simple .ini file to configure the visualization. The file should have two columns: a condition triggering the formatting, and the formatting to apply. The condition can have the form
annoname
or
annoname="value"
Where matching the second condition supercedes the first, as it is more specific. The formatting column should have one of the forms:
elementname
or
elementname;style="attr1: val1; attr2: val2"
Some examples:
The text was updated successfully, but these errors were encountered: