plan_site

Function plan_site 

Source
pub fn plan_site(
    lessons: &[(LessonSlug, Lesson)],
    target: BuildTarget,
    eval: &EvalSummary,
    site_config: &SiteConfig,
) -> Result<SiteFiles, PlanError>
Expand description

Plan the static site for lessons, targeting target, folding in the eval validation eval carries.

Pure (§2.1): it decides which files exist and their contents — embedded assets plus the per-lesson JSON contract — with no filesystem access, so the result is snapshot-testable. Refuses a language/target mismatch before producing anything (§1.3.1): every lesson must be in the target’s language, or the whole build fails with PlanError::LanguageMismatch and no SiteFiles are returned. Past that guard the build dispatches on the BuildTarget seam (§3.4) — each target contributing only its own shell + runner atop the shared assemble.

The eval-results page is target-independent, so it is folded in here once (§4.1) rather than per target: whichever runtime a site serves, the same EvalSummary renders the same page — its accuracy, or an explicit not-validated state — so “validation travels with the lessons”.