-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--file-scope is broken for epub #8741
Comments
That's quite unexpected, because |
Here are the outputs you requested. There are differences between the two
output:
output: Additional Testing Test4 output: The TOC works correctly. The document was not split into multiple files according to level 1 headings. Test5 output: The TOC works correctly. The document was not split into multiple files according to level 1 headings. Here is the
output: |
OK, I see the issue. With
That extra Div (which keeps track of the source file name) is interfering with the splitting. |
Just ran into this as well. By combining all of my content into a single xhtml file in the epub, the resulting xhtml file is very large and the Calibre epub viewer at least completely hangs trying to open it. Without --file-scope I was getting individual xhtml files for each section level 1 heading as noted above. I'll avoid --file-scope for now but unfortunately that means I need to renumber in the footnotes in my input markdown files since they currently reuse numbers in each file. |
Note: I think the best place to apply a fix would be in To make this robust, we should have file-scope put a special marking on the Divs that are generated to hold the sections form a particular file, so they can be ignored by Or, even easier: instead of having file-scope add an id, we could have it add something like |
Linux POP!_OS 22.04
pandoc 3.1.2
Calibre 6.14
When an epub is created from pandoc markdown files using the --file-scope option, the output epub is not broken up into multiple files, even with the use of the --split-level option, and the generated TOC expects a multiple file epub.
For the demonstration epub outputs change the .zip extention to .epub, because GitHub doesn't allow uploading .epub.
metadata.md
test1.md
test2.md
Test1:
pandoc -f markdown -t epub --file-scope --metadata-file metadata.md -o file-scope-test.epub test1.md test2.md
output:
file-scope-test.zip
screenshot selecting a chapter:
The output epub is not split into multiple files according to the default behavior of splitting at level 1 headings, and the footnotes are formatted in the manner of a single file epub.
Test2:
pandoc -f markdown -t epub --file-scope --split-level=1 --metadata-file metadata.md -o file-scope-test_split-level.epub test1.md test2.md
output:
file-scope-test_split-level.zip
screenshot selecting a chapter:
The output epub is not split into multiple files when explicitly instructed split at level 1 headings, and the footnotes are formatted in the manner of a single file epub.
Test3:
This test is to show that pandoc behaves as expected when the --file-scope option is not used.
pandoc -f markdown -t epub --metadata-file metadata.md -o file-scope-test_no-file-scope.epub test1.md test2.md
output:
[WARNING] Duplicate note reference '1' at test2.md line 7 column 1
[WARNING] Duplicate note reference '2' at test2.md line 9 column 1
file-scope-test_no-file-scope.zip
screenshot selecting a chapter:
The output epub is split into multiple files according to the default behavior of splitting at level 1 headings, and there are conflicting footnotes (as expected).
The text was updated successfully, but these errors were encountered: