-
Notifications
You must be signed in to change notification settings - Fork 452
Description
Background
Dokka plugins may want to provide their own implementations for how certain HTML elements are rendered. It is possible to do now by overriding specific functions inside HtmlRenderer
, such as buildHeader()
.
However, if a plugin wants to add some additional / optional / conditional rendering, it's very difficult to do it in backward-compatible manner (see #2435 for more details).
For example, the dokka-mermaid plugin only needs to provide an implementation for the mermaid
language code blocks, while everything else (including the default behaviour) should stay the same.
Task
Rendering of HTML code blocks (HtmlRenderer#buildCodeBlock
) should be extracted into a separate HTML-only extension point, similar to how CustomTagContentProvider
is implemented.
For any given language x
, if no extension is found that knows how to render it, it should be rendered in the default way (same logic as exists now).