daisy / pipeline-mod-braille

!! NOTE: This project is now part of the pipeline-modules project !! | Braille Production Modules for the DAISY Pipeline 2
1 stars 3 forks source link

Support navigation document-based sectioning depth in epub3-to-pef #93

Open josteinaj opened 8 years ago

josteinaj commented 8 years ago

In the nordic epub guidelines (and possibly other EPUBs as well, I'm not sure), we always start with a <h1> in each HTML flie, regardless of the actual sectioning depth in the book. If you have a file representing the cover, a file representing the foreword, one representing the part or volume, and more files representing chapters within the part/volume, then you won't get proper nesting when concatenating the files.

I suggest we add an XSLT step to the epub3-to-pef script which can be enabled or disabled with a script option (default should probably be true). The XSLT would take the navigation document and spine documents as input, and the output would be the spine documents with the <h1>-<h6> elements renamed to their appropriate sectioning depths.

bertfrees commented 4 years ago

We can add an option to px:html-merge to merge HTML documents based on a navigation doc and use that in px:epub3-to-pef.

On the other hand I'm also thinking about skipping the merge altogether and instead apply the CSS and XSLT stylesheets and the braille translation on each document individually, and support a sequence of documents at the input of the CSS formatter (https://github.com/daisy/pipeline-mod-braille/issues/195). The issue with merging and other pre-processing is that you have to take these things into account in your CSS. This is also partly the reason why we need the "apply-document-specific-stylesheets" option.

I think it would be best to keep the merge as an option, and make it more configurable like you suggest, but disable it by default.