Testing for possible <dfn> candidates in endnotes

56 views
Skip to first unread message

Alex Cabal

unread,
Jul 9, 2024, 3:03:21 PM (8 days ago) Jul 9
to Standard Ebooks
Robin's use of <dfn> for terms being defined in endnotes made me think
that maybe this can be a new rule with a lint check. See
https://standardebooks.org/ebooks/tanizaki-junichiro/short-fiction/iwado-z-tamotsu/text/endnotes

The following xpath picks up quite a few candidates in the corpus:

//li[@epub:type='endnote' and ./p/node()[1][name()='i' and
not(@epub:type) and string-length(.) < 20 and
string-length(./following-sibling::text()) > 20]]

It looks for an endnote with <i> as a first child, whose text is less
than 20 chars, and whose following text is longer than 20 chars. This
matches what we're looking for fairly well, and these should be
converted to <dfn> with font-style: italic.

I'm very busy these coming weeks, but is anyone interested in developing
this test further?

Andrew Paseltiner

unread,
Jul 13, 2024, 12:09:35 PM (4 days ago) Jul 13
to Standard Ebooks
I'm happy to work on this.
Reply all
Reply to author
Forward
0 new messages