First pass at using rendition/@selector
Posted by mholmes on 17 Dec 2018 in Activity log
It's very common to find the same pattern of indents throughout the stanzas of a poem. Right now, people are encoding these mechanically and repetitively, which is OK but clutters the XML and takes time. A better option would be to use the TEI rendition element with the @selector attribute, like this:
<rendition selector="lg"> margin-left: 6rem; </rendition> <rendition selector="lg>l:nth-child(2), lg>l:nth-child(4), lg>l:nth-child(7), lg>l:nth-child(10)"> margin-left: 1.1em; </rendition>
to specify that all stanzas have a left margin of 6rem, and lines 2, 4, 7, and 10 of each stanza are additionally indented.
This is easy to code but hard to process. I've had a first shot at figuring out how to do it, and so far so good, although as the selectors get more gnarly the code will have to be revisited. It's good enough for testing purposes at any rate.