Package-level declarations

Types

Link copied to clipboard
abstract class Element(val name: String)

The base output element type, representing a single file in the output directory. Subclasses must implement _generate to specify how that file should be generated.

Link copied to clipboard
open class OutputPath(val name: String, val source: Source, val buildPath: Path, var markdownTemplate: MarkdownTemplate, var includes: List<Path>) : Element

Represents a subdirectory in the output directory.

Link copied to clipboard
class Source(val sourcePath: Path) : Iterable<Path>
Link copied to clipboard

Functions

Link copied to clipboard
fun anonymous(name: String = "<anonymous>", f: (location: Path) -> List<Path>): Element
Link copied to clipboard
fun StringBuilder.cdata(configure: StringBuilder.() -> Unit = {})
Link copied to clipboard
fun OutputPath.cp(source: Path, destName: String = source.name): <Error class: unknown class>

Copies source to the output with the name destName.

Link copied to clipboard
fun OutputPath.dl(url: URL, destination: String? = null, useCache: Boolean = true): <Error class: unknown class>
fun OutputPath.dl(url: String, destination: String? = null, useCache: Boolean = true): <Error class: unknown class>

Download a file from the given url to destination. If destination is null, the last section of the URL will be used. By default, files are cached to the temporary directory so later runs won't download anything, but it can be disabled with useCache.

Link copied to clipboard
Link copied to clipboard

Escape this to an HTML-compatible string literal. Internally this uses org.apache.commons.text.StringEscapeUtils.escapeHtml4

Link copied to clipboard

Escape this to an XML-compatible string literal. Internally this uses org.apache.commons.text.StringEscapeUtils.escapeXml11

Link copied to clipboard
fun exec(executable: String, vararg arguments: String, workingDirectory: Path? = null, stdin: String? = null): String

Run an executable with arguments in workingDirectory while providing stdin and capture its stdout. This runs at evaluation time, not build time.

Link copied to clipboard
fun OutputPath.exec(executable: String, vararg arguments: Any, workingDirectory: Path? = null): String

Run an executable with arguments in workingDirectory and capture its stdout. This runs at evaluation time, not build time.

Link copied to clipboard
fun String.highlight(language: String): String?

Highlight this according to language, returning an HTML string. If the language doesn't exist, it returns null.

Link copied to clipboard

Highlight this according to language, returning an ANSI color-coded string. If the language doesn't exist, it returns null.

Link copied to clipboard
fun html(inner: StringBuilder.() -> Unit = {}): <Error class: unknown class>

Create a new XML builder context.

Link copied to clipboard
fun OutputPath.include(path: Path, vararg parameters: Pair<String?, Any?>, functionName: String = "generate")
Link copied to clipboard
operator fun String.invoke(vararg attributes: Pair<String, Any?>, inner: StringBuilder.() -> Unit = {})
operator fun String.invoke(vararg attributes: Pair<String, Any?>, inner: StringBuilder.() -> Unit = {}): <Error class: unknown class>
Link copied to clipboard

Extract the frontmatter block from srcText.

Link copied to clipboard
fun OutputPath.path(name: String, markdownTemplate: MarkdownTemplate = this.markdownTemplate, includes: List<Path> = this.includes, block: OutputPath.() -> Unit): <Error class: unknown class>

Represents a subdirectory in the output directory.

Link copied to clipboard
fun StringBuilder.prolog(version: String = "1.0", encoding: String = "UTF-8")
Link copied to clipboard
fun renderTeX(string: String, style: TeXStyle = TeXStyle.Display): String?
Link copied to clipboard
fun root(sourceDirectory: Source, block: RootPath.() -> Unit): <Error class: unknown class>
fun root(sourceDirectory: String = ".", block: RootPath.() -> Unit): <Error class: unknown class>

Represents the root directory. Use path to define subdirectories.

Link copied to clipboard
fun OutputPath.run(name: String = "run", block: OutputPath.(location: Path) -> List<Path>): <Error class: unknown class>

Run block at build time.

Link copied to clipboard
fun runScript(kts: String, context: Map<String, Any?>, name: String? = null, includes: List<Path> = emptyList()): Any?

Run the given Kotlin script kts with context.

Link copied to clipboard
fun OutputPath.runScript(kts: String, context: Map<String, Any?>, name: String? = null): Any?

Run the given Kotlin script kts with context.

Link copied to clipboard
fun OutputPath.shell(executable: String, vararg arguments: Any, workingDirectory: Path = buildPath, showStdOut: Boolean = true): <Error class: unknown class>

Run an executable at build time in the build directory with the given arguments.

Link copied to clipboard
fun templateString(string: String, onErrorAction: () -> Unit, templateAction: (String) -> String): String

Template the given string string using templateAction.

Link copied to clipboard
fun OutputPath.text(destination: String, content: () -> String): <Error class: unknown class>

Output content to destination.

Link copied to clipboard

Unescape this HTML-compatible literal to a plain string. Internally this uses org.apache.commons.text.StringEscapeUtils.unescapeHtml4

Link copied to clipboard

Unescape this XML-compatible literal to a plain string. Internally this uses org.apache.commons.text.StringEscapeUtils.unescapeXml

Link copied to clipboard
fun xml(inner: StringBuilder.() -> Unit = {}): <Error class: unknown class>

Create a new XML builder context.

Link copied to clipboard
fun <T> yaml(path: Path): T

Read YAML from path and cast it to T

fun <T> yaml(text: String): T

Read YAML from text and cast it to T