Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-25-2013, 11:41 PM   #1
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 854
Karma: 3390310
Join Date: Jan 2013
Location: Itasca, Illinois
Device: none
0.7.1 acting different than 0.6.2

I just switched from 0.6.2 to 0.7.1 and the latter is doing things I'm not accustomed to. Like for instance when I drop down a paragraph in the Book View and then bring it back up and then look at it in code it's got new markup tags. It was just a simple <p> text </p>. And then it becomes <span style= "text-indent:1.5em;"> text </span><br /<p>

I'm thinking of going back to 0.6.2 where that sort of thing (as I recall anyway) doesn't happen.

I like the live preview window and all and would love to stay with 0.7.1 but I've also got two novels I'm almost done with (that I've been doing in 0.6.2) and I don't want to be messing them up.

I've been experimenting with it a little. It doesn't seem to matter if the automatic pretty tidy feature is on or off. But it only happens (the<span style... addition) only when I'm moving things around in Book View, never in Code.

And when I do have the pretty tidy on automatic and I say leave a bracket off the tag and go to save it, the window comes up warning me about fixing it automatically but the cursor turns to the hour glass when I hover it over "yes" or "no" not allowing me to choose.

And there is the old warning from 0.6.2. about fixing it manually or automatically when you go from code to book view.

So, with the automatic feature disabled you can save bad code but you can't look at it in book view.

I'm sure there's good reasons for all this but right now it seems a little confusing.
Any ideas?

Last edited by Gregg Bell; 03-26-2013 at 12:19 AM.
Gregg Bell is offline   Reply With Quote
Old 03-26-2013, 05:05 AM   #2
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: 9,119
Karma: 40942904
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Like for instance when I drop down a paragraph in the Book View and then bring it back up
I can't speak for others, but it doesn't seem very clear to me what you mean by the above.
DiapDealer is online now   Reply With Quote
Old 03-26-2013, 07:14 AM   #3
mrmikel
Book Twiddler
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,056
Karma: 1444487
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
I know exactly that he means. If you delete the leading tag in pretty print, in replace in 6.2 it would knock out the end tag along with the one you searched for. In 7.1 it does not. This is to not knock out the wrong tag by accident. I never did for me, but I can't blame them from wanting to do no harm.

Now you have to include the end tag in your regex search with something like <b>(.*)</b> and use \1 in the replace line, if you were trying to get rid of the <b> tag and its end tag. I am just getting used to this myself, so I think that is right, but don't shoot me if I am wrong.

This results in repeated searches for me. meme said he was going to look at this sort of thing, but it didn't seem a high priority for them.
mrmikel is offline   Reply With Quote
Old 03-26-2013, 08:17 AM   #4
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: 9,119
Karma: 40942904
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Well I understand what you're saying plain enough, just not how you got there from "drop down a paragraph in the Book View and then bring it back up." How could he search for (and delete with a Replace) a leading tag in Book View?

Last edited by DiapDealer; 03-26-2013 at 08:21 AM.
DiapDealer is online now   Reply With Quote
Old 03-26-2013, 09:20 AM   #5
theducks
Grand Sorcerer
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: 14,699
Karma: 5643643
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
If you 'Join' a paragraph in BV ( at the end of the Paragraph: tap Del, Then tap <space> )this will happen in 7.x

Here is my cleanup saved REGEX search:
Code:
(?sm)&nbsp;(<span style=".+?">)(.+?)</span>
Code:
 \2
theducks is offline   Reply With Quote
Old 03-26-2013, 09:49 AM   #6
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: 9,119
Karma: 40942904
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Just one more reason to never do anything in Book View besides look at things, I guess.
DiapDealer is online now   Reply With Quote
Old 03-26-2013, 10:08 AM   #7
theducks
Grand Sorcerer
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: 14,699
Karma: 5643643
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by DiapDealer View Post
Just one more reason to never do anything in Book View besides look at things, I guess.
The nbsp thing would not be so bad, but it ALWAYS does a font size change.

BTW
Warning: If you use inline Style=, Don't use 'Replace All'
I made the search very general because the order of the style elements varies.
theducks is offline   Reply With Quote
Old 03-26-2013, 01:51 PM   #8
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 854
Karma: 3390310
Join Date: Jan 2013
Location: Itasca, Illinois
Device: none
I figured it out a bit.

Thanks for the feedback everybody. It seems (all this in BookView) that when I drop some paragraphs down (by having the cursor at the indent point, of the first paragraph I want to drop down, and hitting the enter key), the Code view thinks I want line breaks and so puts <p><br /></p> there. And when I put the cursor at the indent point of where I first started from and hit delete to bring the paragraphs back up, the Code changes what was a simple <p> tag to <p><br /></p> and its corresponding closing tag </span><br /></p>. Interestingly, if I want to bring the paragraphs up and keep the cursor at the end of the last line and hit the delete key, all the paragraphs come up and the simple <p> tag is there and life is as it should be and all is well in the Universe.
Gregg Bell is offline   Reply With Quote
Old 03-26-2013, 02:10 PM   #9
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
At least in the newest version, if you hit return a few times in Book View you will end up with a few <p><br /></p>. If you then delete one of these empty lines, they get deleted completely, so no <br /> is left. It will be left if there is something else in the line.

The hourglass showing on the dialog will be fixed in the next version.

With regards to your comment about style appearing when you delete, this is because the Book View editor is trying to retain the formatting you've given the paragraphs, even if this is a bit annoying. This has nothing to do with Pretty Print or Tidy. I think it's worth showing what is happening:

In this particular case, say you have this:

Code:
<p>Line one.</p>
<p>Line two.</p>
In Book View, if you put your cursor at the end of the first line ("Line one.") then hit Delete, you will see this in Code View:

Code:
<p>Line one.Line two.</p>
Which is what you expect.

But if you start with this:

Code:
<p>Line one.</p>
<p class="test">Line two.</p>
and the class "test" is defined in your stylesheet as "font-weight: bold"

then in Book View put your cursor at the end of "Line one." and hit Delete, you will see this in Code View:

Code:
<p>Line one.<span style="font-weight: bold;">Line two.</span></p>
This is because the first paragraph had no styling/class, but the second paragraph did. When the editor merged the two it tries to keep the styling of the second paragraph and can only do this by using a span and the styles that were defined for the original paragraph.

It cannot just use span class="test" because that class might not apply to a span, only to a paragraph. Although if the class "test" isn't actually defined or linked to this page then you end up with the first case where no span is added. And if both paragraphs had a class of "test" (i.e. the exact same styling), then the second would be merged without the span being added since it knows they are the same.

I guess it could ignore the styling of the second paragraph when merging which I think would be simpler for most people to deal with - but that might cause other issues - and anyway we have no control over that - it's part of Qt.


Working in Book View is easy to start with, but once you learn about Code View and tags and you want full control over what is going on it can be pretty annoying. If you are going to write in Book View you will have to accept what it gives you, or as pointed out above, develop a few common Save Searches to correct the parts that bother you - but use them carefully. I'm always using Book View even though I always try not to - so I end up having to search through for extra <br /> tags, style attributes, nbsp characters, etc.

Sigil wasn't really designed to write books from scratch. It was meant to update formatting, etc. - which is best done in Code View, perhaps with the help of Preview. Of course, it can be used to write and correct text in Book View quite easily, but there is a trade-off for using it.
meme is offline   Reply With Quote
Old 03-26-2013, 09:35 PM   #10
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 854
Karma: 3390310
Join Date: Jan 2013
Location: Itasca, Illinois
Device: none
thanks

Quote:
Originally Posted by meme View Post
At least in the newest version, if you hit return a few times in Book View you will end up with a few <p><br /></p>. If you then delete one of these empty lines, they get deleted completely, so no <br /> is left. It will be left if there is something else in the line.

The hourglass showing on the dialog will be fixed in the next version.

With regards to your comment about style appearing when you delete, this is because the Book View editor is trying to retain the formatting you've given the paragraphs, even if this is a bit annoying. This has nothing to do with Pretty Print or Tidy. I think it's worth showing what is happening:

In this particular case, say you have this:

Code:
<p>Line one.</p>
<p>Line two.</p>
In Book View, if you put your cursor at the end of the first line ("Line one.") then hit Delete, you will see this in Code View:

Code:
<p>Line one.Line two.</p>
Which is what you expect.

But if you start with this:

Code:
<p>Line one.</p>
<p class="test">Line two.</p>
and the class "test" is defined in your stylesheet as "font-weight: bold"

then in Book View put your cursor at the end of "Line one." and hit Delete, you will see this in Code View:

Code:
<p>Line one.<span style="font-weight: bold;">Line two.</span></p>
This is because the first paragraph had no styling/class, but the second paragraph did. When the editor merged the two it tries to keep the styling of the second paragraph and can only do this by using a span and the styles that were defined for the original paragraph.

It cannot just use span class="test" because that class might not apply to a span, only to a paragraph. Although if the class "test" isn't actually defined or linked to this page then you end up with the first case where no span is added. And if both paragraphs had a class of "test" (i.e. the exact same styling), then the second would be merged without the span being added since it knows they are the same.

I guess it could ignore the styling of the second paragraph when merging which I think would be simpler for most people to deal with - but that might cause other issues - and anyway we have no control over that - it's part of Qt.


Working in Book View is easy to start with, but once you learn about Code View and tags and you want full control over what is going on it can be pretty annoying. If you are going to write in Book View you will have to accept what it gives you, or as pointed out above, develop a few common Save Searches to correct the parts that bother you - but use them carefully. I'm always using Book View even though I always try not to - so I end up having to search through for extra <br /> tags, style attributes, nbsp characters, etc.

Sigil wasn't really designed to write books from scratch. It was meant to update formatting, etc. - which is best done in Code View, perhaps with the help of Preview. Of course, it can be used to write and correct text in Book View quite easily, but there is a trade-off for using it.
Thanks meme. I, since this thread began, have switched to doing all the editing in code so I'm cool with this. But I'm not so sure if I get your explanation of what happens. I say this because when I did my Book View thing, it was in the middle of ordinary paragraphs, just regular p tags. I even did your "Line one. Line two" experiment and in the middle of regular paragraphs and it gave me the <span style="text-indent:1.5em;"> text </span></p> deal. I've enclosed a screenshot.

Now, my external style sheet is for text indent of 1.5em if that sheds any light on things.

And how do I get around the hourglass thing?

Thanks a lot for your input on this. It's very helpful.
Attached Files
File Type: doc ptagexperiment.doc (144.0 KB, 36 views)
Gregg Bell is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
K3 My kindle is acting up..... qlob Kindle Developer's Corner 43 09-20-2012 07:21 AM
Menu button acting up canezila enTourage Archive 6 02-18-2011 03:53 PM
Font's Acting Weird... Philippe Lemay Calibre 0 09-05-2010 01:24 AM
Highlighter acting screwy rakista enTourage Archive 1 06-04-2010 12:48 PM
My DX is acting up. Again. Scott Nielsen Amazon Kindle 4 02-27-2010 02:33 PM


All times are GMT -4. The time now is 08:36 AM.


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