API for retrieving configuration values based on a string key and a decoder.
Config instances are used in many places in this library, each Document
,
DocumentTree
and Directive
has a Config instance associated with it.
One use case for configuration is controlling the behaviour of built-in features, like setting the navigation order or the depth for table of contents.
A second use case is user configuration, where custom variables can be set
in configuration files or headers and then referenced in templates or markup
with the syntax ${ref.path}
.
The key is a path separated by '.', which allows to reference nested objects in the configuration.
Built-in decoders are available for simple types like String
, Int
, Double
, Boolean
and any Seq
consisting of those values.
It also comes with a decoder for Path
, which resolves relative paths in the configuration
against the (virtual) path of the origin.
This API is usually used with values obtained by parsing HOCON, as specified in https://github.com/lightbend/config/blob/master/HOCON.md, but the API is generic and can also be used with values specified programmatically.
Please note that Laika does not depend on the Typesafe Config library or any of its commonly used Scala wrappers or forks. It has its own HOCON parser, which implements the full spec while still being minimal and lightweight. It also ensures the FP properties are kept intact, e.g. it has full referential transparency and does not throw Exceptions like most of the alternatives.
Attributes
- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- object EmptyConfig.typeclass ObjectConfig