nlbdev / nordic-epub3-dtbook-migrator

Tools for converting between a strict subset of DTBook and EPUB3.
http://nlbdev.github.io/nordic-epub3-dtbook-migrator/
GNU Lesser General Public License v2.1
8 stars 7 forks source link

Validator issue: linegroups are not allowed in non-verse settings #449

Closed martinpub closed 3 years ago

martinpub commented 3 years ago

The testbook DTB38216 had an example of linegroup in a non-verse setting, but it seems the RelaxNG schema forbids it?

These constructions

<section aria-labelledby="hd9-2" id="level9-2"><h2 id="hd9-2">MEAN GIRLS? GENDER PORTRAYALS IN TEEN MOVIES</h2>
<p><strong>Elizabeth Behm&#x002D;Morawitz and Dana E. Mastro</strong></p>
<p class="linegroup"><span class="line"><span class="linenum">1</span> Research examining the effects of media exposure demonstrates that media consumption has a measurable</span>

triggered these errors in the validator:

[xhtml] (Line: 00029 Column: 00022) value of attribute "class" is invalid

I don't remember this being a restriction in the previous guidelines, and I think semantically it would be good to be able to mark even non-verse content with linenumber/line markup. (This case was an appendix to a methodology book where an article is printed verbatim with numbered lines for simplyfing referencing from inside the book.)

Ping @AndersEkl @kalaspuffar

kalaspuffar commented 3 years ago

Hi @martinpub

I've looked at the specification, and the only place that we mention 'linenum' is in '3.4.11 Poetry and Verse'.

Changing this, so we allow line groups everywhere is possible but not recommended. Allowing specific content in a context where it isn't easily handled would add more complexity for the Reading Systems developers.

The point of a specification is to be concise to enable reading. Allow line groups everywhere could create a complexity of books with a less desirable layout.

I remember a dtbook we analyzed where each line of text in the book had a line group.

Best regards Daniel

martinpub commented 3 years ago

Thanks for checking @kalaspuffar. I agree that this is an item for clarification in the guidelines. I would argue the use case is there to allow it in other settings, but perhaps it then needs a separate wrapper on the same level as the poetry/verse wrapper. I will create an issue for a second version of the guidelines.

martinpub commented 3 years ago

See also https://github.com/nlbdev/epub3-guidelines-update/issues/137.

martinpub commented 3 years ago

This is still an issue for MTM, as we have content we need to mark up line by line that is not verse/poems. We would like to have the validator accept the markup outside of verse settings until the guidelines have been updated to clarify this use case.

martinpub commented 3 years ago

This was discussed on today's validator group meeting. MTM will use another <div> wrapper for non-verse use. It should be allowed by the validator while waiting for the guidelines group to agree on a construction to add in revised guidelines.

kalaspuffar commented 3 years ago

Hi @martinpub

Do you have a suggestion on class for the wrapper? Example:

<div class="preformatted">
     <p class="linegroup"><span class="line"><span class="linenum">1</span> Research examining the effects of media exposure demonstrates that media consumption has a measurable</span>
</div>

Best regards Daniel

martinpub commented 3 years ago

Hi @kalaspuffar, I was just about to add that information. I think <div class="line-by-line"> is more accurate. But other than that, your example looks the way we would like it to work.