View Single Post
Old 04-29-2025, 11:18 PM   #1
yrings
Junior Member
yrings began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Apr 2025
Device: kindle scribe
Calibre - convert html to epub

I'm trying to convert this project gutenberg html to epub (they have their own, but I didn't like some formatting stuff - I'll probably just use theirs b/c I can't figure this out).
I assumed that nothing would be easier than converting html to epub - epub is already basically html. But - when I import the html (gui) and view / convert - I see HTML. It doesn't parse the HTML. I tried setting the html to zip encoding setting, didn't change anything.
I tried converting using the command line - it seemed to be parsing, but crashed because it couldn't split up the html file into small parts, and I couldn't figure out how to tell it "use the h2 tags!"

I first tried with an older version (I think 6.something) before downloading the latest (is it 8.3?)

So -

1 - how can I convert html to epub using the GUI?
2 - how can I tell the cli to split the epub parts based on h2 tags?
Spoiler:


~/calibre-bin/calibre/ebook-convert ./sholom_aleichim\ jewish\ children.html sholom.epub --chapter-mark pagebreak --level1-toc "h2"

Conversion options changed from defaults:
level1_toc: 'h2'
1% Converting input to HTML...
InputFormatPlugin: HTML Input running
on /home/username/Downloads/sholom_aleichim jewish children.html
Language not specified
Creator not specified
Building file list...
Normalizing filename cases
Rewriting HTML links
34% Running transforms on e-book...
Merging user specified metadata...
Detecting structure...
Auto generated TOC with 0 entries.
Flattening CSS and remapping font sizes...
Stylesheet 'resource://content-accessible/viewsource.css' referenced by file 'sholom_aleichim%20jewish%20children.html' not in manifest
Source base font size is 12.00000pt
Removing fake margins...
Cleaning up manifest...
Trimming unused files from manifest...
Creating EPUB Output...
67% Running EPUB Output plugin
Splitting markup on page breaks and flow limits, if any...
Looking for large trees in sholom_aleichim%20jewish%20children.html...
Found large tree #0
Traceback (most recent call last):
File "runpy.py", line 198, in _run_module_as_main
File "runpy.py", line 88, in _run_code
File "site.py", line 47, in <module>
File "site.py", line 43, in main
File "calibre/ebooks/conversion/cli.py", line 429, in main
File "calibre/ebooks/conversion/plumber.py", line 1267, in run
File "calibre/ebooks/conversion/plugins/epub_output.py", line 225, in convert
File "calibre/ebooks/oeb/transforms/split.py", line 69, in __call__
File "calibre/ebooks/oeb/transforms/split.py", line 78, in split_item
File "calibre/ebooks/oeb/transforms/split.py", line 227, in __init__
File "calibre/ebooks/oeb/transforms/split.py", line 359, in split_to_size
File "calibre/ebooks/oeb/transforms/split.py", line 352, in split_to_size
calibre.ebooks.oeb.transforms.split.SplitError: Could not find reasonable point at which to split: sholom_aleichim%20jewish%20children.html Sub-tree size: 716 KB

Last edited by theducks; 04-29-2025 at 11:59 PM. Reason: SPOILER LOG files
yrings is offline   Reply With Quote