Module

PuduLangDocgen.Docset

View source

A project folder loaded, built, and published

Types

Name Description
Options Command-line choices layered over the configuration
Loaded A project's folder and everything a build reads from it

Functions

Name Description
options Options that leave the configuration as written.
load A project read from its configuration file with options applied.
build A project built and, unless the run is dry, published incrementally.
buildAll The site built and published, then a PDF for every table of contents that sets `pdf`. Unlike `pdf`, a missing renderer is a warning here, so sites build on machines without a browser.
pdf The site built and published, then a PDF for every table of contents that sets `pdf`.
metadata API metadata written as files beside the configuration, in each source's format.
fingerprint A digest of every project file's path and content outside the output folder, which changes whenever a source the build reads changes.

options

fn options() -> Options

Options that leave the configuration as written.

Returns

Options

View source

load

fn load(configFile: Str, chosen: &Options) -> Result[Loaded, Array[Docgen.Diagnostic]]

A project read from its configuration file with options applied.

Parameters

configFile
Str
chosen
&Options

Returns

Result[Loaded, Array[Docgen.Diagnostic]]

View source

build

fn build(configFile: Str, chosen: &Options, extending: &Build.Extensions) -> Result[Docgen.Report, Array[Docgen.Diagnostic]]

A project built and, unless the run is dry, published incrementally.

Examples

Build the project in website with the default options and print its diagnostics:

Pudu
match Docset.build("website/docgen.json", &Docset.options(), &Build.extensions()) {
  case Ok(report) => {
    for problem in report.diagnostics { let _said = Io.writeLine(Docgen.describe(&problem)) }
    0
  }
  case Err(problems) => {
    for problem in problems { let _said = Io.writeErrorLine(Docgen.describe(&problem)) }
    1
  }
}

See Library usage for options and extensions.

Parameters

configFile
Str
chosen
&Options
extending
&Build.Extensions

Returns

Result[Docgen.Report, Array[Docgen.Diagnostic]]

View source

buildAll

fn buildAll(configFile: Str, chosen: &Options) -> Result[(Docgen.Report, Array[Str]), Array[Docgen.Diagnostic]]

The site built and published, then a PDF for every table of contents that sets pdf. Unlike pdf, a missing renderer is a warning here, so sites build on machines without a browser.

Parameters

configFile
Str
chosen
&Options

Returns

Result[(Docgen.Report, Array[Str]), Array[Docgen.Diagnostic]]

View source

pdf

fn pdf(configFile: Str, chosen: &Options) -> Result[Array[Str], Array[Docgen.Diagnostic]]

The site built and published, then a PDF for every table of contents that sets pdf.

Parameters

configFile
Str
chosen
&Options

Returns

Result[Array[Str], Array[Docgen.Diagnostic]]

View source

metadata

fn metadata(configFile: Str, chosen: &Options) -> Result[Array[Str], Array[Docgen.Diagnostic]]

API metadata written as files beside the configuration, in each source's format.

Parameters

configFile
Str
chosen
&Options

Returns

Result[Array[Str], Array[Docgen.Diagnostic]]

View source

fingerprint

fn fingerprint(configFile: Str, output: Str) -> Str

A digest of every project file's path and content outside the output folder, which changes whenever a source the build reads changes.

Parameters

configFile
Str
output
Str

Returns

Str

View source