daisy / pipeline-mod-braille

!! NOTE: This project is now part of the pipeline-modules project !! | Braille Production Modules for the DAISY Pipeline 2
1 stars 3 forks source link

list-style-type:none not working #167

Closed matskober closed 6 years ago

matskober commented 7 years ago

see job#1010, volume 19; "Ordliste". The list is not correct rendered:

@josteinaj @bertfrees

josteinaj commented 7 years ago

@matskober The list-style-type-none class is defined like this in your EPUB:

<style type="text/css" xml:space="preserve">
.list-style-type-none {
    list-style-type:none;
}
</style>

You may have to set the attribute media="embossed" on the style element to make the CSS take effect.

josteinaj commented 7 years ago

For reference, here's the relevant input HTML in Mats' job:

<head>
    <style type="text/css" xml:space="preserve">
        .list-style-type-none {
            list-style-type:none;
        }
    </style>
</head>
<body>
    <ol id="list_1" class="list-style-type-none">
        <li id="li_1">Aegis: et skjold som Thalia Grace bruker, og som har et fryktinngytende bilde av Medusa foran. Det forvandler seg til et s&#xf8;lvarmb&#xe5;nd n&#xe5;r hun ikke bruker det</li>
        <li id="li_2">Agamethus: s&#xf8;nn av kong Erginus, halvbror av Trophonios, som hogg hodet av ham for &#xe5; unng&#xe5; &#xe5; bli oppdaget etter plyndringstoktet i kong Hyrieus&#x2019; skattkammer</li>
        <li id="li_3">Akefaloer: en stamme med hodel&#xf8;se folk med ansiktet p&#xe5; brystet</li>
        <li id="li_4">Amasoner: et folk best&#xe5;ende av kvinnelige krigere</li>
        <li id="li_5">Amfora: en h&#xf8;y vinkrukke av keramikk</li>
        <li id="li_6">Ares: den greske krigsguden. S&#xf8;nn av Zevs og Hera, og halvbror til Athene. Romersk motstykke: Mars</li>
        <!-- ... -->
    </ol>
</body>

And here's the PEF output rows:

<row>⠀⠀⠀⠀⠀⠀⠼⠁⠀⠠⠁⠑⠛⠊⠎⠒⠀⠑⠞⠀⠎⠅⠚⠕⠇⠙⠀⠎⠕⠍</row>
<row>⠀⠀⠀⠀⠠⠞⠓⠁⠇⠊⠁⠀⠠⠛⠗⠁⠉⠑⠀⠃⠗⠥⠅⠑⠗⠂⠀⠕⠛</row>
<row>⠀⠀⠀⠀⠎⠕⠍⠀⠓⠁⠗⠀⠑⠞⠀⠋⠗⠽⠅⠞⠊⠝⠝⠛⠽⠞⠑⠝⠙⠑</row>
<row>⠀⠀⠀⠀⠃⠊⠇⠙⠑⠀⠁⠧⠀⠠⠍⠑⠙⠥⠎⠁⠀⠋⠕⠗⠁⠝⠄</row>
<row>⠀⠀⠀⠀⠠⠙⠑⠞⠀⠋⠕⠗⠧⠁⠝⠙⠇⠑⠗⠀⠎⠑⠛⠀⠞⠊⠇⠀⠑⠞</row>
<row>⠀⠀⠀⠀⠎⠪⠇⠧⠁⠗⠍⠃⠡⠝⠙⠀⠝⠡⠗⠀⠓⠥⠝⠀⠊⠅⠅⠑</row>
<row>⠀⠀⠀⠀⠃⠗⠥⠅⠑⠗⠀⠙⠑⠞</row>
<row>⠀⠀⠀⠀⠀⠀⠼⠃⠀⠠⠁⠛⠁⠍⠑⠞⠓⠥⠎⠒⠀⠎⠪⠝⠝⠀⠁⠧</row>
<row>⠀⠀⠀⠀⠅⠕⠝⠛⠀⠠⠑⠗⠛⠊⠝⠥⠎⠂⠀⠓⠁⠇⠧⠃⠗⠕⠗⠀⠁⠧</row>
<row>⠀⠀⠀⠀⠠⠞⠗⠕⠏⠓⠕⠝⠊⠕⠎⠂⠀⠎⠕⠍⠀⠓⠕⠛⠛⠀⠓⠕⠙⠑⠞</row>
<row>⠀⠀⠀⠀⠁⠧⠀⠓⠁⠍⠀⠋⠕⠗⠀⠡⠀⠥⠝⠝⠛⠡⠀⠡⠀⠃⠇⠊</row>
<row>⠀⠀⠀⠀⠕⠏⠏⠙⠁⠛⠑⠞⠀⠑⠞⠞⠑⠗⠀⠏⠇⠽⠝⠙⠗⠊⠝⠛⠎⠤</row>
<row>⠀⠀⠀⠀⠞⠕⠅⠞⠑⠞⠀⠊⠀⠅⠕⠝⠛⠀⠠⠓⠽⠗⠊⠑⠥⠎⠐</row>
<row>⠀⠀⠀⠀⠎⠅⠁⠞⠞⠅⠁⠍⠍⠑⠗</row>
<row>⠀⠀⠀⠀⠀⠀⠼⠉⠀⠠⠁⠅⠑⠋⠁⠇⠕⠑⠗⠒⠀⠑⠝⠀⠎⠞⠁⠍⠍⠑</row>
<row>⠀⠀⠀⠀⠍⠑⠙⠀⠓⠕⠙⠑⠇⠪⠎⠑⠀⠋⠕⠇⠅⠀⠍⠑⠙</row>
<row>⠀⠀⠀⠀⠁⠝⠎⠊⠅⠞⠑⠞⠀⠏⠡⠀⠃⠗⠽⠎⠞⠑⠞</row>
<row>⠀⠀⠀⠀⠀⠀⠼⠙⠀⠠⠁⠍⠁⠎⠕⠝⠑⠗⠒⠀⠑⠞⠀⠋⠕⠇⠅⠀⠃⠑⠤</row>
<row>⠀⠀⠀⠀⠎⠞⠡⠑⠝⠙⠑⠀⠁⠧⠀⠅⠧⠊⠝⠝⠑⠇⠊⠛⠑</row>
<row>⠀⠀⠀⠀⠅⠗⠊⠛⠑⠗⠑</row>
<row>⠀⠀⠀⠀⠀⠀⠼⠑⠀⠠⠁⠍⠋⠕⠗⠁⠒⠀⠑⠝⠀⠓⠪⠽⠀⠧⠊⠝⠤</row>
<row>⠀⠀⠀⠀⠅⠗⠥⠅⠅⠑⠀⠁⠧⠀⠅⠑⠗⠁⠍⠊⠅⠅</row>
<row>⠀⠀⠀⠀⠀⠀⠼⠋⠀⠠⠁⠗⠑⠎⠒⠀⠙⠑⠝⠀⠛⠗⠑⠎⠅⠑</row>
<row>⠀⠀⠀⠀⠅⠗⠊⠛⠎⠛⠥⠙⠑⠝⠄⠀⠠⠎⠪⠝⠝⠀⠁⠧⠀⠠⠵⠑⠧⠎</row>
<row>⠀⠀⠀⠀⠕⠛⠀⠠⠓⠑⠗⠁⠂⠀⠕⠛⠀⠓⠁⠇⠧⠃⠗⠕⠗⠀⠞⠊⠇</row>
<row>⠀⠀⠀⠀⠠⠁⠞⠓⠑⠝⠑⠄⠀⠠⠗⠕⠍⠑⠗⠎⠅⠀⠍⠕⠞⠤</row>
<row>⠀⠀⠀⠀⠎⠞⠽⠅⠅⠑⠒⠀⠠⠍⠁⠗⠎</row>
matskober commented 7 years ago

But do you want PIP to generate list styles (number/bullets/etc) at all? Seems wrong as long as the bullets and numbers from the visual versions are present in the EPUB.

josteinaj commented 7 years ago

Your example is an ordered list, and it's not preformatted (i.e. no "•" or similar characters inline at the start of each <li>). The list-style-type CSS property can be used to change if and how the list is numbered/bulleted.

For testing, you could also try setting the attribute style="list-style-type: none;" on the <li> elements explicitly. Maybe there's an issue with priorities when using the NLB stylesheet as well as <style> elements.

The indentation of the first line of list items is specified with text-indent property and is independent of the list-style-type attribute. It is set to 2 in NLBs default stylesheet. If you think the whole list item should be indented and not just the first line, we could maybe use margin-left: 2; instead.

However, if this is an issue specific to how NLB should render braille, then you can open an issue on nlbdev/pipeline instead.

josteinaj commented 7 years ago

Actually, I think maybe you've placed the class attribute in your EPUB wrong. I think you should put the list-style-type-none class on each <li> element instead. Or you can change the CSS rule to:

li {
    list-style-type:none;
}
matskober commented 7 years ago

Well, I haven't done anything in the EPUB; it is generated from the DTBook's list type="pl"

bertfrees commented 7 years ago

Side note: list-style is an alias of list-style-type.

josteinaj commented 7 years ago

@bertfrees aha, I didn't know that.

@matskober Ok, then I suppose the input DTBook was a preformatted list and the CSS rule in the output is maybe wrong. In any case the CSS generated by the nordic migrator when converting a dtbook to epub is not intended to be used when embossing braille.

matskober commented 7 years ago

OK, I thought it would be similar to the one I started out with; that EPUB3 to DTBook and back to EPUB3 would be a kind of a "round trip". And why does it matter, what the EPUB-css looks like; I thought the main css in PIP was in charge?

josteinaj commented 7 years ago

Yes it is supposed to be a round trip, so that the EPUB3 you put in and get out are essentially the same. But the DTBook to EPUB 3 script has not been used as much as the EPUB 3 to DTBook script, so maybe there are bugs in that script still.

It shouldn't matter what the EPUB CSS looks like, no. Practically all of the CSS is in NLBs stylesheet, we don't have some shared CSS across organizations.

bertfrees commented 6 years ago

Is this a real issue in pipeline-mod-braille?

matskober commented 6 years ago

Not sure what you are asking, @bertfrees

bertfrees commented 6 years ago

Just trying to find out whether this is an issue specific to NLB, or if there's a bug in the Pipeline according to you, or something else.

So if I understand correctly your issue is that the CSS list-style-type:none; embedded in your EPUB has no effect in the resulting PEF? Have you got the option "Apply document-specific CSS" enabled? (see http://daisy.github.io/pipeline/modules/braille/epub3-to-pef)

matskober commented 6 years ago

Ok. The problem, as far as I remember, was that PIP generated list numbering when I didn't expect it. The list-style-type: none was present in the xhtml, I believe.

bertfrees commented 6 years ago

The CSS in the xhtml is expected to be ignored when the "Apply document-specific CSS" option is not enabled.

matskober commented 6 years ago

OK. Is it only ol and ul in xhtml? How should the EPUB be marked up, if there is not to be applied any list marks, neither number nor bullets? If the EPUB is based upon a PDF, specially a scanned PDF, the list marks are already there. So maybe the default should be not to add any list style?

On 19 December 2017 at 17:14, Bert Frees notifications@github.com wrote:

The CSS in the xhtml is expected to be ignored when the "Apply document-specific CSS" option is not enabled.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/daisy/pipeline-mod-braille/issues/167#issuecomment-352825350, or mute the thread https://github.com/notifications/unsubscribe-auth/AHpMMlysHJ-a7avurnCPtlaHkGAFXjTuks5tB-7wgaJpZM4PzwRN .

bertfrees commented 6 years ago

Yes, it's only ol and ul, XHTML hasn't got an element specially for preformatted lists. The default in CSS is numbers for ol and bullets for ul, which matches the semantics. I try to stay as faithful as possible to the CSS standard. So the default should stay like it is now I think.

But it isn't hard to apply a different style. If I understand correctly you already mark up preformatted lists with the class "list-style-type-none" today, and you even have the right CSS embedded in the EPUB 3. All you need to do is either enable the "Apply document-specific CSS" option, or provide the style via an external style sheet. If you are afraid that enabling the "Apply document-specific CSS" option would mess things up because there are also rules that should not be applied, you can split up the embedded style sheet in a "screen" part and an "embossed" part.

<link rel="stylesheet" type="text/css" media="screen" href="main.xsl"/>
<link rel="stylesheet" type="text/css" media="embossed" href="braille-specific.xsl"/>
matskober commented 6 years ago

Thanks, Bert, that was informativ!

On 20 December 2017 at 10:34, Bert Frees notifications@github.com wrote:

Yes, it's only ol and ul, XHTML hasn't got an element specially for preformatted lists. The default in CSS is numbers for ol and bullets for ul, which matches the semantics. I try to stay as faithful as possible to the CSS standard. So the default should stay like it is now I think.

But it isn't hard to apply a different style. If I understand correctly you already mark up preformatted lists with the class "list-style-type-none" today, and you even have the right CSS embedded in the EPUB 3. All you need to do is either enable the "Apply document-specific CSS" option, or provide the style via an external style sheet. If you are afraid that enabling the "Apply document-specific CSS" option would mess things up because there are also rules that should not be applied, you can split up the embedded style sheet in a "screen" part and an "embossed" part.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/daisy/pipeline-mod-braille/issues/167#issuecomment-353027146, or mute the thread https://github.com/notifications/unsubscribe-auth/AHpMMrEr_eAqkR81u838LTRKSKvddrxEks5tCOKdgaJpZM4PzwRN .