Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-22-2014, 03:33 PM   #1
kbanelas
Member
kbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheese
 
Posts: 13
Karma: 1000
Join Date: Oct 2014
Device: bq cervantes
About "remove formatting"

Hi!!
I'm glad to use Sigil, it's a very good application. But, there is always a but...
If you want a html text clean, Sigil has an option for this business, but this option also removes for example, the italic and bold marks, or the marks of ordered list. I think this is a bless, but it could be your curse.
Perhaps this "remove formatting" option is excessive in all cases.
Perhaps an option that let you choose whether remove these marks in the html code would be a good idea. An option where shall the html code simplify but not so wildly.
Cheers!!
kbanelas is offline   Reply With Quote
Old 10-22-2014, 04:13 PM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Clean is clean. If you want clean html with formatting, ensure that the source is clean.
Toxaris is offline   Reply With Quote
Old 10-22-2014, 04:29 PM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Which arbitrary definition of what should be kept should we use???

Perhaps you'd like to write a highly-configurable Sigil plugin to do this specialized job.
eschwartz is offline   Reply With Quote
Old 10-23-2014, 02:02 AM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,725
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by kbanelas View Post
Perhaps an option that let you choose whether remove these marks in the html code would be a good idea. An option where shall the html code simplify but not so wildly.
Simply select Pretty Print Tidy (Edit > Preferences > Clean Source > Pretty Print Tidy) and nothing will be changed. (The code will only be reformatted.)

If you have specific ideas about what should be changed, have a look at the Saved Searches help topic.

(Saved Searches allows you to run a group of search and replace actions.)
Doitsu is offline   Reply With Quote
Old 10-23-2014, 03:00 AM   #5
kbanelas
Member
kbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheese
 
Posts: 13
Karma: 1000
Join Date: Oct 2014
Device: bq cervantes
Ei, hello!!

Thanks for your answers.

Toxaris, I don't know what application should I use as source to get more clean html code. I'm usually patient, and I write step by step all the code but this is very very slow. Copying from an application (that I know) and pasting to Sigil, the html code is not much clean.

eschwartz, I don't ask a mega-configurable plugin, I'm only saying, in this comment, that Sigil could have an option that cleans the code but keeping the bold, italic or underline tags. All this for gain time.

Doitsu, ok, I'm having a look at the Saved Searches help.

Thanks again for your time.

Cheers!
kbanelas is offline   Reply With Quote
Old 10-23-2014, 03:12 AM   #6
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by kbanelas View Post
Toxaris, I don't know what application should I use as source to get more clean html code. I'm usually patient, and I write step by step all the code but this is very very slow. Copying from an application (that I know) and pasting to Sigil, the html code is not much clean.
What is the application? Copy and pasting is usually not a very good way to get content into Sigil, although sometimes it works just fine.

What you can do of course, is first with some good regex replace the formatting you want to keep into markers, remove formatting and then replace the markers back to the formatting. If you combine the regex in the saved searches, you can execute all replacements in one go.
Toxaris is offline   Reply With Quote
Old 10-23-2014, 12:29 PM   #7
kbanelas
Member
kbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheese
 
Posts: 13
Karma: 1000
Join Date: Oct 2014
Device: bq cervantes
Toxaris, excuse me, I'm not an usual English speaker but I'm doing everything what I can.

Ok guys!!

I'm going to do a plugin... I'm already reading a python tutorial...
But I think that I will need a bit of help...hehe

Seriously, I have wrote a Python script but Sigil say: Error, plugin not a valid sigil plugin.
I have compared with another plugin and I don't know what happens, because my plugin is a zip with 3 files (.sh,.bat and .py) and everything looks like correct.

After I have proved the reference plugin and oops!! it also doesn't work... but I'm sure it worked because I have read more plugins with the same structure.

I'm using Sigil 0.8.1.

How can I know the right structure for my plugin?

Thanks and cheers!
kbanelas is offline   Reply With Quote
Old 10-23-2014, 02:04 PM   #8
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by kbanelas View Post
Toxaris, excuse me, I'm not an usual English speaker but I'm doing everything what I can.
Not quite sure what you were thinking I was saying here... I was just asking what the application was you have your source in/copied from.

I haven't written a plugin yet, that is on the agenda for next month I hope.
Toxaris is offline   Reply With Quote
Old 10-23-2014, 03:41 PM   #9
kbanelas
Member
kbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheese
 
Posts: 13
Karma: 1000
Join Date: Oct 2014
Device: bq cervantes
Hi!!
Ei, Toxaris don't worry.
I effectively understood what does application mean? and I thought that application isn't an english term, and nothing else.
Don't worry be happy!!
I hope that your plugin be better than mine because the mine doesn't work... for the moment... hehe

Regards!!
kbanelas is offline   Reply With Quote
Old 10-23-2014, 06:44 PM   #10
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,725
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by kbanelas View Post
Seriously, I have wrote a Python script but Sigil say: Error, plugin not a valid sigil plugin.
I have compared with another plugin and I don't know what happens, because my plugin is a zip with 3 files (.sh,.bat and .py) and everything looks like correct.
Did you look at Calibre plugins by any chance? Sigil plugins don't use shell scripts or batch files. However, each of them must contain at least two files:

plugin.py (contains the code)
plugin.xml (contains the description)

I've attached a very simple proof-of-concept plugin that only displays 'Hello World'. If it doesn't work on your machine, you're most likely using a custom Linux build or accidentally moved or deleted the Plugin Runner Python files.

Quote:
Originally Posted by kbanelas View Post
After I have proved the reference plugin and oops!! it also doesn't work... but I'm sure it worked because I have read more plugins with the same structure.
How can I know the right structure for my plugin?
The plugin structure is explained in the Plugin Framework Guide.
Attached Files
File Type: zip hello.zip (794 Bytes, 110 views)
Doitsu is offline   Reply With Quote
Old 10-24-2014, 03:09 AM   #11
kbanelas
Member
kbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheese
 
Posts: 13
Karma: 1000
Join Date: Oct 2014
Device: bq cervantes
Hi Doitsu!!

Thanks a lot for the information!!
I will try to do this plugin, I hope!
Regards
kbanelas is offline   Reply With Quote
Old 10-24-2014, 06:59 AM   #12
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
Quote:
Originally Posted by kbanelas View Post
I don't know what application should I use as source to get more clean html code.
As others have said, that depends on what software you're using. If you write in Microsoft Word, you can turn it into very good html by pasting the Word doc into word2cleanhtml dot com online. Then open (don't paste!) the clean html in Sigil. This is what I do, and I'm not very good about using Word styles--I mostly just hack away, but word2cleanhtml does wonders with it.
Notjohn is offline   Reply With Quote
Old 10-24-2014, 07:37 AM   #13
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
I use my add-in for Word of course. It will even create an ePUB for you from a Word document and give a lot of other tool goodies. And, the code is clean.
Toxaris is offline   Reply With Quote
Old 10-24-2014, 02:21 PM   #14
kbanelas
Member
kbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheesekbanelas can extract oil from cheese
 
Posts: 13
Karma: 1000
Join Date: Oct 2014
Device: bq cervantes
Hi!!
Ei guys!! Thanks for your comments!!
But I don't use Word for my texts!! I always use Write.
On the other hand, I have wrote a Python script which works quite well and I only need resolve one question:
How can I open/write the current open file? I have read the Plugin Framework Guide and I haven't found something specific about it and I'm something lost.
I'm sure you can help me!
Cheers!
kbanelas is offline   Reply With Quote
Old 10-24-2014, 03:46 PM   #15
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,725
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by kbanelas View Post
How can I open/write the current open file? I have read the Plugin Framework Guide and I haven't found something specific about it and I'm something lost.
AFAIK, you can't detect the current file, you'll either have to write a file selection dialog and select the files that you want to change or apply your code to all .html files.

For an example, have a look at DiapDealer's Smarten Punctuation plugin.

What exactly does your plugin do?
Doitsu is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dealing with bad formatting: "broken" lines inside paragraphs? MelBr Calibre 5 08-26-2013 12:10 AM
Try to remove : This item was downloaded by caliber from .... and "Section Menu", "Ma poulardalber Recipes 4 08-21-2012 05:23 AM
How to remove "Fully read" books from "Last Open" list? pjeanetta PocketBook 4 12-08-2010 10:30 AM
PRS-600 "Internal content invalid. Formatting" 600 crash (is it dead ?) zelda_pinwheel Sony Reader 93 02-18-2010 05:27 PM


All times are GMT -4. The time now is 11:53 PM.


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