Document

data class Document(val title: String, val children: List<ReportNode>, val defaultOutputDir: Path? = null, val defaultPlotDir: Path? = null) : ReportNode(source)

The root node of a report document.

Parameters

title

the document title, used as the top-level heading

children

ordered list of child nodes

defaultOutputDir

optional default directory for rendered report files

defaultPlotDir

optional default directory for plot files emitted while rendering

Constructors

Link copied to clipboard
constructor(title: String, children: List<ReportNode>, defaultOutputDir: Path? = null, defaultPlotDir: Path? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun accept(visitor: ReportVisitor)

Double-dispatch entry point — each node calls the appropriate visitor method.

Link copied to clipboard
fun ReportNode.Document.printMarkdown(out: PrintWriter = PrintWriter(System.out, true), ctx: RenderContext? = null)

Renders this document as Markdown and writes it to out.

Link copied to clipboard
fun ReportNode.Document.printText(out: PrintWriter = PrintWriter(System.out, true), ctx: RenderContext? = null)

Renders this document as plain text and writes it to out.

Link copied to clipboard
fun ReportNode.Document.showInBrowser(ctx: RenderContext? = null, cssPath: Path? = null, css: String? = null): File

Renders this document to HTML, writes it to a temporary file in ctx.outputDir, opens the file in the system default browser, and returns the written File.

Link copied to clipboard
fun ReportNode.Document.toHtml(ctx: RenderContext? = null, cssPath: Path? = null, css: String? = null): String

Renders this document to a complete HTML page String (the same content writeHtml writes to a file) without creating any file. Useful for carrying a rendered report across a process/network boundary or embedding it.

Link copied to clipboard

Renders this document to a Markdown String without creating any file.

Link copied to clipboard

Renders this document to a plain-text String without creating any file.

Link copied to clipboard
fun ReportNode.Document.writeHtml(path: Path? = null, ctx: RenderContext? = null, cssPath: Path? = null, css: String? = null): File

Renders this document to an HTML file and returns the written File.

Link copied to clipboard
fun ReportNode.Document.writeLaTeX(path: Path? = null, ctx: RenderContext? = null): File

Renders this document to a LaTeX source file and returns the written File.

Link copied to clipboard
fun ReportNode.Document.writeMarkdown(path: Path? = null, ctx: RenderContext? = null): File

Renders this document to a Markdown file and returns the written File.

Link copied to clipboard
fun ReportNode.Document.writeText(path: Path? = null, ctx: RenderContext? = null): File

Renders this document to a plain-text file and returns the written File.