Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In addition to some CSS fixes implemented during testing, this supports and implements using Prince for Books as the default Prince version for PDF output. This is associated with electricbookworks/node-prince#4.
One important change here is that we now pass the book's stylesheet to Prince as a 'user stylesheet'. The advantage of this is that Prince will apply the stylesheet to any SVGs referenced in the document with
img src="*.svg"
. In previous Prince versions, it was already the case that the book's CSS would apply to SVGs. This had the advantage of letting us apply the parent document's fonts to SVGs. The potential downside of loading the styles as a user stylesheet is that this appears to replace (not just 'extend') the CSS loaded bystyle
tags in the HTML. For our use case, this is fine since we only ever load one stylesheet, but in theory one could reference multiple stylesheets in HTML, which may then be ignored when we load a user stylesheet. I think this is worth it, given the importance of loading fonts correctly in SVGs, without having to define font styles and paths to font files in individual SVG files.The current version of Prince for Books appears to be based on Prince 14. We may soon switch to Prince 15 instead, given its support for a proper @sidenotes area. There is not yet a Prince for Books based on Prince 15.