reduce use of compound suffixes - adjust Path.suffix to split at last dot #526
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.
This PR joins two pieces of work that would normally be delivered in separate PRs, but the nature of the required changes made that difficult, thus this joint PR.
Changes in Behaviour
Path.suffix
now splits on the last dot, like most other APIs. This addresses issues where this behaviour did not meet user expectations, but also actual bugs that could occur when input sources contain multiple dots in the file name.The suffixes
.epub.css
and.epub.js
do no longer have a special meaning in Laika. Previously they marked these files as "to be used for EPUB output only" and likewise marked all.css
and.js
files without this compound suffix as "for HTML output only". This type of compound suffix was directly supported inPath.suffix
, causing the unexpected behaviour. But it was also overlapping/conflicting with an existing feature, which is to use HOCON to specify the output format the files contained in a directory should be included for (e.g.laika.targetFormats = [html, pdf]
). The latter is now the only means to limit the output format for input sources.Fixes #517