evt-project / evt-viewer-angular

Edition Visualization Technology version 3
GNU Affero General Public License v3.0
21 stars 16 forks source link

Feature/app source analogues frame #229

Closed davivcu closed 6 months ago

davivcu commented 8 months ago

This branch populated the three sections of the Apparatus-Sources-Analogues frame. Parsing of sources and analogues attributes can be custumized in new keys inside edition_config.json.

The aspect of sources and analogues elements in the text flow can be configured in editorial_conventions_config.json. Since sources and analogues refer to different markups, said customization will use the dot notation to clarify that we are styling a group of elements '.analogues' and '.sources', and not the single elements quote/cit/div/ref/seg/p/l... that can be recognized as such (example at the end of the post). Default values for this editorial configuration joined the similar defaults inside editorial-conventions-service.ts.

The highlight color for click and hover events on the sources and analogues is taken from existing values edition.readingColorDark and edition.readingColorHight key in edition_config.json. In order to apply them, this branch uses a new small function that can be extended in the future to load generic CSS written by the users.

Both analogue entry and source entry components use the existing evt-content-viewer component in order to display their nested elements both in the text flow and in their frame. In the case of self-closed elements such as PTR or empty elements, the source or analogue element will be displayed as a note/exponent in the text flow.

New features:

Managing Sources and Analogues classes required setting up the parsing and models of various elements:

Added few utilities in dom-utils and xml-utils.

Changes to existing features:

Elements modified for @source (customizable in config) attribute recognition and relative elements retrieving:

Added correct type referral in MsDescParser for new BiblList, Bibl, and Quote types.

A json you may use to test editorial conventions for analogues and sources:

 { 
    "quotations": {
        "markup": {
            "element": ".sources"
        },
        "layouts": {
            "diplomatic": {
                "style": {
                    "font-style": "italic",
                    "background-color":"red"
                }
            },
            "critical": {
                "style": {
                    "font-style": "italic",
                    "background-color":"green"
                }
            },
            "interpretative": {
                "style": {
                    "font-style": "italic",
                    "background-color":"blue"
                }
            }
        }
    },
    "analogues": {
        "markup": {
            "element": ".analogues"
        },
        "layouts": {
            "diplomatic": {
                "style": {
                    "text-decoration": "underline dotted from-font",
                }
            },
            "interpretative": {
            "pre": '>',
               "style": {
                    "font-style": "italic",
                    "text-decoration": "underline dotted from-font",
                }
            },
            "critical": {
             "pre": 'ANG: ',
                "style": {
                    "text-decoration": "underline dotted from-font",
                }
            }
        }
    }
 }