Selections

object Selections

Companion for creating selection config instances that can be passed to Laika configuration and builders that produce configuration of all possible combinations of @:select directives.

See the documentation for the @:select directive in the manual for the full context of this feature.

Companion:
class
trait Product
trait Mirror
class Object
trait Matchable
class Any

Type members

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from:
Mirror

Value members

Concrete methods

def apply(selection: SelectionConfig, selections: SelectionConfig*): Selections

Groups configuration for one or more @:select directives in an instance that can be passed to Laika configuration.

Groups configuration for one or more @:select directives in an instance that can be passed to Laika configuration.

Example for Laika's own manual, which allows the user to chose between seeing configuration examples for sbt or for the library API:

laikaConfig := LaikaConfig.defaults
 .withConfigValue(Selections(
   SelectionConfig("config",
     ChoiceConfig("sbt", "sbt Plugin"),
     ChoiceConfig("library", "Library API")
   ).withSeparateEbooks
 ))

See the documentation for the @:select directive in the manual for the full context of this feature.

Creates all valid combinations of choices for the given configuration instance. The returned chain contains tuples that contain both, the modified document tree that can be passed to EPUB or PDF renderers to produce a specific version of the document tree only containing one set of selections and the classifiers that can be appended to the artifact name for distinction.

Creates all valid combinations of choices for the given configuration instance. The returned chain contains tuples that contain both, the modified document tree that can be passed to EPUB or PDF renderers to produce a specific version of the document tree only containing one set of selections and the classifiers that can be appended to the artifact name for distinction.

Concretely this means that you pass in a single document tree obtained from a parser that might contain one or more @:select directives for alternate content the user can choose from, and get back several new document trees where in each of them all but one of the choices have been removed from every @:select directive. This is useful for e-book rendering where it is not desirable or possible to show the alternative content in interactive tabs. It is therefore used for EPUB and PDF rendering, but not for site generation.

This is a rather low-level method that you'd only need to use if you want to replicate the functionality that Laika's sbt plugin offers around producing different variants of the same documentation, based on the use of @:select directives in text markup.

See the documentation for the @:select directive in the manual in this case for the full context of this feature.

Creates all valid combinations of choices for the given configuration instance.

Creates all valid combinations of choices for the given configuration instance.

This is a rather low-level method that you'd only need to use if you want to replicate the functionality that Laika's sbt plugin offers around producing different variants of the same documentation, based on the use of @:select directives in text markup.

See the documentation for the @:select directive in the manual in this case for the full context of this feature.

In contrast to the createCombinations method this one is mostly useful for features like generating a download page for all e-book artifacts produced by the renderer as it also contains the label information.

Concrete fields

Implicits

Implicits

implicit val key: DefaultKey[Selections]