![]() |
#1 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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!! |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. ![]() |
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,724
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
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.) |
|
![]() |
![]() |
![]() |
#5 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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! |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#7 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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! |
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Quote:
I haven't written a plugin yet, that is on the agenda for next month I hope. |
|
![]() |
![]() |
![]() |
#9 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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!! |
![]() |
![]() |
![]() |
#10 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,724
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
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:
|
||
![]() |
![]() |
![]() |
#11 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#12 |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
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.
|
![]() |
![]() |
![]() |
#13 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#14 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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! |
![]() |
![]() |
![]() |
#15 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,724
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
For an example, have a look at DiapDealer's Smarten Punctuation plugin. What exactly does your plugin do? |
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |