OutputPath

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.

Arbitrary Elements, like md and html, can be nested within an OutputPath to specify the contents of that directory.

Constructors

Link copied to clipboard
constructor(name: String, source: Source, buildPath: Path, markdownTemplate: MarkdownTemplate, includes: List<Path>)

Properties

Link copied to clipboard
Link copied to clipboard
val children: <Error class: unknown class>
Link copied to clipboard
open override val count: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun build(path: String): Path

Get a path to a file in the build directory relative to this path's source.

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
fun OutputPath.eval(script: Path, context: Map<String, Any?> = emptyMap()): Any?

Evaluate the Kotlin script file at script with the given context.

fun OutputPath.eval(script: String, context: Map<String, Any?> = emptyMap(), name: String? = null): Any?

Evaluate the Kotlin script string script with the given context.

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
open fun generate(location: Path? = null): Path
Link copied to clipboard
fun OutputPath.html(source: Path): <Error class: unknown class>

Copy an untemplated HTML file from the source to the destination.

Link copied to clipboard
fun OutputPath.include(path: Path, vararg parameters: Pair<String?, Any?>, functionName: String = "generate")
Link copied to clipboard
fun OutputPath.ktHtml(source: Path, context: Map<String, Any?> = emptyMap(), includes: List<Path> = this.includes): <Error class: unknown class>

Template the source file using the <?kt ... ?> syntax. For example,

Link copied to clipboard
fun OutputPath.ktMdTemplate(source: Path, contentKey: String = "content", context: Map<String, Any?> = emptyMap()): (html: String) -> String
Link copied to clipboard
fun OutputPath.ktTemplate(source: Path, context: Map<String, Any?> = emptyMap()): String
Link copied to clipboard
fun OutputPath.md(source: Path, markdownTemplate: MarkdownTemplate = this.markdownTemplate, attributesCustomizer: StatefulAttributeCustomizer = compoundAttributeCustomizer( ProcessedMarkdownFile::hrefFixingAttributesCustomizer, ProcessedMarkdownFile::headingIDAttributeCustomizer )): <Error class: unknown class>

Convert a Markdown file to an HTML body with the given template and attribute customizer. By default, hrefFixingAttributesCustomizer to retarget hrefs to html files and headingIDAttributeCustomizer to add IDs to headings are applied.

Link copied to clipboard
fun OutputPath.mdBasic(source: Path): <Error class: unknown class>

Convert a Markdown file to an HTML body directly with no templating or other post-processing. You likely don't want this one, use md for more flexibility.

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 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 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 src(path: String): Path

Get a path to a file in the source directory relative to this path's source.

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

Output content to destination.

Link copied to clipboard
open override fun toString(): String