Quote:
Originally Posted by Jellby
Too often I encounter different pieces of poetry, in the same book, with varying indent amounts, I've become lazy now and called them simply "line2", "line3", etc.
|
Yep, exactly. There are sometimes 2 or 3 layers deep of indentation.
If you only have a basic <p>/<div> for each line... sure, that'll work for basic poems/lyrics, but then you'll get into a pickle later.
So I just tag every line with its own class:
- <p class="poem">
- <p class="poem2">
- <p class="poem3">
Code:
The cat jumped over the fox.
The fox jumped over the cow.
The cow jumped over the moon.
The dog barked.
The cat meowed.
The wolf howled.
... and Tex laughed.
Guess how the HTML markup would look? :P
- - -
Or... another trick I use (mostly in Indexes), is:
- I use class names + "two" or "three" on the end.
After you prettify, the HTML code naturally matches similar levels of indentation too:
See the Index out of the latest latest book I worked on:
Wow, that code brings a tear to my eye, and look how easy it is to read.
- - -
Complete Side Note: That was also the first book I ever ran across where the Index's subentries were actually in
page order... usually all books are in
alphabetical order. I was scratching my head for a while until I noticed the pattern.