08-11-2020, 06:08 AM | #1 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2020
Device: none
|
[Editor Plugin] Reformat plugin
This plugin simplifies, corrects and reformats books in EPUB format. It gets rid of the nested <span> and <div> tags, removes dummy paragraph classes and many more. The desired effect is an ebook in unified format, described below. Default CSS classes are contained in a special file default.css (no references added to this file in a document, it serves as a guideline and source of class definitions). The goal of this Games of Books is to use only CSS classes contained in default.css without changing book's intended appearance.
Installation Download the attached .zip file and install via Preferences->Advanced>Plugins->Load Plugin or as described in the Introduction to plugins thread. Plugin Reformat will be available in Calibre’s e-Book Editor in Plugins menu. Main Features & EPUB ebook formatting guidelines
Example of using default CSS classes: <section> <intro> <h2 class=”author”>author</h2> <h1 class=”title”>title</h1> </intro> </section> <section> <h1>Part I<h5>PartTitle</h5></h1> <center><img image.jpg></center> </section> <section> <h2>Chapter 1<h5>ChapterTitle</h5></h2> <p class=”left">paragraph</p> <p>paragraph</p> ... <center> <stanza> To be, or not to be,<br/> That is a question </stanza> </center> ... <letter> <left>Dear readers</left> <p> paragraph </p> <right>author</right> </letter> ... </section> ... <h4>THE END</h4> Version History Spoiler:
Last edited by robert.swita; 11-06-2021 at 11:29 AM. Reason: update to v2.4.0 |
08-24-2020, 05:11 AM | #2 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2020
Device: none
|
Reformat v0.9
Some corrections.
This Calibre ebook-Edit Plugin has no GUI, it's meant to be called several times (after manual corrections), until the desired effect - that is - ebook in unified epub format, described little (by an example) in default.css file. Format is maybe controversial, as it uses default and custom tags (rarely classes). TOC is generated automatically based on h1-h3 headers, except for <intro> blocks. Splitting is generated based on <section>'s or h1-h2 headers (if there are no sections yet). Last edited by robert.swita; 10-16-2020 at 03:29 AM. |
Advert | |
|
09-02-2020, 10:41 AM | #3 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2020
Device: none
|
Reformat v.095
Minor bug fixes Last edited by robert.swita; 10-16-2020 at 03:30 AM. |
09-02-2020, 11:00 AM | #4 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2020
Device: none
|
Reformat v0.95
Updated info in _init_.py Last edited by robert.swita; 10-16-2020 at 03:30 AM. |
09-13-2020, 09:59 AM | #5 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2020
Device: none
|
Reformat v1.0
Rewritten splitting (much faster now)
Last edited by robert.swita; 10-16-2020 at 10:41 AM. |
Advert | |
|
09-17-2020, 08:23 AM | #6 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2020
Device: none
|
Reformat v1.1
Fixing minor bugs, improving chapter detection heuristics
Last edited by robert.swita; 10-16-2020 at 06:35 AM. |
09-18-2020, 04:56 PM | #7 |
Resident Curmudgeon
Posts: 77,280
Karma: 138625598
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Will this be updated to work with Python 3?
|
09-19-2020, 07:56 AM | #8 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2020
Device: none
|
Reformat v1.2
This plugin should be compatible with python 2 & 3.
I've installed beta-version 4.99 of portable Calibre to check it out. It loads plugin fine, but book-editor doesn't update it's menu and debug-info doesn't help much. I've tried popular plugin ACE with the same result. Can you confirm, that attached plugin is not python 3 - compatible and point out which plugin is? (and eventually how to check it) Last edited by robert.swita; 10-16-2020 at 06:36 AM. |
09-19-2020, 08:13 AM | #9 | |
Resident Curmudgeon
Posts: 77,280
Karma: 138625598
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
09-20-2020, 05:53 PM | #10 | |
Wizard
Posts: 1,117
Karma: 1261763
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Quote:
ACE is running fine here, using calibre 4.99.17 on Windows 10. |
|
09-21-2020, 05:14 AM | #11 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2020
Device: none
|
Hi, Sorry for the alarm. Everything is working under 4.99.
Strange behavior of the editor must've been a result of co-existing with earlier version of Calibre. |
09-27-2020, 04:26 AM | #12 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2020
Device: none
|
Reformat v1.25
Minor corrections to the default.css file (see Format guidelines)
Last edited by robert.swita; 10-16-2020 at 06:36 AM. |
10-09-2020, 05:38 PM | #13 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2020
Device: none
|
Reformat v1.3
Removed bug, which could (rarely) cause loosing data inside <span>'s.
Minor fixes. Last edited by robert.swita; 10-16-2020 at 10:42 AM. |
10-09-2020, 06:32 PM | #14 |
Resident Curmudgeon
Posts: 77,280
Karma: 138625598
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Are you going to fix the first post so the plugin will be available in the plugin list in Calibre?
|
10-10-2020, 03:37 AM | #15 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2020
Device: none
|
Thank you. Didn't really know, that the posts can be edited
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Editor Plugin] EpubCheck | Doitsu | Plugins | 183 | 01-09-2025 11:38 AM |
[Editor Plugin] LanguageTool | Doitsu | Plugins | 17 | 04-20-2024 03:21 PM |
[Plugin] ReworkChapterHeads - Add, replace and reformat chapter headings | slowsmile | Plugins | 87 | 08-03-2023 06:04 AM |
[Editor Plugin] - Enabling 'Customize plugin' dialog directly from the Editor | thiago.eec | Development | 7 | 01-09-2019 09:05 PM |
Editor plugin question | DiapDealer | Development | 2 | 07-28-2014 11:23 PM |