|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#46 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Update: The following changes have been made to the plugin(v0.1.4):
* The href ids are now more widely gathered from the following files: xhtml files, toc.ncx, opf manifest and opf guides. These href ids are then compared to existing ids/bookmarks in the xhtml files. The xhtml ids are only removed if they don't exist in the href id list. -- NCX pagelists and page-map.xml files are not supported by this plugin. If either are detected in an epub then there will be a warning with bailout. Last edited by slowsmile; 03-30-2018 at 12:50 AM. |
![]() |
![]() |
![]() |
#47 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Update: Changes to RemoveUnusedBookmarks v0.1.5
|
![]() |
![]() |
Advert | |
|
![]() |
#48 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Update: Changes to plugin(v0.1.6)
|
![]() |
![]() |
![]() |
#49 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Update: Changes to plugin(v0.1.7):
|
![]() |
![]() |
![]() |
#50 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 440
Karma: 77256
Join Date: Sep 2011
Device: none
|
Thank you very much for the update. A request: any chance there could be an option to not reformat HTML?
|
![]() |
![]() |
Advert | |
|
![]() |
#51 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@democrite...I'm not sure what you mean by "an option not to reformat the html". It's usually inevitable that the html output will always change after you run any plugin. In HTML view the output layout from the plugin looks similar to when you click Tools > Reformat HTML > Mend and prettify All HTML Files in Sgil. Can you please be more specific concerning your request or problem?
Last edited by slowsmile; 06-26-2020 at 11:19 PM. |
![]() |
![]() |
![]() |
#52 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 440
Karma: 77256
Join Date: Sep 2011
Device: none
|
I am aware that bookmarks (IDs) will be removed but the reformat like as does Sigil with the option you mention I would prefer not to have. I kind of like my EPUBs formatted a particular way and would like to keep it if possible.
|
![]() |
![]() |
![]() |
#53 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
After running the plugin, this should not effect the text in Preview. And, in Sigil, if you click on Tools > Reformat HTML > Mend and prettify... this will standardize the layout of the html. That's really the best that I can offer.
I'm afraid I disagree with your view. If you would like me to standardize html output layout from the plugin to just your liking then I do not regard that as a reasonable request. I also think that it's more reasonable for the html output layout to be standardized to the normal epub layout(i.e. the layout that you get after running mend and and prettify). Last edited by slowsmile; 07-03-2020 at 11:10 PM. |
![]() |
![]() |
![]() |
#54 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 440
Karma: 77256
Join Date: Sep 2011
Device: none
|
slowsmile,
I am not asking for my or some arbitrary standard reformating of html. If one wants to reformat, there is Sigil itself as you mention. Such a command I do not use. I format my EPUBs to my liking, making easier for me to see hierarchy and various element types as I edit, make corrections, etc. I do not use Sigil's command unless needed and easier than reformatting some commercial EPUB, such as in the case of some publishers that add intra-element line breaks in the case of line breaks at some line length as is done with programming code. I prefer no reformatting at all unless requested and done by the user. I think you use BeautifulSoup? I imagine such a mature library should be able to manipulate code while leaving it as is, just removing IDs. To repeat to be clear, no reformatting at all, just removal of IDs. If such is the case, perhaps that should even be default, as you are aware if one wishes to reformat, they can simply use Sigil. If BS is not capable of such, maybe it is more suitable to request the library to be able to do such. Your plugin is invaluable. So often, at least somewhat regularly, I have some self-made EPUB or commercial with thousands of IDs for references, footnotes, hyperlinks, etc. After ensuring that they are all properly linked, I like removing unused IDs. Does it make some difference on modern hardware? If there are 10,000+ IDs and many can be removed? Who knows. I feel good knowing performance and RAM usage is as best as can be, even if marginal. Yet maybe it does make a difference. So I use your plugin. The ability to not reformat would be a most welcome addition. Last edited by democrite; 07-10-2020 at 03:39 AM. |
![]() |
![]() |
![]() |
#55 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,783
Karma: 134321338
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
delete post
Last edited by JSWolf; 07-10-2020 at 06:50 AM. |
![]() |
![]() |
![]() |
#56 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@democrite...When I initially copy all your epub html files to be worked on by my plugin I use bk.text_iter() to fetch the files and use bk.readfile() to read the files into data. Then I run the data from each file through BeautifulSoup in the normal way. And it is there that your html layout will get changed -- it's not my plugin code that deliberately changes your html layout. And since I have no control over that, it is for that reason that I cannot "leave your html layout alone". That's also the reason why I usually always reformat the html output layout to look like it does after you run Tools > Reformat HTML > Mend and prettify... which, as I've already mentioned, helps to standardize the html output layout for each file(which most plugin users seem to prefer anyway).
Last edited by slowsmile; 07-11-2020 at 12:16 AM. |
![]() |
![]() |
![]() |
#57 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 440
Karma: 77256
Join Date: Sep 2011
Device: none
|
Thank you for the explaination. From looking around a bit, it seemed perhaps possible to use BS without it reformatting. I may look into it further someday.
Btw, since your plugin operates on bookmarks, would you consider removal of duplicate IDs within each file? If for example I use regex to add IDs to footnotes for later linking, sometimes paragraphs can be such that there are dupes. |
![]() |
![]() |
![]() |
#58 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,088
Karma: 5450184
Join Date: Nov 2009
Device: many
|
You may want to take a look at the extras in sigil_bs4 versus normal bs4.
See: https://github.com/Sigil-Ebook/Sigil...s4/__init__.py For "serialize_xhtml" near line 470 which tries to rebuild the source as close as possible to what was parsed, similar to how Sigil itself does it. |
![]() |
![]() |
![]() |
#59 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@democrite...Regarding the removal of duplicates, I doubt if you could do that automatically with a plugin because the plugin will not be able to automatically decide which duplicate IDs to remove. You could perhaps do it using a plugin via a dialog window that specifically allows you to choose the duplicate IDs for removal. But, to be honest, removing duplicate IDs is probably best achieved with a new plugin.
Last edited by slowsmile; 07-24-2020 at 12:31 AM. |
![]() |
![]() |
![]() |
#60 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 152
Karma: 474196
Join Date: Jan 2011
Location: Ottawa
Device: Kobo Aura H2O
|
Hi, thanks for creating this plugin - it really helps me clean up retail epubs that use a lot of unnecessary ids. However, I've noticed it isn't able to clean out all unused ids. For example:
Code:
<h1 id="bm4">TITLE</h1> <h2 id="bm4-s01">SECTION</h2> Anyway, I know this plugin is a bit on the old side but is there a chance this could be addressed? Alternatively, is there another similar plugin that will find these ids? Thanks in advance. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Removing plugin in Calibre removes it from all instances of Calibre | oblox | Calibre | 9 | 09-09-2016 05:39 AM |
iPad Possibility to sync bookmarks through side loaded ePubs (Any iOS software?) | andsoitgoes | Apple Devices | 12 | 04-13-2012 07:38 PM |
Modify bookmarks in epubs | silentguy | Development | 3 | 08-03-2011 05:37 PM |
Sideloaded ePubs, chapters and bookmarks | Steven Lyle Jordan | Nook Color & Nook Tablet | 10 | 02-05-2011 06:35 PM |
Problem (bug) with bookmarks in PDF plugin (2.0 RC2) | luite | iRex | 1 | 07-12-2010 02:36 AM |