crowdagger / crowbook

Converts books written in Markdown to HTML, LaTeX/PDF and EPUB
GNU Lesser General Public License v2.1
742 stars 38 forks source link

[epub] can’t set `content` for `li`? #109

Closed Geobert closed 1 year ago

Geobert commented 1 year ago

I’m customizing the css for epub and something is elluding me:

ul {
    list-style-type: none;
    padding-left: 0;
} 

li:before {
    content: '— ';
}

but it doesn’t render.

But, I’m wondering how you guys manage dialogs in your books? When doing dialogs, I’m ending with a bullet list with the disc as bullet. That’s why I’m trying to customize the CSS but I’m wondering if I’m missing something :-/

Geobert commented 1 year ago

Note that the pdf render the dialogs properly

Geobert commented 1 year ago

Forget it, it was the reader I was using (Sumatra 3.4.6) that wasn’t rendering them. Using Calibre reader works.

I had to fiddle a bit with the exact CSS:

ul li {
    list-style-type: none;
    position: relative;
} 

ul li:before {
    content: '—';
    position: absolute;
}
crowdagger commented 1 year ago

What I do for dialogues is put the "–" directly in the text, not using li. If you can't type them easily you can use "---" and set the option "input.clean.ligatures.dashes" to true to convert them automatically (there's also input.clean.ligatures.guillemets to convert << to « and >> to »).

The problem is using lists is mostly that some epub renderers are not actually that well versed in rendering css and if you try to have something that work nicely on physical ereaders it might be complicated (hopefully there has been some progress on their side since last time I checked, though?)

Geobert commented 1 year ago

the thing with using "—" (I can type it, using bépo layout 😄), is that the dialog is not properly formatted:

— blabla. — blibli

instead of a new line per "—"

I haven’t check how it renders on my e-reader yet

Geobert commented 1 year ago

@lise-henry : je suis du coup curieux de savoir comment vous faites pour avoir les dialogues qui s’affichent correctement en utilisant le tiret cadratin ? :)

crowdagger commented 1 year ago

I just separate with paragraphs:

— Bonjour !

— Comment allez-vous ?

Geobert commented 1 year ago

I see, I was looking for a way to avoid too many empty lines, so the CSS customization is the way for my needs :) Thanks!