HtmlPostRenderer

class HtmlPostRenderer(context: Context, baseTemplateProcessor: () -> TemplateProcessor = { TemplateProcessor.fromResourceName("/render/html-wrapper.html.template") }) : PostRenderer

A PostRenderer that injects content into an HTML template, which supports out of the box:

  • RevealJS for slides rendering;

  • PagedJS for page-based rendering (e.g. books);

  • KaTeX for math rendering;

  • HighlightJS for code highlighting.

Parameters

baseTemplateProcessor

supplier of the base TemplateProcessor to inject with content and process

Constructors

Link copied to clipboard
constructor(context: Context, baseTemplateProcessor: () -> TemplateProcessor = { TemplateProcessor.fromResourceName("/render/html-wrapper.html.template") })

Properties

Link copied to clipboard

Rules that determine the default behavior of the media storage. For example, HTML requires local media to be accessible from the file system, hence it's preferred to copy local media to the output directory; it's not necessary to store remote media locally. On the other hand, for example, LaTeX rendering (not yet supported) would require all media to be stored locally, as it does not support remote media.

Functions

Link copied to clipboard
open override fun <T> accept(visitor: PostRendererVisitor<T>): T

Accepts a post-renderer visitor.

Link copied to clipboard

Creates a new instance of a template processor for this rendering strategy. A template adds static content to the output code, and supports injection of values via placeholder keys, like a template file. For example, an HTML wrapper may add <html><head>...</head><body>...</body></html>, with the content injected in body. See resources/render/html-wrapper.html.template for an HTML template.

Link copied to clipboard
open override fun generateResources(rendered: CharSequence): Set<OutputResource>

Generates the required output resources. Resources are abstractions of files that are generated during the rendering process and that can be saved on disk.

Link copied to clipboard

Wraps rendered code in a template.