I recently started getting errors when I attempt to convert an ePub to HTMLZ format. It seems to be a fairly recent regression; I have a copy of my epub collection in an external drive (under Portable Calibre, which was updated just before Christmas), and it works fine there.
Right. OK, let's see:
1. The file. Actually, it has happening to *any* ePub I try, but for the sake of argument, I'll use as example a file I downloaded from Standard Ebooks -- that would be the first Sherlock Holmes novel, "A Study in Scarlet" (compatible ePub version), which can be downloaded free from here: https://standardebooks.org/ebooks/ar...udy-in-scarlet
2. The log:
Spoiler:
calibre, version 5.10.1 (win32, embedded-python: True)
Conversion error: Failed: Convert book 1 of 1 (A Study in Scarlet)
Convert book 1 of 1 (A Study in Scarlet)
Integration status: True
Failed to initialize plugin: 'C:\\Users\\MCBastos\\AppData\\Roaming\\calibre\\p lugins\\KoboBooks.zip'
Failed to initialize plugin: 'C:\\Users\\MCBastos\\AppData\\Roaming\\calibre\\p lugins\\Webscription.zip'
Conversion options changed from defaults:
htmlz_class_style: 'inline'
read_metadata_from_opf: 'C:\\Users\\MCBastos\\AppData\\Local\\Temp\\calibr e_xsjce6sb\\8o3mnhc0.opf'
cover: 'C:\\Users\\MCBastos\\AppData\\Local\\Temp\\calibr e_xsjce6sb\\gmrwjsex.jpeg'
htmlz_title_filename: True
verbose: 2
Resolved conversion options
calibre version: 5.10.1
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0.0,
'book_producer': None,
'change_justification': 'original',
'chapter': "//*[((name()='h1' or name()='h2') and re:test(., "
"'\\s*((chapter|book|section|part)\\s+)|((prolog|p rologue|epilogue)(\\s+|$))', "
"'i')) or @class = 'chapter']",
'chapter_mark': 'pagebreak',
'comments': None,
'cover': 'C:\\Users\\MCBastos\\AppData\\Local\\Temp\\calibr e_xsjce6sb\\gmrwjsex.jpeg',
'debug_pipeline': None,
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'duplicate_links_in_toc': False,
'embed_all_fonts': False,
'embed_font_family': None,
'enable_heuristics': False,
'expand_css': False,
'extra_css': None,
'filter_css': '',
'fix_indents': True,
'font_size_mapping': None,
'format_scene_breaks': True,
'html_unwrap_factor': 0.4,
'htmlz_class_style': 'inline',
'htmlz_css_type': 'class',
'htmlz_title_filename': True,
'input_encoding': None,
'input_profile': ,
'insert_blank_line': False,
'insert_blank_line_size': 0.5,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': False,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0.0,
'linearize_tables': False,
'margin_bottom': 5.0,
'margin_left': 5.0,
'margin_right': 5.0,
'margin_top': 5.0,
'markup_chapter_headings': True,
'max_toc_links': 50,
'minimum_line_height': 120.0,
'no_chapters_in_toc': False,
'no_inline_navbars': False,
'output_profile': ,
'page_breaks_before': '/',
'prefer_metadata_cover': False,
'pretty_print': False,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': 'C:\\Users\\MCBastos\\AppData\\Local\\Temp\\calibr e_xsjce6sb\\8o3mnhc0.opf',
'remove_fake_margins': True,
'remove_first_image': False,
'remove_paragraph_spacing': False,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': '',
'search_replace': '[]',
'series': None,
'series_index': None,
'smarten_punctuation': False,
'sr1_replace': None,
'sr1_search': None,
'sr2_replace': None,
'sr2_search': None,
'sr3_replace': None,
'sr3_search': None,
'start_reading_at': None,
'subset_embedded_fonts': False,
'tags': None,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'transform_css_rules': '[]',
'unsmarten_punctuation': False,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
InputFormatPlugin: EPUB Input running
on C:\Users\MCBastos\AppData\Local\Temp\calibre_xsjce 6sb\zde5scut.epub
Parsing all content...
Parsing epub/text/chapter-1-4.xhtml ...
Parsing epub/text/chapter-2-7.xhtml ...
Parsing epub/toc.xhtml ...
Parsing epub/css/se.css ...
CSSStylesheet: Unknown @rule found. [103:1: @supports]
Parsing epub/text/chapter-2-2.xhtml ...
Parsing epub/text/imprint.xhtml ...
Parsing epub/text/chapter-1-2.xhtml ...
Parsing epub/text/chapter-1-6.xhtml ...
Parsing epub/text/chapter-2-5.xhtml ...
Parsing epub/text/titlepage.xhtml ...
Parsing epub/css/core.css ...
Parsing epub/css/local.css ...
Parsing epub/text/chapter-1-7.xhtml ...
Parsing epub/text/colophon.xhtml ...
Parsing epub/text/chapter-2-3.xhtml ...
Parsing epub/text/part-1.xhtml ...
Parsing epub/text/chapter-1-3.xhtml ...
Parsing epub/text/chapter-2-6.xhtml ...
Parsing epub/text/uncopyright.xhtml ...
Parsing epub/text/chapter-2-1.xhtml ...
Parsing epub/text/endnotes.xhtml ...
Parsing epub/text/chapter-2-4.xhtml ...
Parsing epub/text/chapter-1-1.xhtml ...
Parsing epub/text/chapter-1-5.xhtml ...
Parsing epub/text/part-2.xhtml ...
Reading TOC from NCX...
Merging user specified metadata...
Detecting structure...
Detected chapter: Part I
Detected chapter: Part II
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 13 items of level: p_2
Found 783 items of level: p_3
Found 3 items of level: p_5
Found 6 items of level: p_4
Ignoring level p_5
Ignoring level p_2
Ignoring level p_4
p_3 left margin stats: Counter({'0': 782, 'auto': 1})
p_3 right margin stats: Counter({'0': 782, 'auto': 1})
Cleaning up manifest...
Trimming unused files from manifest...
Trimming 'epub/toc.ncx' from manifest
Trimming 'epub/toc.xhtml' from manifest
Creating HTMLZ Output...
Converting OEB book to HTML...
Converting epub/text/titlepage.xhtml to HTML...
Converting epub/text/imprint.xhtml to HTML...
Converting epub/text/part-1.xhtml to HTML...
Converting epub/text/chapter-1-1.xhtml to HTML...
Converting epub/text/chapter-1-2.xhtml to HTML...
Converting epub/text/chapter-1-3.xhtml to HTML...
Converting epub/text/chapter-1-4.xhtml to HTML...
Converting epub/text/chapter-1-5.xhtml to HTML...
Converting epub/text/chapter-1-6.xhtml to HTML...
Converting epub/text/chapter-1-7.xhtml to HTML...
Converting epub/text/part-2.xhtml to HTML...
Converting epub/text/chapter-2-1.xhtml to HTML...
Converting epub/text/chapter-2-2.xhtml to HTML...
Converting epub/text/chapter-2-3.xhtml to HTML...
Converting epub/text/chapter-2-4.xhtml to HTML...
Converting epub/text/chapter-2-5.xhtml to HTML...
Converting epub/text/chapter-2-6.xhtml to HTML...
Converting epub/text/chapter-2-7.xhtml to HTML...
Converting epub/text/endnotes.xhtml to HTML...
Converting epub/text/colophon.xhtml to HTML...
Converting epub/text/uncopyright.xhtml to HTML...
Traceback (most recent call last):
File "runpy.py", line 194, in _run_module_as_main
File "runpy.py", line 87, in _run_code
File "site.py", line 82, in
File "site.py", line 77, in main
File "site.py", line 49, in run_entry_point
File "calibre\utils\ipc\worker.py", line 216, in main
File "calibre\gui2\convert\gui_conversion.py", line 41, in gui_convert_override
File "calibre\gui2\convert\gui_conversion.py", line 28, in gui_convert
File "calibre\ebooks\conversion\plumber.py", line 1274, in run
File "calibre\ebooks\conversion\plugins\htmlz_output.py ", line 78, in convert
File "calibre\ebooks\htmlz\oeb2html.py", line 57, in oeb2html
File "calibre\ebooks\htmlz\oeb2html.py", line 342, in mlize_spine
TypeError: can only concatenate str (not "bytes") to str
3. The output file: none
4. Conversion aborts with a big red error saying "Failed: Convert Book 1 of 1 (A Study in Scarlet)" -- details below (seems to me to be a copy of the log, but I'm posting it anyway)
Spoiler:
Convert book 1 of 1 (A Study in Scarlet)
Integration status: True
Failed to initialize plugin: 'C:\\Users\\MCBastos\\AppData\\Roaming\\calibre\\p lugins\\KoboBooks.zip'
Failed to initialize plugin: 'C:\\Users\\MCBastos\\AppData\\Roaming\\calibre\\p lugins\\Webscription.zip'
Conversion options changed from defaults:
htmlz_class_style: 'inline'
read_metadata_from_opf: 'C:\\Users\\MCBastos\\AppData\\Local\\Temp\\calibr e_xsjce6sb\\8o3mnhc0.opf'
cover: 'C:\\Users\\MCBastos\\AppData\\Local\\Temp\\calibr e_xsjce6sb\\gmrwjsex.jpeg'
htmlz_title_filename: True
verbose: 2
Resolved conversion options
calibre version: 5.10.1
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0.0,
'book_producer': None,
'change_justification': 'original',
'chapter': "//*[((name()='h1' or name()='h2') and re:test(., "
"'\\s*((chapter|book|section|part)\\s+)|((prolog|p rologue|epilogue)(\\s+|$))', "
"'i')) or @class = 'chapter']",
'chapter_mark': 'pagebreak',
'comments': None,
'cover': 'C:\\Users\\MCBastos\\AppData\\Local\\Temp\\calibr e_xsjce6sb\\gmrwjsex.jpeg',
'debug_pipeline': None,
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'duplicate_links_in_toc': False,
'embed_all_fonts': False,
'embed_font_family': None,
'enable_heuristics': False,
'expand_css': False,
'extra_css': None,
'filter_css': '',
'fix_indents': True,
'font_size_mapping': None,
'format_scene_breaks': True,
'html_unwrap_factor': 0.4,
'htmlz_class_style': 'inline',
'htmlz_css_type': 'class',
'htmlz_title_filename': True,
'input_encoding': None,
'input_profile': ,
'insert_blank_line': False,
'insert_blank_line_size': 0.5,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': False,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0.0,
'linearize_tables': False,
'margin_bottom': 5.0,
'margin_left': 5.0,
'margin_right': 5.0,
'margin_top': 5.0,
'markup_chapter_headings': True,
'max_toc_links': 50,
'minimum_line_height': 120.0,
'no_chapters_in_toc': False,
'no_inline_navbars': False,
'output_profile': ,
'page_breaks_before': '/',
'prefer_metadata_cover': False,
'pretty_print': False,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': 'C:\\Users\\MCBastos\\AppData\\Local\\Temp\\calibr e_xsjce6sb\\8o3mnhc0.opf',
'remove_fake_margins': True,
'remove_first_image': False,
'remove_paragraph_spacing': False,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': '',
'search_replace': '[]',
'series': None,
'series_index': None,
'smarten_punctuation': False,
'sr1_replace': None,
'sr1_search': None,
'sr2_replace': None,
'sr2_search': None,
'sr3_replace': None,
'sr3_search': None,
'start_reading_at': None,
'subset_embedded_fonts': False,
'tags': None,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'transform_css_rules': '[]',
'unsmarten_punctuation': False,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
InputFormatPlugin: EPUB Input running
on C:\Users\MCBastos\AppData\Local\Temp\calibre_xsjce 6sb\zde5scut.epub
Parsing all content...
Parsing epub/text/chapter-1-4.xhtml ...
Parsing epub/text/chapter-2-7.xhtml ...
Parsing epub/toc.xhtml ...
Parsing epub/css/se.css ...
CSSStylesheet: Unknown @rule found. [103:1: @supports]
Parsing epub/text/chapter-2-2.xhtml ...
Parsing epub/text/imprint.xhtml ...
Parsing epub/text/chapter-1-2.xhtml ...
Parsing epub/text/chapter-1-6.xhtml ...
Parsing epub/text/chapter-2-5.xhtml ...
Parsing epub/text/titlepage.xhtml ...
Parsing epub/css/core.css ...
Parsing epub/css/local.css ...
Parsing epub/text/chapter-1-7.xhtml ...
Parsing epub/text/colophon.xhtml ...
Parsing epub/text/chapter-2-3.xhtml ...
Parsing epub/text/part-1.xhtml ...
Parsing epub/text/chapter-1-3.xhtml ...
Parsing epub/text/chapter-2-6.xhtml ...
Parsing epub/text/uncopyright.xhtml ...
Parsing epub/text/chapter-2-1.xhtml ...
Parsing epub/text/endnotes.xhtml ...
Parsing epub/text/chapter-2-4.xhtml ...
Parsing epub/text/chapter-1-1.xhtml ...
Parsing epub/text/chapter-1-5.xhtml ...
Parsing epub/text/part-2.xhtml ...
Reading TOC from NCX...
Merging user specified metadata...
Detecting structure...
Detected chapter: Part I
Detected chapter: Part II
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 13 items of level: p_2
Found 783 items of level: p_3
Found 3 items of level: p_5
Found 6 items of level: p_4
Ignoring level p_5
Ignoring level p_2
Ignoring level p_4
p_3 left margin stats: Counter({'0': 782, 'auto': 1})
p_3 right margin stats: Counter({'0': 782, 'auto': 1})
Cleaning up manifest...
Trimming unused files from manifest...
Trimming 'epub/toc.ncx' from manifest
Trimming 'epub/toc.xhtml' from manifest
Creating HTMLZ Output...
Converting OEB book to HTML...
Converting epub/text/titlepage.xhtml to HTML...
Converting epub/text/imprint.xhtml to HTML...
Converting epub/text/part-1.xhtml to HTML...
Converting epub/text/chapter-1-1.xhtml to HTML...
Converting epub/text/chapter-1-2.xhtml to HTML...
Converting epub/text/chapter-1-3.xhtml to HTML...
Converting epub/text/chapter-1-4.xhtml to HTML...
Converting epub/text/chapter-1-5.xhtml to HTML...
Converting epub/text/chapter-1-6.xhtml to HTML...
Converting epub/text/chapter-1-7.xhtml to HTML...
Converting epub/text/part-2.xhtml to HTML...
Converting epub/text/chapter-2-1.xhtml to HTML...
Converting epub/text/chapter-2-2.xhtml to HTML...
Converting epub/text/chapter-2-3.xhtml to HTML...
Converting epub/text/chapter-2-4.xhtml to HTML...
Converting epub/text/chapter-2-5.xhtml to HTML...
Converting epub/text/chapter-2-6.xhtml to HTML...
Converting epub/text/chapter-2-7.xhtml to HTML...
Converting epub/text/endnotes.xhtml to HTML...
Converting epub/text/colophon.xhtml to HTML...
Converting epub/text/uncopyright.xhtml to HTML...
Traceback (most recent call last):
File "runpy.py", line 194, in _run_module_as_main
File "runpy.py", line 87, in _run_code
File "site.py", line 82, in
File "site.py", line 77, in main
File "site.py", line 49, in run_entry_point
File "calibre\utils\ipc\worker.py", line 216, in main
File "calibre\gui2\convert\gui_conversion.py", line 41, in gui_convert_override
File "calibre\gui2\convert\gui_conversion.py", line 28, in gui_convert
File "calibre\ebooks\conversion\plumber.py", line 1274, in run
File "calibre\ebooks\conversion\plugins\htmlz_output.py ", line 78, in convert
File "calibre\ebooks\htmlz\oeb2html.py", line 57, in oeb2html
File "calibre\ebooks\htmlz\oeb2html.py", line 342, in mlize_spine
TypeError: can only concatenate str (not "bytes") to str
5. AFAIK, I didn't change any option for the conversion to HTMLZ. I even went to the "HTMLZ Output" dialogue and clicked on "Restore defaults." I also disabled every user-installed plugin that allowed disabling. Still got the error.
Look at your log, right at the top is the option you have changed from defaults
htmlz_class_style: 'inline'
change that back to default and you will be fine. As for the bug with that option it will be fixed in the next release. And read: https://manual.calibre-ebook.com/con...for-conversion to understand hw to reset conversion options to defaults.
I now understand what I did wrong in my attempt to reset to defaults here -- the button in the conversion dialog resets to default as set by the user in the Preferences dialog, not to default-as-it-was-originally-on-first-install. My mistake, thanks for your help.
Well, apparently my cluelessness helped to reveal a bug, so it was not a total loss.
I have a number of markdown documents, the codes are quite stadardized. All seems to work fine. But I have a few questions
All the footnotes are as follows:
Code:
Here's a simple footnote,[^note] and here's a longer one.[^anote]
[^note]: This is the first footnote.
[^anote]: Here's one with multiple paragraphs and code.
All these notes are converted to a list (1, 2, 3.) but
1) They are appended to the last html file. Can can it be a separate file?
I used this to break the files which work with h2. //*[name()='h2' or div[@class="footnote"]].
2) I inserted ".footnote ol {padding: 0;}" to the "Look and Feel" before converting, but this has no effect.
No I dont think the markdown input processor has any way to insert page breaks before outputting footnotes. You can probably do it yourself by using extra css, something like footnote-selector::first-of-type {page-break-before: always}
No I dont think the markdown input processor has any way to insert page breaks before outputting footnotes. You can probably do it yourself by using extra css, something like footnote-selector::first-of-type {page-break-before: always}
What's .footnote??
Sorry, I hijacked this thread by mistake, created another thread, please delete for me
The .footnote is an interesting one.
Before I converted to epub, i just tap READ and Browser Viewer let me read it (by converting it on the fly). I prepared simple css to the Styles and .footnote works. That's why I copied the css for conversion. It has no TOC though, I had to convert to epub.
Since this document is in md and is updated regularly, I think I need a way to avoid dealing with the epub directly.
And the .footnote a { display: none;} is actually effective (the back-link is indeed hidden)