Skip to content

Editorial Conventions Configuration

Chiara Di Pietro edited this page Jan 21, 2021 · 4 revisions

Editorial Conventions Configuration (editorial_conventions_config.json) allows to set configurate the style of publishing phenomena (e.g. addition, deletion, etc), in order to override the EVT default layouts.

For each particular phenomena you should choose an identifier that will help you to better orient yourself in the configuration file itself and define an element with very specific properties.

{
    "additionAbove": { 
        /* configuration for addition above */ 
    },
    "additionBelow": { 
        /* configuration for addition below */ 
    },
}

In particular, every configuration element should present the following properties:

interface CustomEditorialConvention {
    markup: {
        element: string;
        attributes: { [key: string]: string; };
    };
    layouts: {
        [key in EditionLevelType]: {
            style: { [cssProperty: string]: any; };
            pre: string;
            post: string;
        };
    };
}

The markup identifies the element depending on its encoding (tag name and map of attributes), while the layouts indicate the output style to be assigned for the indicated encoding for each edition level. In this case you can define:

  • style can be used to define a list of CSS properties to be assigned to the output element. These rules will be merged with the default ones.
  • pre can be used to indicate the text to be shown before the element
  • post can be used to indicate the text to be shown after the element None of these properties are mandatory, thus it is possible to define a single specific configuration, for example only some text to be shown before the text.

If you do not indicate a specific layout for a specific edition level, the default EVT layouts will be used.


Note that for the moment this configuration will only works with specific elements:

  • additions (<add>)
    • above (<add place="above"> or <add place="sup">)
    • below (<add place="below"> or <add place="under"> or <add place="sub">)
    • inline (<add place="end"> or <add place="inline"> or <add place="inspace">)
    • left (<add place="left">)
    • right (<add place="right">)
  • damages (<damage>)
  • deletions (<deletions>)
  • original part of text deemed incorrect (<sic type="crux">)
  • superfluous or redundant part of text (<surplus>)

This list will grow as the development of publishing phenomena goes on. If you want to style an element that does not appear in this list you should use a custom CSS rules See details here.


Example

Let's say you want to change:

  • the style of <add place="above"> so that in the diplomatic edition they will figure 10px above the baseline and in the interpretative edition it is shown between the characters "\" and "/" and has a yellow background.
  • the style of generic deletions <del> so that in the diplomatic edition they will be hidden in the interpretative edition. Your editorial_conventions_config.json will be:
{
    "additionAbove": {
        "markup": {
            "element": "add",
            "attributes": {
                "place": "above"
            }
        },
        "layouts": {
            "diplomatic": {
                "style": {
                    "top": "-10px",
                    "position": "relative"
                }
            },
            "interpretative": {
                "pre": "\\",
                "post": "/",
                "style": {
                    "background-color": "#ffcc00"
                }
            }
        }
    },
    "deletions": {
        "markup": {
            "element": "del"
        },
        "layouts": {
            "interpretative": {
                "style": {
                    "display": "none"
                }
            }
        }
    }
}