HtmlPostRenderer
class HtmlPostRenderer(val context: Context, relativePathToRoot: String = ".", base: HtmlOnlyPostRenderer = HtmlOnlyPostRenderer(
context,
relativePathToRoot = relativePathToRoot,
), resourcesProvider: () -> Set<PostRendererResource> = {
setOfNotNull(
ThemePostRendererResource(
theme = context.documentInfo.theme.orDefault(DEFAULT_THEME),
locale = context.documentInfo.locale,
),
ScriptPostRendererResource(),
MediaPostRendererResource(context.mediaStorage),
if (context.documentInfo.type == DocumentType.DOCS) {
SearchIndexPostRendererResource(SearchIndexGenerator.generate(context.sharedSubdocumentsData))
} else {
null
},
)
}) : PostRenderer
A PostRenderer that wraps content into a full HTML document. This includes all the features of HtmlOnlyPostRenderer, plus:
Theme components
Runtime scripts
Media resources
Parameters
context
the Context of the document being rendered
relativePathToRoot
relative path from the current document to the root document, used to correctly link resources
base
the base HtmlOnlyPostRenderer to delegate HTML generation to
resourcesProvider
supplier of the set of PostRendererResource to include in the output. Delegation to base is always included
Constructors
Link copied to clipboard
constructor(context: Context, relativePathToRoot: String = ".", base: HtmlOnlyPostRenderer = HtmlOnlyPostRenderer(
context,
relativePathToRoot = relativePathToRoot,
), resourcesProvider: () -> Set<PostRendererResource> = {
setOfNotNull(
ThemePostRendererResource(
theme = context.documentInfo.theme.orDefault(DEFAULT_THEME),
locale = context.documentInfo.locale,
),
ScriptPostRendererResource(),
MediaPostRendererResource(context.mediaStorage),
if (context.documentInfo.type == DocumentType.DOCS) {
SearchIndexPostRendererResource(SearchIndexGenerator.generate(context.sharedSubdocumentsData))
} else {
null
},
)
})