09-20-2017, 11:54 AM | #16 |
Guru
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 :-)
|
09-20-2017, 12:36 PM | #17 |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
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> Code:
<h3>1<br/> One</h3> 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. |
09-20-2017, 04:34 PM | #18 | |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
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. |
|
09-20-2017, 10:57 PM | #19 | |||
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
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 />         about survival,<br /> though later you know<br /> habits form territories, though<br /> questions, not meanings,<br /> remain.      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 />         that do not split<br /> like win-win situations.</p> Quote:
Quote:
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. |
|||
09-20-2017, 11:32 PM | #20 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
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">        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.      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">        th at do not split</p> <p class="line">like win-win situations.</p> </div> </div> |
|
09-21-2017, 12:01 AM | #21 | ||
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
Quote:
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. |
||
09-21-2017, 03:17 AM | #22 | ||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
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:
instead of trying to hack together multiple or   at the beginning of lines. Then two simple Saved Clips: Code:
<div class="poem">\1</div> <div class="stanza">\1</div> I typically use this CSS: Spoiler:
Easy peasy consistent coding. And thing of all the headaches you would save your future self. Quote:
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. |
||
09-21-2017, 04:41 AM | #23 | ||
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
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:
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. |
||
09-25-2017, 12:31 PM | #24 | |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
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. |
|
09-25-2017, 08:37 PM | #25 |
Well trained by Cats
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
|
|
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 |