Quote:
Originally Posted by doubleshuffle
Good. I was afraid I'd have to start bothering with epub3.
|
Some epub3 features actually simplify the formatting of poems. IMHO, it couldn't hurt to have a look at
pseudo classes, which allow you to apply CSS rules based on the number of an element without additional markup.
For example, you could automatically apply CSS rules to the last line of a verse and display line numbers every 5 lines using the following stylesheet:
Code:
ul {
counter-reset: counter;
margin-left: .25em;
}
li {
counter-increment: counter;
list-style-type: none;
}
ul li:nth-child(5n+5):before {
left: 0;
position: absolute;
padding-left: 1em;
content: counter(counter);
}
ul li:nth-child(6n+6) {
text-align: right;
margin-bottom: 1em;
}
h3 {
text-align: center;
}
I've attached a slightly updated example file that I posted in a related thread.
Since this is an ePub3 file, it'll only work with Sigil, iBooks, ADE4/RMSK11*, Gitden Reader*, Kindles and other ePub3 apps.
*ADE and Gitden Reader, which both use the Readium engine, generally support pseudo classes, but have problems with counters.
ADE adds phantom numbers and Gitden Reader displays numbers only on the first page.
The only app that displays the test file correctly is iBooks.