Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-20-2017, 11:54 AM   #16
exaltedwombat
Guru
exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.
 
Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
I've just had an eBook conversion bumped back for revision because I failed to notice this very thing in the TOC :-)
exaltedwombat is offline   Reply With Quote
Old 09-20-2017, 12:36 PM   #17
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by DiapDealer View Post
Done.
Thanks for the quick response.


I think the reason I only noticed this recently is because "pretty print" has changed.

Previously (version .91, which I used until about a month ago,) if you had a heading:

Code:
<h3>1<br/>One</h3>
If you did "Clean source", as was default on every save, it became
Code:
  <h3>1<br/>

One</h3>
And that in turn generated "1 One" as the TOC title.


But the "prettify" in 0.98 will not create such breaks; in fact it closes them up, which I find irritating. I would much prefer to see a linebreak in code after a <br/>.
When I format poetry, I do each stanza as a para, with <br/> at each line end. "Clean source" handled that. But "Prettifying" now melts each stanza into a single soft wrapped line of code. (I know, the display is the same, so now I have to preview to be sure the breaks are correct.)

Last edited by AlanHK; 09-20-2017 at 12:38 PM.
AlanHK is offline   Reply With Quote
Old 09-20-2017, 04:34 PM   #18
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by AlanHK View Post
(I know, the display is the same, so now I have to preview to be sure the breaks are correct.)
Well you don't reaaaaallly need to preview. You KNOW there's a line break wherever there's a br without actually checking.

Yeah, there's some subtle differences between Tidy's pretty print and our new gumbo equivalent, but Prettify is not likely to change much from here on out (unless there's situations where it affects rendering, of course). We won't please every coder's personal sense of xhtml feng shui no matter how hard we try, so we're not really going to bother trying. We've reached a fairly happy medium with it, I think.

The good news is that Prettify is manual affair now. So if someone wanted to write their own pretty-print plugin, they could do so and forego using the built-in Prettify altogether if they wanted.
DiapDealer is offline   Reply With Quote
Old 09-20-2017, 10:57 PM   #19
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by DiapDealer View Post
Well you don't reaaaaallly need to preview. You KNOW there's a line break wherever there's a br without actually checking.
When there is an actual linebreak on screen, I can see the shape of the poem/song, etc. When as often happens, a linebreak has been lost, it's obvious when a line is twice as long as the others. That visual cue is now gone from the code view.

Also, many poems have patterns of indentation in print that I have to match with html, by inserting various space characters, alignments, etc., involving usually a fair bit of trial and error.

With all the lines mashed together, editing text using linebreaks heavily is now more tedious and error prone. Just finding my place in this big lump of text to tweak the spacing or edit it at all is a chore.

This is a stanza from a poem as it was prettified in 0.91:

Code:
 <p class="poem"><br />
  The moon blue, shy<br />
  at first to know you now croons<br />
  for your childhood<br />
  spoon. Its edge and back<br />
  once sliced, mashed a world<br />
  into bites and paste fitful<br />
  for your mouth that,<br />
  over the years, has learned<br />
  &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;about survival,<br />
  though later you know<br />
  habits form territories, though<br />
  questions, not meanings,<br />
  remain.&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;You, no<br />
  longer amused by the spoon&rsquo;s<br />
  plastic handle of faded<br />
  giraffes, choose to sweat<br />
  in Hong Kong streets, eat<br />
  take-outs with chopsticks<br />
  &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;that do not split<br />
  like win-win situations.</p>
0.98 makes it a single line with soft wraps in code view.


Quote:
<p class="poem"><br/> The moon blue, shy<br/> at first to know you now croons<br/> for your childhood<br/> spoon. Its edge and back<br/> once sliced, mashed a world<br/> into bites and paste fitful<br/> for your mouth that,<br/> over the years, has learned<br/> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;ab out survival,<br/> though later you know<br/> habits form territories, though<br/> questions, not meanings,<br/> remain.&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;You, no<br/> longer amused by the spoon’s<br/> plastic handle of faded<br/> giraffes, choose to sweat<br/> in Hong Kong streets, eat<br/> take-outs with chopsticks<br/> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;th at do not split<br/> like win-win situations.</p>
Add comma after 3rd word of line 10? Easy in the first layout. Now, I 'd have to find it in the preview, then find it again in the middle of the chunk of code. If the words are repeated, common in poems, make double sure I am on the right line. Takes 3 times as long and more likely to make a mistake.


Quote:
Originally Posted by DiapDealer View Post
The good news is that Prettify is manual affair now. So if someone wanted to write their own pretty-print plugin, they could do so and forego using the built-in Prettify altogether if they wanted.

I don't have the programming chops to do that.

So when editing poetry I may revert to 0.91 because of this.

Last edited by AlanHK; 09-20-2017 at 11:28 PM.
AlanHK is offline   Reply With Quote
Old 09-20-2017, 11:32 PM   #20
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,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by AlanHK View Post
When there is an actual linebreak on screen, I can see the shape of the poem/song, etc. When as often happens, a linebreak has been lost, it's obvious when a line is twice as long as the others. That visual cue is now gone from the code view.

Also, many poems have patterns of indentation in print that I have to match with html, by inserting various space characters, alignments, etc., involving usually a fair bit of trial and error.
Hmmm... for now, couldn't you just do something like this:

Search: <br/>
Replace: <br/>/r/n

Any specific reason you aren't wrapping each line in their own <div>s or <p>s?

Code:
<div class="poem">
	<div class="stanza">
		<p class="line">The moon blue, shy</p>
		<p class="line">at first to know you now croons</p>
		<p class="line">for your childhood</p>
		<p class="line">spoon. Its edge and back</p>
		<p class="line">once sliced, mashed a world</p>
		<p class="line">into bites and paste fitful</p>
		<p class="line">for your mouth that,</p>
		<p class="line">over the years, has learned</p>
		<p class="line">&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;ab out survival,</p>
		<p class="line">though later you know</p>
		<p class="line">habits form territories, though</p>
		<p class="line">questions, not meanings,</p>
		<p class="line">remain.&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;You, no</p>
		<p class="line">longer amused by the spoon’s</p>
		<p class="line">plastic handle of faded</p>
		<p class="line">giraffes, choose to sweat</p>
		<p class="line">in Hong Kong streets, eat</p>
		<p class="line">take-outs with chopsticks</p>
		<p class="line">&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;th at do not split</p>
		<p class="line">like win-win situations.</p>
	</div>
</div>
Then you can have much better control with CSS + indentation.
Tex2002ans is offline   Reply With Quote
Old 09-21-2017, 12:01 AM   #21
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by Tex2002ans View Post
Hmmm... for now, couldn't you just do something like this:

Search: <br/>
Replace: <br/>/r/n
Was wondering how to do that in Sigil. Thanks.

Quote:
Originally Posted by Tex2002ans View Post
Any specific reason you aren't wrapping each line in their own <div>s or <p>s?

Then you can have much better control with CSS + indentation.
Denser code and harder to revise the text.

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.

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.

Last edited by AlanHK; 09-21-2017 at 12:14 AM.
AlanHK is offline   Reply With Quote
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,297
Karma: 12126329
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
Old 09-21-2017, 04:41 AM   #23
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by Tex2002ans View Post
: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:
About 80% of the poems I handle are just lines of text and no issues other than line wraps. The others get creative with indents and spaces; and take three times as long as the rest.

Every one of these is different. I'm not going to create a new style for every line of a poem that I will never use again. I hate a stylesheet cluttered with dozens of ad-hoc styles that a few days later I forget about.

I've got a few poem tags that cover the basics (left, centered, right alignment, block indent). The fripperies I do with space characters mostly.
Again, this mirrors the print layout, where I also use basic styles and space characters, so just importing the text and matching CSS/DTP styles will get me most of the way. Though I really wish CSS supported setting tab stops.

(Also, I notice examples of poems in the threads you linked used a <p> tag for the stanza and <br/> at the end of each line, and thus will fall victim to the new prettyprint.)

Quote:
instead of trying to hack together multiple &nbsp; or &emsp; at the beginning of lines.
....
Easy peasy consistent coding. And thing of all the headaches you would save your future self.
If I see an ebook with spaces to create indents on every para for 500 pages, I'll replace them with CSS.
But I do prefer hacking together spaces to indent a couple of lines one-off to hacking CSS. My future self will thank me for keeping a clean stylesheet that doesn't have an ever growing list of styles used in one poem a year ago. And I don't have to think of a dozen new style names; which often takes longer than writing the actual css.

About the only divs I use are for images, in the eternal struggle to keep captions on the same page as the image they refer to.

CSS is very elegant, but not the only or best choice in every situation.

Last edited by AlanHK; 09-21-2017 at 05:02 AM.
AlanHK is offline   Reply With Quote
Old 09-25-2017, 12:31 PM   #24
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by Tex2002ans View Post
Hmmm... for now, couldn't you just do something like this:

Search: <br/>
Replace: <br/>\r\n
Been using that (after reversing the / to \); however the escaped characters only work in Regex mode.
If you use:

Search: <br/>
Replace: <br/> [/QUOTE]

Not a space after the <br/>, but actual linebreak (in the code view, just type <br/> and then [Enter] and copy that into the "Replace", then save it as a saved search. This works in either Normal or Regex modes.
AlanHK is offline   Reply With Quote
Old 09-25-2017, 08:37 PM   #25
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,792
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
search <br\s*/> handles the ones that have a space as well as the spaceless
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to generate custom toc hounddog Conversion 0 02-20-2016 12:36 PM
How to generate a physical TOC? Books987 Conversion 2 01-24-2015 11:08 PM
html does not generate TOC iliakan Conversion 3 01-05-2015 01:56 PM
generate TOC duplicates puzzle cybmole Calibre 14 01-09-2011 07:01 PM
can't generate a toc from an html file p3aul Calibre 13 08-27-2010 05:44 AM


All times are GMT -4. The time now is 10:29 AM.


MobileRead.com is a privately owned, operated and funded community.