02-24-2018, 02:53 AM | #1 |
Member
Posts: 11
Karma: 511654
Join Date: Feb 2018
Device: none
|
[Plugin] HTMLgen Output Plugin
Hi!
Here's this small addon: HTMLgen not sure if it will be of any help to anyone. Description Small output addon for Sigil to export the epub contents to one html file... My purpose was so I can view the text of the epub with LibreOffice+Languagecheker and check any typos with it, then fix it in the epub with Sigil... but it can be used for whatever you like Note that it's not a converter (if you want a converter use calibre or another tool). What does it do exactly? - it copies only the <body> part of all html/xhtml files, and all the css files. - it copies all fonts/images/audio/video files to a folder with the same name of the html (+ "_files"). - it makes a few changes to make the internal links work. Requirements: Any Sigil version with Python 2.7/3.4 (and tkinker* module), any OS. * If you have Python, you probably have tkinker module already, but it will warn you if you don't. Install: Like any other addon for Sigil, go to "Plugins" menu >>> Manage plugins >>> Add plugin ... and select the HTMLgen_vX.X.X.zip file. If everything it's OK, it should appear the option in Plugins >>> Output >>> HTMLgen If you click it, it will only ask you where to save the HTML, and that's all. Languages: Catalan, English, French (thanks to Arios), Galician, German (thanks to brucewelch), Italian (thanks to Auramazda), Polish (thanks to bravosx), and Spanish. If you want to, translate the text in the spoiler to your language and send me an MP, or post it here, so I can add it. Spoiler:
Thank you: Thanks to the translators (the ones in the list, and others that aren't there). Thanks to BeckyEbook for the icon. And special thanks to someone that helped me since the first private version 0.0.1 giving me some tips and advices. Thank you all! License: GNU General Public License v3 (GPL-v3) Download: See the attached file. Regards. Last edited by PeTrDu; 02-20-2019 at 05:36 AM. Reason: updated to v0.1.2 (small fix) |
02-24-2018, 03:20 AM | #2 |
null operator (he/him)
Posts: 20,954
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
FWIW - there's a Sigil plugin for Language Tools Grammar Checker ==>> [LanguageTool]: Grammar check.
BR |
Advert | |
|
02-24-2018, 04:29 AM | #3 |
Member
Posts: 11
Karma: 511654
Join Date: Feb 2018
Device: none
|
@BetterRed: I know, and that's a great addon.
But it's not the same using the Sigil Results dialog, than using LibreOffice IDE. Specially when there are a lot of messages. Just consider it as another alternative. I just wanted to try to do this and to share it, even if I'm not a good programmer. Regards |
02-24-2018, 04:54 AM | #4 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
Welcome here and thank you for this plugin!! What a great entrance. BTW it can be useful too in French where we can use Grammalecte to check odt files in LO. I'll try it. |
02-24-2018, 05:37 AM | #5 | |
null operator (he/him)
Posts: 20,954
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
I agree, alternatives are good to have, I sometimes pick up spelling inconsistencies in Sigil that I missed in Word/Writer, most especially with proper nouns. BR |
|
Advert | |
|
02-24-2018, 09:34 AM | #6 |
Grand Sorcerer
Posts: 27,965
Karma: 198535232
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Thanks for your contribution! I added this to the Sigil plugin index.
Can I ask what license you've chosen to share this under? We like to know in case plugins ever get abandoned. Last edited by DiapDealer; 02-24-2018 at 09:37 AM. |
02-24-2018, 02:37 PM | #7 |
just an egg
Posts: 1,662
Karma: 5432100
Join Date: Mar 2015
Device: Kindle, iOS
|
|
02-24-2018, 08:21 PM | #8 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
I did try it on an ePub of mine. I've got a working and very usable file I could import in LO.
- All paragraph styles merged in Textbody style. Linebreaks were rightly maintained. - The hierarchical structure of the file is maintained (h2 titles preserved). - One thing that maybe could be improved is that the endnotes links disappeared. It fits its initial and declared purpose: to allow checking the text in LO. It also can be used to quickly reformat a standard but "strangely" formatted ePub without fiddling and correcting inline styles or other quirks. YMMV It's worth a try. Thank you. Last edited by roger64; 02-24-2018 at 08:25 PM. |
02-25-2018, 08:04 AM | #9 | |
Member
Posts: 11
Karma: 511654
Join Date: Feb 2018
Device: none
|
Thank everybody for all the replies, and for the welcoming
@DiapDealer: It doesn't really matter to me, but since you ask, I think that the same License as Sigil's will be OK. In short: GPL-v3 Added to the first post. @odamizu: Thank you! I hope you find it useful somehow Thank you for testing it Quote:
Regards. |
|
02-25-2018, 08:52 AM | #10 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
I will PM you the link.
|
02-25-2018, 06:36 PM | #11 |
A curiosus lector!
Posts: 463
Karma: 2015140
Join Date: Jun 2012
Device: Sony PRS-T1, Kobo Touch
|
French translation
PeTrDu
Tanks for this Plugin. I put here the French translation you've ask so that everyone can edit it if needed. For me your plugin works well, even with the notes. Spoiler:
Last edited by Arios; 02-25-2018 at 06:48 PM. |
02-26-2018, 02:07 PM | #12 |
Zealot
Posts: 103
Karma: 10
Join Date: Jun 2014
Location: Poland, Żory
Device: Prestigio PER3464B, Onyx Lynx, Lenovo S5000 i Tab4-8"
|
Polish translation
PeTrDu please add to the plugin. [pl] htmlfile = Plik HTML saveas = Zapisz jako HTML ... copied = Kopiuj plik:% s w_nocopy = [OSTRZEŻENIE] Nie można skopiować pliku:% s langload = Załadowany język: polski notkinkr = [BŁĄD] Nie znaleziono modułu python "tkinker". pyvers = Używanie Pythona% s readmeta = Czytanie metadanych epub ... askfn = Pytanie o wyjściową nazwę pliku ... cancel = Operacja anulowana. openfn = Otwieranie pliku wyjściowego:% s e_openfn = [BŁĄD] Nie można otworzyć pliku wyjściowego. header = Przygotowanie do napisania nagłówka html ... reading = Czytanie% s ... htmsaved = Zapisano plik HTML. newfoldr = Folder został utworzony:% s w_mkdir = [OSTRZEŻENIE] Nie można utworzyć folderu wyjściowego:% s w_nodir = [OSTRZEŻENIE] Nie znaleziono folderu wyjściowego:% s timespnt = Upływający czas:% s sek. htm_warn = Plik HTML zapisany z ostrzeżeniami lub błędami. htm_ok = Plik HTML został pomyślnie zapisany. Best regards and thank you bravosx |
02-26-2018, 06:05 PM | #13 | |
Bookmaker & Cat Slave
Posts: 11,482
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Thanks for this. It saves time over merging them all! ;-) Hitch |
|
02-27-2018, 02:09 PM | #14 | |
Member
Posts: 11
Karma: 511654
Join Date: Feb 2018
Device: none
|
@roger64:
Well, after checking the epub, the only thing that I see it disappears it's the last <nav> section and its because it has the "hidden" attribute: Code:
<nav ... hidden="" ...> ... </nav> LibreOffice doesn't hide it, probably to be able to edit it. I can remove the hidden="" part, but I think it's better not to do it. If you hide something with attributes or with css styles it's for some reason, isn't it? The links works OK with any web-browser, but in LibreOffice, with the Ctrl+click to a link, some links works, other doesn't... I suppose it's a weird LibreOffice bug when it loads html files. In the end, I'm afraid there's nothing much I can do about it. I'm sorry about that. On the other hand, with the test I found out a bug: the font files weren't properly linked, it will be fixed next version. Quote:
@bravosx: Dziękuję!!! It will be added next version ---------------- to everyone: I'll wait a little bit to see if someone else wants to give me another translation, I'll release it before Saturday, so have a little patience Regards. |
|
02-27-2018, 06:52 PM | #15 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
Good to know it's a LO bug. I did not try the links on a web browser. I tried also a commercial book where only the return links were working in the odt file. For information, there is a very fine plugin in Sigil, FootnoteLinker, which has been conceived precisely to reestablish quickly broken links on an ePub. I used it once for a book with one thousand links... The hidden=" " attribute in the nav file is produced by the new Access-Aide Accessibility helper plugin. This "landmarks" part of the nav is to be machine readable only. Don't bother with this, it can be reestablished later very easily on the new ePub if need be. I found that some books use a double chapter title, I mean two successive h1 (which I don't like but I can't help). This is translated by two <h1> tags with a pagebreak between (which is a normal "clean" behaviour). It's not that easy to batch glue them together. Any advice? Edit: after further testing, this is to confirm that the major question is that LO converts this amazingly precise file to odt in a somewhat shaky way. And this part (html>odt) is 100% out of control of the plugin. To say it clearly, I was wrong to draw hasty conclusions about this plugin from the look of the odt file. Last edited by roger64; 02-28-2018 at 03:45 AM. Reason: Edit |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Conversion Output] KePub Output Plugin | jgoguen | Plugins | 566 | 08-07-2024 09:12 AM |
[Plugin] ePub3-itizer - epub3 output plugin for Sigil | KevinH | Plugins | 435 | 01-19-2023 09:46 PM |
[Plugin] KePub Output | djazz | Plugins | 35 | 12-22-2019 07:42 PM |
Plugin debug output | DiapDealer | Development | 4 | 12-04-2016 09:12 AM |
Plugin not customizable: Plugin: HTML Output does not need customization | flyingfoxlee | Conversion | 2 | 02-24-2012 02:24 AM |