View Single Post
Old 09-21-2017, 03:17 AM   #22
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by AlanHK View Post
Was wondering how to do that in Sigil. Thanks.


Quote:
Originally Posted by AlanHK View Post
I have considered this style, but the only time I think it would be useful is with very long lines so it can soft wrap with an indent as conventional. So far have not had anything that made the hassle worth it.
One advantage is that you can allow yourself access to more complicated CSS selectors in the future. For example, here is RbnJrg showing off every 5th line being numbered:

https://www.mobileread.com/forums/sh...18#post3027118

I would also think it would be easier to control multiple levels of indentation like this:

Spoiler:
Code:
<p class="poem1">Test</p>
<p class="poem1">One</p>
<p class="poem2">Two</p>
<p class="poem3">Three</p>
CSS:

Code:
.poem1 {
	text-indent: -2em;
	margin-left: 2em;
}

.poem2 {
	text-indent: -2em;
	margin-left: 4em;
}

.poem3 {
	text-indent: -2em;
	margin-left: 6em;
}


instead of trying to hack together multiple &nbsp; or &emsp; at the beginning of lines.

Then two simple Saved Clips:

Code:
<div class="poem">\1</div>

<div class="stanza">\1</div>
would let you wrap individual poems/stanzas (if needed).

I typically use this CSS:

Spoiler:
Code:
div.poem {
	margin-top: 1em;
	margin-bottom: 1em;
}

div.stanza {
	margin-top: 1em;
}


Easy peasy consistent coding. And thing of all the headaches you would save your future self.

Quote:
Originally Posted by AlanHK View Post
Also, all my source text is derived from a DTP program that styles by paragraph, but does not have the concept of containers like <div>. I have macros that convert the formatting codes to HTML para by para. In the DTP the poems also use stanza = para, linebreaks, not para endings.
Hmmm... could probably come up with a Search/Replace to spot and replace each line with a <p class="poem">:

Search: ^\s+(.+?)<br />
Replace: <p class="poem">\1</p>

That would get you most of the way, then you would just need some manual adjustment for those final lines (or create another Regex to handle THAT situation). :P Hard to judge ahead of time without seeing the code, but a group of regexes could probably be pieced together.
Tex2002ans is offline   Reply With Quote