typelevel / Laika

Site and E-book Generator and Customizable Text Markup Transformer for sbt, Scala and Scala.js
https://typelevel.org/Laika/
Apache License 2.0
408 stars 44 forks source link

reduce use of compound suffixes - adjust Path.suffix to split at last dot #526

Closed jenshalm closed 11 months ago

jenshalm commented 11 months ago

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

  1. 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.

  2. 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 in Path.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