Skip to main content

Module process

Module process 

Source
Expand description

Argument-driven site processing.

Bridges the parsed [clap::ArgMatches] from cmd::Cli to the build pipeline orchestrated in crate::run. Responsibilities:

  • Resolve content / output / template directories from CLI flags or configuration files, applying sensible defaults when callers omit them.
  • Create build and site directories on disk, ensuring distinct paths so staticdatagen::compile can finalise output by renaming.

Most binaries should call crate::run rather than this module directly; the helpers here are exposed for tests and embedders that need a smaller building block than the full pipeline.

§Source files are immutable

As of issue #543, this module never writes back to any file under content/. An earlier preprocess_content helper used to rewrite markdown sources in place with a <!--frontmatter-processed--> sentinel; that path was destructive (it dirtied users’ git working trees on every build and left source files partially transformed if the build crashed mid-pass), was not load-bearing for any active plugin, and has been removed. Front-matter parsing now happens in memory inside staticdatagen::compiler::service::compile.

Enums§

ProcessError
Represents errors that may occur during argument processing.

Functions§

args
Processes CLI arguments and executes the corresponding site compilation workflow.
ensure_directory
Ensures the specified directory exists, creating it if necessary.
get_argument
Retrieves the value of a specified command-line argument.