jupyter-book icon indicating copy to clipboard operation
jupyter-book copied to clipboard

Warn users about PDF builds changing the non-PDF HTML build

Open d33bs opened this issue 1 year ago • 0 comments

Thanks for the awesome work in this project! I noticed that when using jupyter-book build mybookname/ --builder pdfhtml that the HTML build is also changed to display all content on a single HTML page. In my scenario I built the HTML content, then built the PDF as a way to reference the content from a link on the same HTML host. I'm not absolutely certain, but this seemed to stem from the file _static/documentation_options.js in a line which references BUILDER: 'singlehtml', with PDF builds and BUILDER: 'html', in the HTML builds.

As a workaround to retain the original HTML content without modification (and without a 3rd build) I opted to copy the HTML build to a separate directory outside the built HTML, then run the --builder pdfhtml command against that copied version (grabbing the PDF individually afterwards and placing in the original HTML output).

I'd like to suggest that a warning to users be added within the documentation on https://jupyterbook.org/en/stable/advanced/pdf.html to help avoid this where desired. While I can see why this happens, I also wonder if the default behavior might be improved by avoiding the permanent modification of the HTML source.

d33bs avatar Jul 26 '24 21:07 d33bs