View Single Post
Old 02-24-2018, 02:53 AM   #1
PeTrDu
Member
PeTrDu ought to be getting tired of karma fortunes by now.PeTrDu ought to be getting tired of karma fortunes by now.PeTrDu ought to be getting tired of karma fortunes by now.PeTrDu ought to be getting tired of karma fortunes by now.PeTrDu ought to be getting tired of karma fortunes by now.PeTrDu ought to be getting tired of karma fortunes by now.PeTrDu ought to be getting tired of karma fortunes by now.PeTrDu ought to be getting tired of karma fortunes by now.PeTrDu ought to be getting tired of karma fortunes by now.PeTrDu ought to be getting tired of karma fortunes by now.PeTrDu ought to be getting tired of karma fortunes by now.
 
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:
[en]
htmlfile=HTML file
saveas=Save as HTML...
copied=Copied file: %s
w_nocopy=[WARNING] Cannot copy the file: %s
langload=Language loaded: English
notkinkr=[ERROR] 'tkinker' python module not found.
pyvers=Using Python %s
readmeta=Reading epub metadata...
askfn=Asking for output filename...
cancel=Operation canceled.
openfn=Opening output filename: %s
e_openfn=[ERROR] Couldn't open output filename.
header=Getting ready to write the html header...
reading=Reading %s...
htmsaved=HTML file saved.
newfoldr=Folder created: %s
w_mkdir=[WARNING] Couldn't create output directory: %s
w_nodir=[WARNING] Output directory not found: %s
timespnt=Time spent: %s sec.
htm_warn=HTML file saved with warnings or errors.
htm_ok=HTML file saved successfully.


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.
Attached Files
File Type: zip HTMLgen_v0.1.2.zip (9.2 KB, 2661 views)

Last edited by PeTrDu; 02-20-2019 at 05:36 AM. Reason: updated to v0.1.2 (small fix)
PeTrDu is offline   Reply With Quote