Headless Server Developer Manual / Version 2307
Table Of ContentsUsing handler sets allows grouping and reusing handlers in different contexts. In order to achieve this goal the YAML way, one or more handlers are grouped into a list of handlers, that is a handler set.
Example:
handlerSets: text: &text_handlers - !Handler eventMatcher: !Matcher {qname: *em} outputHandler: !ElementWriter {writeElement: true, writeCharacters: true } - !Handler eventMatcher: !Matcher {qname: *strong} outputHandler: !ElementWriter {writeElement: true, writeCharacters: true }
The subsequent property 'text' is up to the author and may be named accordingly to the YAML rules.
The list of handlers is anchored to the alias 'text_handlers'.
Example: reuse '*text_handlers' for a named context
contexts: - !Context name: headline defaultHandler: !Handler outputHandler: !ElementWriter {writeCharacters: true} handlers: - *text_handlers ...